From e1d9c290843aa94bfd4530442f879c1c0e1dffd0 Mon Sep 17 00:00:00 2001 From: Scott Addie <10702007+scottaddie@users.noreply.github.com> Date: Tue, 20 Aug 2024 09:39:42 -0500 Subject: [PATCH 01/71] Restore DAC auth flow diagram (#45601) --- .../images/mermaidjs/DefaultAzureCredentialAuthFlow.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 sdk/identity/Azure.Identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg diff --git a/sdk/identity/Azure.Identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg b/sdk/identity/Azure.Identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg new file mode 100644 index 0000000000000..f60052a3a0662 --- /dev/null +++ b/sdk/identity/Azure.Identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg @@ -0,0 +1 @@ +DefaultAzureCredential authentication flow;Flowchart showing the credential chain implemented by DefaultAzureCredential;
CREDENTIALS
Interactive browser
Environment
Workload Identity
Managed Identity
Visual Studio
Azure CLI
Azure PowerShell
Azure Developer CLI
CREDENTIAL TYPES
Interactive
Deployed service
Developer tool
\ No newline at end of file From d5f3c397728a00bc1f2c2ae886991fa22e38ed16 Mon Sep 17 00:00:00 2001 From: "Jianing Wang (MSFT)" <141212663+jianingwang123@users.noreply.github.com> Date: Wed, 21 Aug 2024 01:37:10 +0800 Subject: [PATCH 02/71] Fix Azure Storage DataMovement FilesShares Samples Issue (#45558) * fix/45322 * Update-Snippet --- sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md | 2 +- .../samples/Sample01b_HelloWorldAsync.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md index 4deb335aad25f..33e0c4a02c4f6 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md @@ -116,7 +116,7 @@ Upload a directory. ```C# Snippet:SimpleDirectoryUpload_Shares DataTransfer folderTransfer = await transferManager.StartTransferAsync( - sourceResource: files.FromFile(sourceLocalDirectory), + sourceResource: files.FromDirectory(sourceLocalDirectory), destinationResource: shares.FromDirectory(destinationFolderUri)); await folderTransfer.WaitForCompletionAsync(); ``` diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs index 77ffff12a88ce..b9427ce812b27 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs @@ -124,7 +124,7 @@ public async Task Upload() #region Snippet:SimpleDirectoryUpload_Shares DataTransfer folderTransfer = await transferManager.StartTransferAsync( - sourceResource: files.FromFile(sourceLocalDirectory), + sourceResource: files.FromDirectory(sourceLocalDirectory), destinationResource: shares.FromDirectory(destinationFolderUri)); await folderTransfer.WaitForCompletionAsync(); #endregion From e1d47e1c01a96762b8a85fde8b5338854ef43f5f Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Tue, 20 Aug 2024 15:32:43 -0400 Subject: [PATCH 03/71] [Storage] Copy Blob APIs Authentication references updated REST API doc (#45590) * Initial commit * Added for BlobBaseClient.SyncCopyFromUri & BlockBlobClient.SyncUploadFromUri --- .../Azure.Storage.Blobs/src/BlobBaseClient.cs | 67 ++++++------------- .../src/BlockBlobClient.cs | 30 ++++----- 2 files changed, 37 insertions(+), 60 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index c1416524f0221..93d74d194a85e 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -3247,12 +3247,8 @@ internal async Task OpenReadInternal( /// /// Specifies the of the source blob. The value may /// be a of up to 2 KB in length that specifies a - /// blob. A source blob in the same storage account can be - /// authenticated via Shared Key. However, if the source is a blob in - /// another account, the source blob must either be public or must be - /// authenticated via a shared access signature. If the source blob - /// is public, no authentication is required to perform the copy - /// operation. + /// blob. + /// Source Blob Authentication /// /// The source object may be a file in the Azure File service. If the /// source object is a file that is to be copied to a blob, then the @@ -3314,12 +3310,8 @@ public virtual CopyFromUriOperation StartCopyFromUri( /// /// Specifies the of the source blob. The value may /// be a of up to 2 KB in length that specifies a - /// blob. A source blob in the same storage account can be - /// authenticated via Shared Key. However, if the source is a blob in - /// another account, the source blob must either be public or must be - /// authenticated via a shared access signature. If the source blob - /// is public, no authentication is required to perform the copy - /// operation. + /// blob. + /// Source Blob Authentication /// /// The source object may be a file in the Azure File service. If the /// source object is a file that is to be copied to a blob, then the @@ -3402,12 +3394,8 @@ public virtual CopyFromUriOperation StartCopyFromUri( /// /// Specifies the of the source blob. The value may /// be a of up to 2 KB in length that specifies a - /// blob. A source blob in the same storage account can be - /// authenticated via Shared Key. However, if the source is a blob in - /// another account, the source blob must either be public or must be - /// authenticated via a shared access signature. If the source blob - /// is public, no authentication is required to perform the copy - /// operation. + /// blob. + /// Source Blob Authentication /// /// The source object may be a file in the Azure File service. If the /// source object is a file that is to be copied to a blob, then the @@ -3469,12 +3457,8 @@ public virtual async Task StartCopyFromUriAsync( /// /// Specifies the of the source blob. The value may /// be a of up to 2 KB in length that specifies a - /// blob. A source blob in the same storage account can be - /// authenticated via Shared Key. However, if the source is a blob in - /// another account, the source blob must either be public or must be - /// authenticated via a shared access signature. If the source blob - /// is public, no authentication is required to perform the copy - /// operation. + /// blob. + /// Source Blob Authentication /// /// The source object may be a file in the Azure File service. If the /// source object is a file that is to be copied to a blob, then the @@ -3557,12 +3541,8 @@ public virtual async Task StartCopyFromUriAsync( /// /// Specifies the of the source blob. The value may /// be a of up to 2 KB in length that specifies a - /// blob. A source blob in the same storage account can be - /// authenticated via Shared Key. However, if the source is a blob in - /// another account, the source blob must either be public or must be - /// authenticated via a shared access signature. If the source blob - /// is public, no authentication is required to perform the copy - /// operation. + /// blob. + /// Source Blob Authentication /// /// The source object may be a file in the Azure File service. If the /// source object is a file that is to be copied to a blob, then the @@ -3921,11 +3901,10 @@ private async Task AbortCopyFromUriInternal( /// /// /// Required. Specifies the URL of the source blob. The value may be a URL of up to 2 KB in length - /// that specifies a blob. The value should be URL-encoded as it would appear in a request URI. The - /// source blob must either be public or must be authorized via a shared access signature. If the - /// source blob is public, no authorization is required to perform the operation. If the size of the - /// source blob is greater than 256 MiB, the request will fail with 409 (Conflict). The blob type of - /// the source blob has to be block blob. + /// that specifies a blob. The value should be URL-encoded as it would appear in a request URI. + /// + /// Source Blob Authentication If the size of the source blob is greater than 256 MiB, the request will fail + /// with 409 (Conflict). The blob type of the source blob has to be block blob. /// /// /// Optional parameters. @@ -3975,11 +3954,10 @@ public virtual Response SyncCopyFromUri( /// /// /// Required. Specifies the URL of the source blob. The value may be a URL of up to 2 KB in length - /// that specifies a blob. The value should be URL-encoded as it would appear in a request URI. The - /// source blob must either be public or must be authorized via a shared access signature. If the - /// source blob is public, no authorization is required to perform the operation. If the size of the - /// source blob is greater than 256 MiB, the request will fail with 409 (Conflict). The blob type of - /// the source blob has to be block blob. + /// that specifies a blob. The value should be URL-encoded as it would appear in a request URI. + /// + /// Source Blob Authentication If the size of the source blob is greater than 256 MiB, the request will fail + /// with 409 (Conflict). The blob type of the source blob has to be block blob. /// /// /// Optional parameters. @@ -4029,11 +4007,10 @@ public virtual async Task> SyncCopyFromUriAsync( /// /// /// Required. Specifies the URL of the source blob. The value may be a URL of up to 2 KB in length - /// that specifies a blob. The value should be URL-encoded as it would appear in a request URI. The - /// source blob must either be public or must be authorized via a shared access signature. If the - /// source blob is public, no authorization is required to perform the operation. If the size of the - /// source blob is greater than 256 MiB, the request will fail with 409 (Conflict). The blob type of - /// the source blob has to be block blob. + /// that specifies a blob. The value should be URL-encoded as it would appear in a request URI. + /// + /// Source Blob Authentication If the size of the source blob is greater than 256 MiB, the request will fail + /// with 409 (Conflict). The blob type of the source blob has to be block blob. /// /// /// Optional custom metadata to set for this blob. diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs index cd6bc3788fc26..b873b9bc7129e 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs @@ -2840,9 +2840,9 @@ internal async Task OpenWriteInternal( /// Required. Specifies the URL of the source blob. The source blob may be of any type, /// including a block blob, append blob, or page blob. The value may be a URL of up to 2 /// KiB in length that specifies a blob. The value should be URL-encoded as it would appear - /// in a request URI. The source blob must either be public or must be authorized via a - /// shared access signature. If the source blob is public, no authorization is required - /// to perform the operation. + /// in a request URI. + /// + /// Source Blob Authentication /// /// /// Whether the upload should overwrite the existing blob. The @@ -2884,9 +2884,9 @@ public virtual Response SyncUploadFromUri( /// Required. Specifies the URL of the source blob. The source blob may be of any type, /// including a block blob, append blob, or page blob. The value may be a URL of up to 2 /// KiB in length that specifies a blob. The value should be URL-encoded as it would appear - /// in a request URI. The source blob must either be public or must be authorized via a - /// shared access signature. If the source blob is public, no authorization is required - /// to perform the operation. + /// in a request URI. + /// + /// Source Blob Authentication /// /// /// Whether the upload should overwrite the existing blob. The @@ -2928,9 +2928,9 @@ public virtual async Task> SyncUploadFromUriAsync( /// Required. Specifies the URL of the source blob. The source blob may be of any type, /// including a block blob, append blob, or page blob. The value may be a URL of up to 2 /// KiB in length that specifies a blob. The value should be URL-encoded as it would appear - /// in a request URI. The source blob must either be public or must be authorized via a - /// shared access signature. If the source blob is public, no authorization is required - /// to perform the operation. + /// in a request URI. + /// + /// Source Blob Authentication /// /// /// Optional parameters. @@ -2970,9 +2970,9 @@ public virtual Response SyncUploadFromUri( /// Required. Specifies the URL of the source blob. The source blob may be of any type, /// including a block blob, append blob, or page blob. The value may be a URL of up to 2 /// KiB in length that specifies a blob. The value should be URL-encoded as it would appear - /// in a request URI. The source blob must either be public or must be authorized via a - /// shared access signature. If the source blob is public, no authorization is required - /// to perform the operation. + /// in a request URI. + /// + /// Source Blob Authentication /// /// /// Optional parameters. @@ -3012,9 +3012,9 @@ public virtual async Task> SyncUploadFromUriAsync( /// Required. Specifies the URL of the source blob. The source blob may be of any type, /// including a block blob, append blob, or page blob. The value may be a URL of up to 2 /// KiB in length that specifies a blob. The value should be URL-encoded as it would appear - /// in a request URI. The source blob must either be public or must be authorized via a - /// shared access signature. If the source blob is public, no authorization is required - /// to perform the operation. + /// in a request URI. + /// + /// Source Blob Authentication /// /// /// Optional parameters. From 5dd7b105a748f5ffb25095c794f26144a85e8ccb Mon Sep 17 00:00:00 2001 From: Jose Arriaga Maldonado <45773732+joseharriaga@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:38:02 -0700 Subject: [PATCH 04/71] [System.ClientModel] Remove the implicit cast from string to ApiKeyCredential (#45554) Removes the implicit cast from `string` to `ApiKeyCredential` because it's confusing and doesn't version well. --- sdk/core/System.ClientModel/CHANGELOG.md | 2 ++ .../api/System.ClientModel.net6.0.cs | 1 - .../api/System.ClientModel.netstandard2.0.cs | 1 - .../src/Convenience/ApiKeyCredential.cs | 3 --- .../Pipeline/ApiKeyAuthenticationPolicyTests.cs | 13 ------------- 5 files changed, 2 insertions(+), 18 deletions(-) diff --git a/sdk/core/System.ClientModel/CHANGELOG.md b/sdk/core/System.ClientModel/CHANGELOG.md index 6878bacb6092e..e924704c34ea4 100644 --- a/sdk/core/System.ClientModel/CHANGELOG.md +++ b/sdk/core/System.ClientModel/CHANGELOG.md @@ -10,6 +10,8 @@ ### Other Changes +- Removed implicit cast from `string` to `ApiKeyCredential`. + ## 1.1.0-beta.7 (2024-08-14) ### Features Added diff --git a/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs b/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs index 38a53857153d1..a510e31d07d78 100644 --- a/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs +++ b/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs @@ -4,7 +4,6 @@ public partial class ApiKeyCredential { public ApiKeyCredential(string key) { } public void Deconstruct(out string key) { throw null; } - public static implicit operator System.ClientModel.ApiKeyCredential (string key) { throw null; } public void Update(string key) { } } public abstract partial class AsyncCollectionResult : System.ClientModel.ClientResult, System.Collections.Generic.IAsyncEnumerable diff --git a/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs b/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs index 2a716c72f50d2..ad3a7a378fc0d 100644 --- a/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs +++ b/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs @@ -4,7 +4,6 @@ public partial class ApiKeyCredential { public ApiKeyCredential(string key) { } public void Deconstruct(out string key) { throw null; } - public static implicit operator System.ClientModel.ApiKeyCredential (string key) { throw null; } public void Update(string key) { } } public abstract partial class AsyncCollectionResult : System.ClientModel.ClientResult, System.Collections.Generic.IAsyncEnumerable diff --git a/sdk/core/System.ClientModel/src/Convenience/ApiKeyCredential.cs b/sdk/core/System.ClientModel/src/Convenience/ApiKeyCredential.cs index 25968d7b4550b..5549597debbb8 100644 --- a/sdk/core/System.ClientModel/src/Convenience/ApiKeyCredential.cs +++ b/sdk/core/System.ClientModel/src/Convenience/ApiKeyCredential.cs @@ -65,7 +65,4 @@ public void Update(string key) Volatile.Write(ref _key, key); } - - /// Converts a string to an . - public static implicit operator ApiKeyCredential(string key) => new(key); } diff --git a/sdk/core/System.ClientModel/tests/Pipeline/ApiKeyAuthenticationPolicyTests.cs b/sdk/core/System.ClientModel/tests/Pipeline/ApiKeyAuthenticationPolicyTests.cs index e5638343fbfb2..874e6ba0c7b6a 100644 --- a/sdk/core/System.ClientModel/tests/Pipeline/ApiKeyAuthenticationPolicyTests.cs +++ b/sdk/core/System.ClientModel/tests/Pipeline/ApiKeyAuthenticationPolicyTests.cs @@ -16,19 +16,6 @@ public ApiKeyAuthenticationPolicyTests(bool isAsync) : base(isAsync) { } - [Test] - public void CanImplicitlyCastApiKeyCredential() - { - string keyValue = "test_key"; - ApiKeyCredential credential1 = new(keyValue); - ApiKeyCredential credential2 = keyValue; - - credential1.Deconstruct(out string deconstructed1); - credential2.Deconstruct(out string deconstructed2); - - Assert.AreEqual(deconstructed1, deconstructed2); - } - [Test] public async Task HeaderPolicySetsKey() { From 868afcb182e8ace7213b38b7bcebc7a8f413b067 Mon Sep 17 00:00:00 2001 From: Timothy Mothra Date: Tue, 20 Aug 2024 12:51:06 -0700 Subject: [PATCH 05/71] [AzureMonitorLiveMetrics] new project for service reference (#45550) * new project for service reference * Rename Readme.md to README.md --- .github/CODEOWNERS | 3 + .../README.md | 8 + ...e.Monitor.OpenTelemetry.LiveMetrics.csproj | 16 + .../src/Generated/Internal/Argument.cs | 129 ++++++ .../Internal/ChangeTrackingDictionary.cs | 167 ++++++++ .../Generated/Internal/ChangeTrackingList.cs | 153 +++++++ .../Internal/ModelSerializationExtensions.cs | 395 ++++++++++++++++++ .../MultipartFormDataRequestContent.cs | 203 +++++++++ .../src/Generated/Internal/Optional.cs | 51 +++ .../Internal/RequestContentHelper.cs | 136 ++++++ .../Internal/Utf8JsonRequestContent.cs | 55 +++ ...estAPIsForClientSDKsIsSubscribedHeaders.cs | 28 ++ ...ricsRestAPIsForClientSDKsPublishHeaders.cs | 24 ++ ...eMetricsRestAPIsForClientSDKsRestClient.cs | 278 ++++++++++++ .../src/Generated/Models/AggregationType.cs | 57 +++ ...lectionConfigurationError.Serialization.cs | 42 ++ .../Models/CollectionConfigurationError.cs | 57 +++ .../CollectionConfigurationErrorType.cs | 84 ++++ ...llectionConfigurationInfo.Serialization.cs | 73 ++++ .../Models/CollectionConfigurationInfo.cs | 55 +++ .../Models/DerivedMetricInfo.Serialization.cs | 82 ++++ .../src/Generated/Models/DerivedMetricInfo.cs | 70 ++++ ...ilterConjunctionGroupInfo.Serialization.cs | 46 ++ .../DocumentFilterConjunctionGroupInfo.cs | 32 ++ .../Models/DocumentIngress.Serialization.cs | 51 +++ .../src/Generated/Models/DocumentIngress.cs | 44 ++ .../DocumentStreamInfo.Serialization.cs | 52 +++ .../Generated/Models/DocumentStreamInfo.cs | 44 ++ .../src/Generated/Models/DocumentType.cs | 63 +++ .../Generated/Models/Event.Serialization.cs | 56 +++ .../src/Generated/Models/Event.cs | 35 ++ .../Models/Exception.Serialization.cs | 61 +++ .../src/Generated/Models/Exception.cs | 39 ++ ...ilterConjunctionGroupInfo.Serialization.cs | 46 ++ .../Models/FilterConjunctionGroupInfo.cs | 37 ++ .../Models/FilterInfo.Serialization.cs | 52 +++ .../src/Generated/Models/FilterInfo.cs | 37 ++ .../KeyValuePairString.Serialization.cs | 33 ++ .../Generated/Models/KeyValuePairString.cs | 33 ++ .../Models/MetricPoint.Serialization.cs | 35 ++ .../src/Generated/Models/MetricPoint.cs | 36 ++ .../MonitoringDataPoint.Serialization.cs | 95 +++++ .../Generated/Models/MonitoringDataPoint.cs | 118 ++++++ .../src/Generated/Models/PredicateType.cs | 69 +++ .../Models/ProcessCpuData.Serialization.cs | 33 ++ .../src/Generated/Models/ProcessCpuData.cs | 32 ++ .../QuotaConfigurationInfo.Serialization.cs | 56 +++ .../Models/QuotaConfigurationInfo.cs | 40 ++ .../Models/RemoteDependency.Serialization.cs | 71 ++++ .../src/Generated/Models/RemoteDependency.cs | 47 +++ .../Generated/Models/Request.Serialization.cs | 71 ++++ .../src/Generated/Models/Request.cs | 48 +++ .../Models/ServiceError.Serialization.cs | 64 +++ .../src/Generated/Models/ServiceError.cs | 48 +++ .../src/Generated/Models/TelemetryType.cs | 66 +++ .../Generated/Models/Trace.Serialization.cs | 56 +++ .../src/Generated/Models/Trace.cs | 35 ++ .../src/autorest.md | 17 + sdk/monitor/Azure.Monitor.OpenTelemetry.sln | 8 +- 59 files changed, 3971 insertions(+), 1 deletion(-) create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/README.md create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Azure.Monitor.OpenTelemetry.LiveMetrics.csproj create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Argument.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/MultipartFormDataRequestContent.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Optional.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/RequestContentHelper.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsPublishHeaders.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsRestClient.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/AggregationType.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationErrorType.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentType.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/PredicateType.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/TelemetryType.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.Serialization.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/autorest.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7bb4a5be1858d..d446704467e1f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -662,6 +662,9 @@ # ServiceLabel: %Monitor - Exporter # ServiceOwners: @cijothomas @reyang @rajkumar-rangaraj @TimothyMothra @vishweshbankwar +# PRLabel: %Monitor - LiveMetrics +/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/ @cijothomas @reyang @rajkumar-rangaraj @TimothyMothra @vishweshbankwar @xiang17 + # ServiceLabel: %Monitor - LiveMetrics # ServiceOwners: @cijothomas @reyang @rajkumar-rangaraj @TimothyMothra @vishweshbankwar @xiang17 diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/README.md b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/README.md new file mode 100644 index 0000000000000..d9d54bb38a7f3 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/README.md @@ -0,0 +1,8 @@ +# Azure Monitor OpenTelemetry LiveMetrics code sharing library + +This library is intended to serve as a common location for non-public code for the [Live Metrics](https://learn.microsoft.com/azure/azure-monitor/app/live-stream) REST API. +The [Azure Monitor OpenTelemetry Exporter](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter) includes these artifacts by shared links to enable them to be loosely hosted within those projects rather than consumed by direct project or package reference. + +## Contributing + +See [CONTRIBUTING.md](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for details on contribution process. diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Azure.Monitor.OpenTelemetry.LiveMetrics.csproj b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Azure.Monitor.OpenTelemetry.LiveMetrics.csproj new file mode 100644 index 0000000000000..c0e7b47e567fe --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Azure.Monitor.OpenTelemetry.LiveMetrics.csproj @@ -0,0 +1,16 @@ + + + + Azure.Monitor.OpenTelemetry.Exporter shared code library + 1.0.0 + $(RequiredTargetFrameworks) + false + true + + + + + + + + diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Argument.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Argument.cs new file mode 100644 index 0000000000000..05b2583ac62aa --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.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 Azure.Monitor.OpenTelemetry.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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 0000000000000..2ccd52fb2fc7d --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.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 Azure.Monitor.OpenTelemetry.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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ChangeTrackingList.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 0000000000000..d3d310bb63c1b --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.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 Azure.Monitor.OpenTelemetry.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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 0000000000000..a8139122f57d0 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,395 @@ +// 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 Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + 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) + { + switch (value) + { + case null: + writer.WriteNullValue(); + 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); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item); + } + 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) + { + writer.WriteObjectValue(value); + } + + 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/MultipartFormDataRequestContent.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/MultipartFormDataRequestContent.cs new file mode 100644 index 0000000000000..6246a4304cb25 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/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 Azure.Monitor.OpenTelemetry.LiveMetrics +{ + 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Optional.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Optional.cs new file mode 100644 index 0000000000000..7a820ce70c4f1 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.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 Azure.Monitor.OpenTelemetry.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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/RequestContentHelper.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/RequestContentHelper.cs new file mode 100644 index 0000000000000..c4ecf95c18da6 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.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 Azure.Monitor.OpenTelemetry.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); + } + 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)) + { + 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]); + } + 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); + } + 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)) + { + 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); + 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)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 0000000000000..34342d231645e --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.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 Azure.Monitor.OpenTelemetry.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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders.cs new file mode 100644 index 0000000000000..6060611374733 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal partial class LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders + { + private readonly Response _response; + public LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders(Response response) + { + _response = response; + } + /// An encoded string that indicates whether the collection configuration is changed. + public string XMsQpsConfigurationEtag => _response.Headers.TryGetValue("x-ms-qps-configuration-etag", out string value) ? value : null; + /// Contains a URI of the service endpoint that the client must permanently use for the particular resource. This header exists only when the client is talking to Live Metrics global endpoint. + public string XMsQpsServiceEndpointRedirectV2 => _response.Headers.TryGetValue("x-ms-qps-service-endpoint-redirect-v2", out string value) ? value : null; + /// Recommended time (in milliseconds) before the client should ping the service again. This header exists only when the instrumentation key is not subscribed to. + public string XMsQpsServicePollingIntervalHint => _response.Headers.TryGetValue("x-ms-qps-service-polling-interval-hint", out string value) ? value : null; + /// A boolean flag indicating whether there are active user sessions 'watching' the instrumentation key. If true, the client must start collecting data and posting it to Live Metrics. Otherwise, the client must keep pinging. + public string XMsQpsSubscribed => _response.Headers.TryGetValue("x-ms-qps-subscribed", out string value) ? value : null; + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsPublishHeaders.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsPublishHeaders.cs new file mode 100644 index 0000000000000..70151eb29ffcf --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsPublishHeaders.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal partial class LiveMetricsRestAPIsForClientSDKsPublishHeaders + { + private readonly Response _response; + public LiveMetricsRestAPIsForClientSDKsPublishHeaders(Response response) + { + _response = response; + } + /// An encoded string that indicates whether the collection configuration is changed. + public string XMsQpsConfigurationEtag => _response.Headers.TryGetValue("x-ms-qps-configuration-etag", out string value) ? value : null; + /// Tells the client whether the input instrumentation key is subscribed to. + public string XMsQpsSubscribed => _response.Headers.TryGetValue("x-ms-qps-subscribed", out string value) ? value : null; + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsRestClient.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsRestClient.cs new file mode 100644 index 0000000000000..749796cc365f0 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsRestClient.cs @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Monitor.OpenTelemetry.LiveMetrics.Models; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal partial class LiveMetricsRestAPIsForClientSDKsRestClient + { + private readonly HttpPipeline _pipeline; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// Initializes a new instance of LiveMetricsRestAPIsForClientSDKsRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Api Version. + /// , or is null. + public LiveMetricsRestAPIsForClientSDKsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "2024-04-01-preview") + { + ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _apiVersion = apiVersion ?? throw new ArgumentNullException(nameof(apiVersion)); + } + + internal HttpMessage CreateIsSubscribedRequest(string endpoint, string ikey, long? transmissionTime, string machineName, string instanceName, string streamId, string roleName, string invariantVersion, string configurationEtag, MonitoringDataPoint monitoringDataPoint) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, true); + uri.AppendPath("/QuickPulseService.svc/ping", false); + uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendQuery("ikey", ikey, true); + request.Uri = uri; + 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); + } + request.Headers.Add("Accept", "application/json"); + if (monitoringDataPoint != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(monitoringDataPoint); + request.Content = content; + } + return message; + } + + /// Determine whether there is any subscription to the metrics and documents. + /// The endpoint of the Live Metrics service. The default value is "https://global.livediagnostics.monitor.azure.com". + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// 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. + /// 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. + /// The cancellation token to use. + /// or is null. + public async Task> IsSubscribedAsync(string endpoint, string ikey, long? transmissionTime = null, string machineName = null, string instanceName = null, string streamId = null, string roleName = null, string invariantVersion = null, string configurationEtag = null, MonitoringDataPoint monitoringDataPoint = null, CancellationToken cancellationToken = default) + { + if (endpoint == null) + { + throw new ArgumentNullException(nameof(endpoint)); + } + if (ikey == null) + { + throw new ArgumentNullException(nameof(ikey)); + } + + using var message = CreateIsSubscribedRequest(endpoint, ikey, transmissionTime, machineName, instanceName, streamId, roleName, invariantVersion, configurationEtag, monitoringDataPoint); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + CollectionConfigurationInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CollectionConfigurationInfo.DeserializeCollectionConfigurationInfo(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Determine whether there is any subscription to the metrics and documents. + /// The endpoint of the Live Metrics service. The default value is "https://global.livediagnostics.monitor.azure.com". + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// 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. + /// 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. + /// The cancellation token to use. + /// or is null. + public ResponseWithHeaders IsSubscribed(string endpoint, string ikey, long? transmissionTime = null, string machineName = null, string instanceName = null, string streamId = null, string roleName = null, string invariantVersion = null, string configurationEtag = null, MonitoringDataPoint monitoringDataPoint = null, CancellationToken cancellationToken = default) + { + if (endpoint == null) + { + throw new ArgumentNullException(nameof(endpoint)); + } + if (ikey == null) + { + throw new ArgumentNullException(nameof(ikey)); + } + + using var message = CreateIsSubscribedRequest(endpoint, ikey, transmissionTime, machineName, instanceName, streamId, roleName, invariantVersion, configurationEtag, monitoringDataPoint); + _pipeline.Send(message, cancellationToken); + var headers = new LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + CollectionConfigurationInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CollectionConfigurationInfo.DeserializeCollectionConfigurationInfo(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreatePublishRequest(string endpoint, string ikey, string configurationEtag, long? transmissionTime, IEnumerable monitoringDataPoints) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, true); + uri.AppendPath("/QuickPulseService.svc/post", false); + uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendQuery("ikey", ikey, true); + request.Uri = uri; + if (configurationEtag != null) + { + request.Headers.Add("x-ms-qps-configuration-etag", configurationEtag); + } + if (transmissionTime != null) + { + request.Headers.Add("x-ms-qps-transmission-time", transmissionTime.Value); + } + request.Headers.Add("Accept", "application/json"); + if (monitoringDataPoints != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in monitoringDataPoints) + { + content.JsonWriter.WriteObjectValue(item); + } + content.JsonWriter.WriteEndArray(); + request.Content = content; + } + return message; + } + + /// Publish live metrics to the Live Metrics service when there is an active subscription to the metrics. + /// The endpoint of the Live Metrics service. The default value is "https://global.livediagnostics.monitor.azure.com". + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// 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. + /// 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. + /// The cancellation token to use. + /// or is null. + public async Task> PublishAsync(string endpoint, string ikey, string configurationEtag = null, long? transmissionTime = null, IEnumerable monitoringDataPoints = null, CancellationToken cancellationToken = default) + { + if (endpoint == null) + { + throw new ArgumentNullException(nameof(endpoint)); + } + if (ikey == null) + { + throw new ArgumentNullException(nameof(ikey)); + } + + using var message = CreatePublishRequest(endpoint, ikey, configurationEtag, transmissionTime, monitoringDataPoints); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new LiveMetricsRestAPIsForClientSDKsPublishHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + CollectionConfigurationInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CollectionConfigurationInfo.DeserializeCollectionConfigurationInfo(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Publish live metrics to the Live Metrics service when there is an active subscription to the metrics. + /// The endpoint of the Live Metrics service. The default value is "https://global.livediagnostics.monitor.azure.com". + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// 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. + /// 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. + /// The cancellation token to use. + /// or is null. + public ResponseWithHeaders Publish(string endpoint, string ikey, string configurationEtag = null, long? transmissionTime = null, IEnumerable monitoringDataPoints = null, CancellationToken cancellationToken = default) + { + if (endpoint == null) + { + throw new ArgumentNullException(nameof(endpoint)); + } + if (ikey == null) + { + throw new ArgumentNullException(nameof(ikey)); + } + + using var message = CreatePublishRequest(endpoint, ikey, configurationEtag, transmissionTime, monitoringDataPoints); + _pipeline.Send(message, cancellationToken); + var headers = new LiveMetricsRestAPIsForClientSDKsPublishHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + CollectionConfigurationInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CollectionConfigurationInfo.DeserializeCollectionConfigurationInfo(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/AggregationType.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/AggregationType.cs new file mode 100644 index 0000000000000..e5cc1d40f9735 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/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 Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Aggregation type. + internal 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 string 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.Serialization.cs new file mode 100644 index 0000000000000..d7a4b9df2d176 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.Serialization.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class CollectionConfigurationError : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + 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); + } + writer.WriteEndArray(); + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.cs new file mode 100644 index 0000000000000..1e9cc01e46559 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Represents an error while SDK parses and applies an instance of CollectionConfigurationInfo. + internal partial class CollectionConfigurationError + { + /// 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. + internal CollectionConfigurationError(CollectionConfigurationErrorType collectionConfigurationErrorType, string message, string fullException, IList data) + { + CollectionConfigurationErrorType = collectionConfigurationErrorType; + Message = message; + FullException = fullException; + Data = data; + } + + /// 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationErrorType.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationErrorType.cs new file mode 100644 index 0000000000000..0b5853e2c56e1 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/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 Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Collection configuration error type reported by the client SDK. + internal 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 string 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.Serialization.cs new file mode 100644 index 0000000000000..160706521a0bd --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.Serialization.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class CollectionConfigurationInfo + { + internal static CollectionConfigurationInfo DeserializeCollectionConfigurationInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string eTag = default; + IReadOnlyList metrics = default; + IReadOnlyList documentStreams = default; + QuotaConfigurationInfo quotaInfo = default; + 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)); + } + metrics = array; + continue; + } + if (property.NameEquals("DocumentStreams"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentStreamInfo.DeserializeDocumentStreamInfo(item)); + } + documentStreams = array; + continue; + } + if (property.NameEquals("QuotaInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + quotaInfo = QuotaConfigurationInfo.DeserializeQuotaConfigurationInfo(property.Value); + continue; + } + } + return new CollectionConfigurationInfo(eTag, metrics, documentStreams, quotaInfo); + } + + /// 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); + return DeserializeCollectionConfigurationInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.cs new file mode 100644 index 0000000000000..866535b02f436 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Represents the collection configuration - a customizable description of performance counters, metrics, and full telemetry documents to be collected by the client SDK. + internal partial class CollectionConfigurationInfo + { + /// 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. + internal CollectionConfigurationInfo(string eTag, IReadOnlyList metrics, IReadOnlyList documentStreams, QuotaConfigurationInfo quotaInfo) + { + ETag = eTag; + Metrics = metrics; + DocumentStreams = documentStreams; + QuotaInfo = quotaInfo; + } + + /// 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.Serialization.cs new file mode 100644 index 0000000000000..9101bf764e5df --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.Serialization.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class DerivedMetricInfo + { + internal static DerivedMetricInfo DeserializeDerivedMetricInfo(JsonElement element) + { + 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; + 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)); + } + 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; + } + } + return new DerivedMetricInfo( + id, + telemetryType, + filterGroups, + projection, + aggregation, + backEndAggregation); + } + + /// 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); + return DeserializeDerivedMetricInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.cs new file mode 100644 index 0000000000000..fc89e7d1c05f8 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// A metric configuration set by UX to scope the metrics it's interested in. + internal partial class DerivedMetricInfo + { + /// 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. + internal DerivedMetricInfo(string id, string telemetryType, IReadOnlyList filterGroups, string projection, AggregationType aggregation, AggregationType backEndAggregation) + { + Id = id; + TelemetryType = telemetryType; + FilterGroups = filterGroups; + Projection = projection; + Aggregation = aggregation; + BackEndAggregation = backEndAggregation; + } + + /// 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.Serialization.cs new file mode 100644 index 0000000000000..25f595b4111e6 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class DocumentFilterConjunctionGroupInfo + { + internal static DocumentFilterConjunctionGroupInfo DeserializeDocumentFilterConjunctionGroupInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TelemetryType telemetryType = default; + FilterConjunctionGroupInfo filters = default; + 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); + continue; + } + } + return new DocumentFilterConjunctionGroupInfo(telemetryType, filters); + } + + /// 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); + return DeserializeDocumentFilterConjunctionGroupInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.cs new file mode 100644 index 0000000000000..d61bb69653213 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// A collection of filters for a specific telemetry type. + internal partial class DocumentFilterConjunctionGroupInfo + { + /// 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; + } + + /// Telemetry type. + public TelemetryType TelemetryType { get; } + /// An array of filter groups. + public FilterConjunctionGroupInfo Filters { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.Serialization.cs new file mode 100644 index 0000000000000..cde93f504bc32 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class DocumentIngress : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + 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); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.cs new file mode 100644 index 0000000000000..2514fbf02f8e0 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// + /// 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 . + /// + internal abstract partial class DocumentIngress + { + /// 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. + internal DocumentIngress(DocumentType documentType, IList documentStreamIds, IList properties) + { + DocumentType = documentType; + DocumentStreamIds = documentStreamIds; + Properties = properties; + } + + /// 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.Serialization.cs new file mode 100644 index 0000000000000..6986d457b18ba --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class DocumentStreamInfo + { + internal static DocumentStreamInfo DeserializeDocumentStreamInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + IReadOnlyList documentFilterGroups = default; + 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)); + } + documentFilterGroups = array; + continue; + } + } + return new DocumentStreamInfo(id, documentFilterGroups); + } + + /// 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); + return DeserializeDocumentStreamInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.cs new file mode 100644 index 0000000000000..beb1992a4c075 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Configurations/filters set by UX to scope the document/telemetry it's interested in. + internal partial class DocumentStreamInfo + { + /// 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. + internal DocumentStreamInfo(string id, IReadOnlyList documentFilterGroups) + { + Id = id; + DocumentFilterGroups = documentFilterGroups; + } + + /// 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentType.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentType.cs new file mode 100644 index 0000000000000..df6d7662e786a --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/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 Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// 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 string 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.Serialization.cs new file mode 100644 index 0000000000000..07b9e6628e369 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class Event : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("Name"u8); + writer.WriteStringValue(Name); + } + 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); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.cs new file mode 100644 index 0000000000000..046b2cdf87de8 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Event document type. + internal 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. + /// Event name. + internal Event(DocumentType documentType, IList documentStreamIds, IList properties, string name) : base(documentType, documentStreamIds, properties) + { + Name = name; + DocumentType = documentType; + } + + /// Event name. + public string Name { get; set; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.Serialization.cs new file mode 100644 index 0000000000000..5e03596fe4314 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class Exception : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ExceptionType)) + { + writer.WritePropertyName("ExceptionType"u8); + writer.WriteStringValue(ExceptionType); + } + if (Optional.IsDefined(ExceptionMessage)) + { + writer.WritePropertyName("ExceptionMessage"u8); + writer.WriteStringValue(ExceptionMessage); + } + 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); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.cs new file mode 100644 index 0000000000000..0fb637419fe62 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Exception document type. + internal 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. + /// Exception type name. + /// Exception message. + internal Exception(DocumentType documentType, IList documentStreamIds, IList properties, string exceptionType, string exceptionMessage) : base(documentType, documentStreamIds, properties) + { + ExceptionType = exceptionType; + ExceptionMessage = exceptionMessage; + DocumentType = documentType; + } + + /// Exception type name. + public string ExceptionType { get; set; } + /// Exception message. + public string ExceptionMessage { get; set; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.Serialization.cs new file mode 100644 index 0000000000000..a9b1451beace6 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class FilterConjunctionGroupInfo + { + internal static FilterConjunctionGroupInfo DeserializeFilterConjunctionGroupInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList filters = default; + 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)); + } + filters = array; + continue; + } + } + return new FilterConjunctionGroupInfo(filters); + } + + /// 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); + return DeserializeFilterConjunctionGroupInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.cs new file mode 100644 index 0000000000000..9d70c4c9e2705 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// An AND-connected group of FilterInfo objects. + internal partial class FilterConjunctionGroupInfo + { + /// 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. + internal FilterConjunctionGroupInfo(IReadOnlyList filters) + { + Filters = filters; + } + + /// An array of filters. + public IReadOnlyList Filters { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.Serialization.cs new file mode 100644 index 0000000000000..f1b1261bef6cc --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class FilterInfo + { + internal static FilterInfo DeserializeFilterInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string fieldName = default; + PredicateType predicate = default; + string comparand = default; + 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; + } + } + return new FilterInfo(fieldName, predicate, comparand); + } + + /// 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); + return DeserializeFilterInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.cs new file mode 100644 index 0000000000000..766708559dd09 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// A filter set on UX. + internal partial class FilterInfo + { + /// 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; + } + + /// 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.Serialization.cs new file mode 100644 index 0000000000000..6afcfcc484a9e --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class KeyValuePairString : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.cs new file mode 100644 index 0000000000000..a16fc2ccec390 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Key-value pair of string and string. + internal partial class KeyValuePairString + { + /// Initializes a new instance of . + /// Key of the key-value pair. + /// Value of the key-value pair. + /// or is null. + public KeyValuePairString(string key, string value) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + Key = key; + Value = value; + } + + /// Key of the key-value pair. + public string Key { get; } + /// Value of the key-value pair. + public string Value { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.Serialization.cs new file mode 100644 index 0000000000000..1be293870dbcc --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class MetricPoint : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("Name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("Value"u8); + writer.WriteNumberValue(Value); + writer.WritePropertyName("Weight"u8); + writer.WriteNumberValue(Weight); + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.cs new file mode 100644 index 0000000000000..0b26ef61db318 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Metric data point. + internal partial class MetricPoint + { + /// 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; + } + + /// Metric name. + public string Name { get; } + /// Metric value. + public double Value { get; } + /// Metric weight. + public int Weight { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.Serialization.cs new file mode 100644 index 0000000000000..8717cfa87d2a3 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.Serialization.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class MonitoringDataPoint : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + 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); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("Documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TopCpuProcesses)) + { + writer.WritePropertyName("TopCpuProcesses"u8); + writer.WriteStartArray(); + foreach (var item in TopCpuProcesses) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(CollectionConfigurationErrors)) + { + writer.WritePropertyName("CollectionConfigurationErrors"u8); + writer.WriteStartArray(); + foreach (var item in CollectionConfigurationErrors) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.cs new file mode 100644 index 0000000000000..1d9efae8b4268 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Monitoring data point coming from the client, which includes metrics, documents and other metadata info. + internal partial class MonitoringDataPoint + { + /// 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. + 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) + { + 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; + } + + /// 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/PredicateType.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/PredicateType.cs new file mode 100644 index 0000000000000..05515dd5afd9d --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/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 Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Enum representing the different types of predicates. + internal 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 string 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.Serialization.cs new file mode 100644 index 0000000000000..2f9201151fdf2 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class ProcessCpuData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("ProcessName"u8); + writer.WriteStringValue(ProcessName); + writer.WritePropertyName("CpuPercentage"u8); + writer.WriteNumberValue(CpuPercentage); + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.cs new file mode 100644 index 0000000000000..756e9a6be7587 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// CPU consumption datapoint. + internal partial class ProcessCpuData + { + /// 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; + } + + /// Process name. + public string ProcessName { get; } + /// CPU consumption percentage. + public int CpuPercentage { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.Serialization.cs new file mode 100644 index 0000000000000..484e18a43c78d --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class QuotaConfigurationInfo + { + internal static QuotaConfigurationInfo DeserializeQuotaConfigurationInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float? initialQuota = default; + float maxQuota = default; + float quotaAccrualRatePerSec = default; + 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; + } + } + return new QuotaConfigurationInfo(initialQuota, maxQuota, quotaAccrualRatePerSec); + } + + /// 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); + return DeserializeQuotaConfigurationInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.cs new file mode 100644 index 0000000000000..0c867233b6488 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Controls document quotas to be sent to Live Metrics. + internal partial class QuotaConfigurationInfo + { + /// 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. + internal QuotaConfigurationInfo(float? initialQuota, float maxQuota, float quotaAccrualRatePerSec) + { + InitialQuota = initialQuota; + MaxQuota = maxQuota; + QuotaAccrualRatePerSec = quotaAccrualRatePerSec; + } + + /// 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.Serialization.cs new file mode 100644 index 0000000000000..4f1be14a41601 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class RemoteDependency : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + 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); + } + 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); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.cs new file mode 100644 index 0000000000000..bdf92382863b0 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// RemoteDependency document type. + internal 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. + /// 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, string name, string commandName, string resultCode, string duration) : base(documentType, documentStreamIds, properties) + { + Name = name; + CommandName = commandName; + ResultCode = resultCode; + Duration = duration; + DocumentType = documentType; + } + + /// 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.Serialization.cs new file mode 100644 index 0000000000000..b764d499e60bd --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class Request : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + 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); + } + 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); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.cs new file mode 100644 index 0000000000000..4dc10467a7c81 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/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 Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Request document type. + internal 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. + /// 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, string name, Uri url, string responseCode, string duration) : base(documentType, documentStreamIds, properties) + { + Name = name; + Url = url; + ResponseCode = responseCode; + Duration = duration; + DocumentType = documentType; + } + + /// 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.Serialization.cs new file mode 100644 index 0000000000000..de36722eb0ad8 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class ServiceError + { + internal static ServiceError DeserializeServiceError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string requestId = default; + string responseDateTime = default; + string code = default; + string message = default; + string exception = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("RequestId"u8)) + { + requestId = property.Value.GetString(); + continue; + } + if (property.NameEquals("ResponseDateTime"u8)) + { + responseDateTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("Code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("Message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("Exception"u8)) + { + exception = property.Value.GetString(); + continue; + } + } + return new ServiceError(requestId, responseDateTime, code, message, exception); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ServiceError FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeServiceError(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.cs new file mode 100644 index 0000000000000..a4ca56c39489b --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Optional http response body, whose existence carries additional error descriptions. + internal partial class ServiceError + { + /// Initializes a new instance of . + /// A globally unique identifier to identify the diagnostic context. It defaults to the empty GUID. + /// Service error response date time. + /// Error code. + /// Error message. + /// Message of the exception that triggers the error response. + /// , , , or is null. + internal ServiceError(string requestId, string responseDateTime, string code, string message, string exception) + { + Argument.AssertNotNull(requestId, nameof(requestId)); + Argument.AssertNotNull(responseDateTime, nameof(responseDateTime)); + Argument.AssertNotNull(code, nameof(code)); + Argument.AssertNotNull(message, nameof(message)); + Argument.AssertNotNull(exception, nameof(exception)); + + RequestId = requestId; + ResponseDateTime = responseDateTime; + Code = code; + Message = message; + Exception = exception; + } + + /// A globally unique identifier to identify the diagnostic context. It defaults to the empty GUID. + public string RequestId { get; } + /// Service error response date time. + public string ResponseDateTime { get; } + /// Error code. + public string Code { get; } + /// Error message. + public string Message { get; } + /// Message of the exception that triggers the error response. + public string Exception { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/TelemetryType.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/TelemetryType.cs new file mode 100644 index 0000000000000..3033ee40dbaa1 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/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 Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Telemetry type. + internal 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 string 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/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.Serialization.cs new file mode 100644 index 0000000000000..97cef47d2b155 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class Trace : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("Message"u8); + writer.WriteStringValue(Message); + } + 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); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.cs new file mode 100644 index 0000000000000..8e57c03ae6f45 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Trace document type. + internal 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. + /// Trace message. + internal Trace(DocumentType documentType, IList documentStreamIds, IList properties, string message) : base(documentType, documentStreamIds, properties) + { + Message = message; + DocumentType = documentType; + } + + /// Trace message. + public string Message { get; set; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/autorest.md b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/autorest.md new file mode 100644 index 0000000000000..bcea6e40eeea5 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/autorest.md @@ -0,0 +1,17 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateCode` to generate code. + +``` yaml +input-file: + - https://github.com/Azure/azure-rest-api-specs/blob/665e7c3b6f26b148b3c05e55602621bc293cc0a4/specification/applicationinsights/data-plane/LiveMetrics/preview/2024-04-01-preview/livemetrics.json +generation1-convenience-client: true +``` + +``` yaml +directive: +- from: swagger-document + where: $.definitions.* + transform: > + $["x-accessibility"]="internal" +``` diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.sln b/sdk/monitor/Azure.Monitor.OpenTelemetry.sln index 184e404a8a035..a289deb5ff7f5 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.sln +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.sln @@ -54,7 +54,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Monitor.OpenTelemetry EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Monitor.OpenTelemetry.AspNetCore.Benchmarks", "Azure.Monitor.OpenTelemetry.AspNetCore\tests\AspNetCore.Benchmarks\Azure.Monitor.OpenTelemetry.AspNetCore.Benchmarks.csproj", "{273FDDEB-62E9-4B29-B4C2-5F0F10E9B2C9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Monitor.AspNetCoreTestApp", "Azure.Monitor.OpenTelemetry.AspNetCore\tests\Azure.Monitor.AspNetCoreTestApp\Azure.Monitor.AspNetCoreTestApp.csproj", "{01657383-7C75-4C0A-9278-61755C4E3DC9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Monitor.AspNetCoreTestApp", "Azure.Monitor.OpenTelemetry.AspNetCore\tests\Azure.Monitor.AspNetCoreTestApp\Azure.Monitor.AspNetCoreTestApp.csproj", "{01657383-7C75-4C0A-9278-61755C4E3DC9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Monitor.OpenTelemetry.LiveMetrics", "Azure.Monitor.OpenTelemetry.LiveMetrics\src\Azure.Monitor.OpenTelemetry.LiveMetrics.csproj", "{0C961663-8E54-4560-A71A-74D33936586F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -126,6 +128,10 @@ Global {01657383-7C75-4C0A-9278-61755C4E3DC9}.Debug|Any CPU.Build.0 = Debug|Any CPU {01657383-7C75-4C0A-9278-61755C4E3DC9}.Release|Any CPU.ActiveCfg = Release|Any CPU {01657383-7C75-4C0A-9278-61755C4E3DC9}.Release|Any CPU.Build.0 = Release|Any CPU + {0C961663-8E54-4560-A71A-74D33936586F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0C961663-8E54-4560-A71A-74D33936586F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0C961663-8E54-4560-A71A-74D33936586F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0C961663-8E54-4560-A71A-74D33936586F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From ab120de65ff8cdcc6f21c729a46b4eab19d861cc Mon Sep 17 00:00:00 2001 From: Nisha Bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:13:05 -0700 Subject: [PATCH 06/71] [Azure.Monitor.Query] Update LogsQueryClient Audience logic in constructor (#45429) --- eng/.docsettings.yml | 1 + sdk/monitor/Azure.Monitor.Query/CHANGELOG.md | 3 +- sdk/monitor/Azure.Monitor.Query/README.md | 8 ++- .../api/Azure.Monitor.Query.netstandard2.0.cs | 2 + .../src/Azure.Monitor.Query.csproj | 2 +- .../src/LogsQueryClient.cs | 22 +++++- .../tests/LogsQueryClientTests.cs | 71 ++++++++++++++++--- .../tests/MetricsQueryClientSamples.cs | 8 ++- 8 files changed, 99 insertions(+), 18 deletions(-) diff --git a/eng/.docsettings.yml b/eng/.docsettings.yml index 12545ab0ec1b2..074f72e1f330a 100644 --- a/eng/.docsettings.yml +++ b/eng/.docsettings.yml @@ -129,6 +129,7 @@ known_content_issues: - ['sdk/storage/Azure.Storage.Common/README.md','azure-sdk-tools/issues/404'] - ['sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md','https://github.com/Azure/azure-sdk-tools/issues/404'] - ['sdk/webpubsub/Azure.Messaging.WebPubSub/README.md', 'azure-sdk-tools/issues/404 - requires different name for auth section'] + - ['sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/README.md', 'Opt out of sections: https://github.com/Azure/azure-sdk-tools/issues/404'] - ['sdk/anomalydetector/Azure.AI.AnomalyDetector/README.md', '#25936: Needs Examples'] - ['sdk/personalizer/Azure.AI.Personalizer/README.md','#24535: Needs content'] diff --git a/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md b/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md index 47ba53a66641f..c2c25ee27bd23 100644 --- a/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md +++ b/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md @@ -1,12 +1,13 @@ # Release History -## 1.5.0-beta.1 (Unreleased) +## 1.5.0 (Unreleased) ### Features Added ### Breaking Changes ### Bugs Fixed +- Fix bug in `LogsQueryClient` that defaulted to `Azure.PublicCloud`. `Audience` is now determined from the `endpoint` parameter. ### Other Changes diff --git a/sdk/monitor/Azure.Monitor.Query/README.md b/sdk/monitor/Azure.Monitor.Query/README.md index 4a00caaee2483..a3f60cb420fbb 100644 --- a/sdk/monitor/Azure.Monitor.Query/README.md +++ b/sdk/monitor/Azure.Monitor.Query/README.md @@ -84,12 +84,16 @@ var metricsQueryClient = new MetricsQueryClient( new DefaultAzureCredential(), metricsQueryClientOptions); -// LogsQueryClient +// LogsQueryClient - by default, Azure Public Cloud is used +var logsQueryClient = new LogsQueryClient( + new DefaultAzureCredential()); + +// LogsQueryClient With Audience Set var logsQueryClientOptions = new LogsQueryClientOptions { Audience = LogsQueryAudience.AzureChina }; -var logsQueryClient = new LogsQueryClient( +var logsQueryClientChina = new LogsQueryClient( new DefaultAzureCredential(), logsQueryClientOptions); ``` diff --git a/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs b/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs index ff2a0bbf96537..41e38f81678e8 100644 --- a/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs +++ b/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs @@ -29,7 +29,9 @@ public partial class LogsQueryClient protected LogsQueryClient() { } public LogsQueryClient(Azure.Core.TokenCredential credential) { } public LogsQueryClient(Azure.Core.TokenCredential credential, Azure.Monitor.Query.LogsQueryClientOptions options) { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public LogsQueryClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public LogsQueryClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Monitor.Query.LogsQueryClientOptions options) { } public System.Uri Endpoint { get { throw null; } } public static string CreateQuery(System.FormattableString query) { throw null; } diff --git a/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj b/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj index 4b98f11baf27c..efd42c3a2bf8c 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj +++ b/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj @@ -2,7 +2,7 @@ A library for querying Azure Monitor's Logs and Metrics data sources. Azure Monitor Query client library - 1.5.0-beta.1 + 1.5.0 1.4.0 Azure Monitor Query diff --git a/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs b/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs index d0b91a607cdc4..1d22fe76060e4 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs +++ b/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Globalization; using System.Text; using System.Text.Json; @@ -56,6 +57,7 @@ public LogsQueryClient(TokenCredential credential, LogsQueryClientOptions option /// /// The service endpoint to use. /// The instance to use for authentication. + [EditorBrowsable(EditorBrowsableState.Never)] public LogsQueryClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, null) { } @@ -66,6 +68,7 @@ public LogsQueryClient(Uri endpoint, TokenCredential credential) : this(endpoint /// The service endpoint to use. /// The instance to use for authentication. /// The instance to use as client configuration. + [EditorBrowsable(EditorBrowsableState.Never)] public LogsQueryClient(Uri endpoint, TokenCredential credential, LogsQueryClientOptions options) { Argument.AssertNotNull(credential, nameof(credential)); @@ -73,8 +76,23 @@ public LogsQueryClient(Uri endpoint, TokenCredential credential, LogsQueryClient Endpoint = endpoint; options ??= new LogsQueryClientOptions(); - var authorizationScope = $"{(string.IsNullOrEmpty(options.Audience?.ToString()) ? LogsQueryAudience.AzurePublicCloud : options.Audience)}"; - authorizationScope += "//.default"; + + // Set authorization scope from Endpoint if Audience is not set. + string authorizationScope = ""; + if (string.IsNullOrEmpty(options.Audience?.ToString())) + { + // Endpoint.AbsoluteUri includes an extra / so only adding one here + authorizationScope = $"{endpoint.AbsoluteUri}/.default"; + } + else if (endpoint.Host != new Uri(options.Audience.ToString()).Host) + { + throw new InvalidOperationException("The endpoint URI and audience do not match. If setting the Audience to a regionally specific value, please use the LogsQueryClient(TokenCredential, LogsQueryClientOptions) constructor."); + } + else + { + authorizationScope = $"{options.Audience}//.default"; + } + var scopes = new List { authorizationScope }; endpoint = new Uri(endpoint, options.GetVersionString()); diff --git a/sdk/monitor/Azure.Monitor.Query/tests/LogsQueryClientTests.cs b/sdk/monitor/Azure.Monitor.Query/tests/LogsQueryClientTests.cs index c75bc674bd73a..d2cfdcfd5afb9 100644 --- a/sdk/monitor/Azure.Monitor.Query/tests/LogsQueryClientTests.cs +++ b/sdk/monitor/Azure.Monitor.Query/tests/LogsQueryClientTests.cs @@ -287,33 +287,84 @@ public void ValidateMonitorModelFactoryTableCreation() } [Test] - public void Constructor_WhenOptionsIsNull_UsesDefaultEndpoint() + public void Constructor_WhenOptionsAndEndpointIsNull_UsesDefaultEndpoint() { - // Arrange var credential = new DefaultAzureCredential(); - - // Act var client = new LogsQueryClient(credential); - - // Assert Assert.AreEqual(LogsQueryAudience.AzurePublicCloud.ToString(), client.Endpoint.OriginalString); } [Test] - public void Constructor_WhenOptionsIsNotNull_UsesOptionsAudience() + public void Constructor_WhenEndpointIsNull_UsesOptionsAudience() { - // Arrange var credential = new DefaultAzureCredential(); var options = new LogsQueryClientOptions { Audience = "https://custom.audience" }; - // Act var client = new LogsQueryClient(credential, options); - // Assert + // When endpoint is not passed in, use Audience to contstruct the endpoint Assert.AreEqual("https://custom.audience", client.Endpoint.OriginalString); } + + [Test] + public void Constructor_WhenOptionsDoesNotMatchAudience() + { + var endpoint = new Uri("https://custom.audience"); + var credential = new DefaultAzureCredential(); + var options = new LogsQueryClientOptions + { + Audience = "https://customs.audience" + }; + + Assert.ThrowsAsync(async () => await Task.Run(() => new LogsQueryClient(endpoint, credential, options))); + } + + [Test] + public void Constructor_WhenOptionsIsNull_UsesEndpoint() + { + var endpoint = new Uri("https://custom.audience"); + var credential = new DefaultAzureCredential(); + + var client = new LogsQueryClient(endpoint, credential); + + Assert.AreEqual(new Uri("https://custom.audience"), client.Endpoint); + } + + [Test] + public void Constructor_WhenOptionsIsNull_UsesEndpointSlash() + { + var endpoint = new Uri("https://custom.audience//"); + var credential = new DefaultAzureCredential(); + + var client = new LogsQueryClient(endpoint, credential); + + Assert.AreEqual("https://custom.audience//", client.Endpoint.AbsoluteUri); + } + + [Test] + public void Constructor_WhenOptionsIsValid_UsesOptionsAsUri() + { + var credential = new DefaultAzureCredential(); + var options = new LogsQueryClientOptions + { + Audience = LogsQueryAudience.AzureGovernment + }; + + var client = new LogsQueryClient(credential, options); + + Assert.AreEqual(new Uri(LogsQueryAudience.AzureGovernment.ToString()), client.Endpoint); + } + + [Test] + public void Constructor_WhenOptionsIsNull_EndpointIsNull() + { + var credential = new DefaultAzureCredential(); + var client = new LogsQueryClient(credential); + + Assert.AreEqual(new Uri(LogsQueryAudience.AzurePublicCloud.ToString()), client.Endpoint); + } } } diff --git a/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientSamples.cs b/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientSamples.cs index 3dad319381b7b..323e2985aa52d 100644 --- a/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientSamples.cs +++ b/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientSamples.cs @@ -293,12 +293,16 @@ public void CreateClientsWithOptions() new DefaultAzureCredential(), metricsQueryClientOptions); - // LogsQueryClient + // LogsQueryClient - by default, Azure Public Cloud is used + var logsQueryClient = new LogsQueryClient( + new DefaultAzureCredential()); + + // LogsQueryClient With Audience Set var logsQueryClientOptions = new LogsQueryClientOptions { Audience = LogsQueryAudience.AzureChina }; - var logsQueryClient = new LogsQueryClient( + var logsQueryClientChina = new LogsQueryClient( new DefaultAzureCredential(), logsQueryClientOptions); #endregion From 3467964109500e3a1029e64df30d4fd67947dd6e Mon Sep 17 00:00:00 2001 From: Christopher Scott Date: Wed, 21 Aug 2024 12:28:02 -0500 Subject: [PATCH 07/71] Add parameter-less ctor to TableSasBulder (#45569) --- sdk/tables/Azure.Data.Tables/CHANGELOG.md | 2 +- .../api/Azure.Data.Tables.netstandard2.0.cs | 2 +- .../src/Sas/TableSasBuilder.cs | 21 +++++++------------ .../tests/TableSasBuilderTests.cs | 17 ++++++++++++++- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/sdk/tables/Azure.Data.Tables/CHANGELOG.md b/sdk/tables/Azure.Data.Tables/CHANGELOG.md index 7501c001fab4f..1484234d0d3d0 100644 --- a/sdk/tables/Azure.Data.Tables/CHANGELOG.md +++ b/sdk/tables/Azure.Data.Tables/CHANGELOG.md @@ -3,7 +3,7 @@ ## 12.9.1 (Unreleased) ### Bugs Fixed -- Fixed an issue that prevented use of stored access policy based SaS Uris by adding a constructor to `TableSasBuilder` that accepts a stored access policy identifier without needing to specify the policy's permissions. +- Fixed an issue that prevented use of stored access policy based SaS Uris by adding a parameterless constructor to `TableSasBuilder`. The resulting builder can then be modified to include the stored access policy identifier or any other details. ## 12.9.0 (2024-07-22) diff --git a/sdk/tables/Azure.Data.Tables/api/Azure.Data.Tables.netstandard2.0.cs b/sdk/tables/Azure.Data.Tables/api/Azure.Data.Tables.netstandard2.0.cs index 2dca760a2c9ff..3af47f771edc5 100644 --- a/sdk/tables/Azure.Data.Tables/api/Azure.Data.Tables.netstandard2.0.cs +++ b/sdk/tables/Azure.Data.Tables/api/Azure.Data.Tables.netstandard2.0.cs @@ -418,8 +418,8 @@ public enum TableAccountSasResourceTypes } public partial class TableSasBuilder { + public TableSasBuilder() { } public TableSasBuilder(string tableName, Azure.Data.Tables.Sas.TableSasPermissions permissions, System.DateTimeOffset expiresOn) { } - public TableSasBuilder(string tableName, string identifier) { } public TableSasBuilder(string tableName, string rawPermissions, System.DateTimeOffset expiresOn) { } public TableSasBuilder(System.Uri sasUri) { } public System.DateTimeOffset ExpiresOn { get { throw null; } set { } } diff --git a/sdk/tables/Azure.Data.Tables/src/Sas/TableSasBuilder.cs b/sdk/tables/Azure.Data.Tables/src/Sas/TableSasBuilder.cs index 8fa8b04f3a26c..993577e915b28 100644 --- a/sdk/tables/Azure.Data.Tables/src/Sas/TableSasBuilder.cs +++ b/sdk/tables/Azure.Data.Tables/src/Sas/TableSasBuilder.cs @@ -47,20 +47,13 @@ public TableSasBuilder(string tableName, string rawPermissions, DateTimeOffset e } /// - /// Initializes an instance of a . + /// Initializes an instance of a with no details set. At minimum, additional properties must be set to create a valid SaS. + /// These include setting the , permissions, and an expiry. Permissions and expiry can also be specified in a shared access policy, which can be + /// selected by specifying the name of the policy on the property. + /// /// - /// The name of the table being made accessible with the shared access signature. - /// The identifier of the stored access policy that defines the permissions and, optionally, expiry of the shared access signature. - /// Note: Either the stored access policy specified by the or the created shared access signature must define an expiry. - /// If neither define an expiry or both do, authentication will fail. - public TableSasBuilder(string tableName, string identifier) - { - Argument.AssertNotNullOrEmpty(tableName, nameof(tableName)); - Argument.AssertNotNullOrEmpty(identifier, nameof(identifier)); - - TableName = tableName; - Identifier = identifier; - } + public TableSasBuilder() + { } /// /// Initializes a new instance of based on an existing Uri containing a shared access signature. @@ -133,6 +126,8 @@ public TableSasBuilder(Uri sasUri) /// /// An optional unique value up to 64 characters in length that /// correlates to an access policy specified for the container. + /// Note: Either the stored access policy specified by the or the created shared access signature must define an expiry. + /// If neither define an expiry or both do, authentication will fail. /// public string Identifier { get; set; } diff --git a/sdk/tables/Azure.Data.Tables/tests/TableSasBuilderTests.cs b/sdk/tables/Azure.Data.Tables/tests/TableSasBuilderTests.cs index 087bc66187f82..3ba75075bce1b 100644 --- a/sdk/tables/Azure.Data.Tables/tests/TableSasBuilderTests.cs +++ b/sdk/tables/Azure.Data.Tables/tests/TableSasBuilderTests.cs @@ -17,7 +17,6 @@ public void ValidatesArgs() Assert.Throws(() => new TableSasBuilder(string.Empty, TableSasPermissions.Add, DateTimeOffset.Now)); Assert.Throws(() => new TableSasBuilder("table", null, DateTimeOffset.Now)); Assert.Throws(() => new TableSasBuilder("table", string.Empty, DateTimeOffset.Now)); - Assert.Throws(() => new TableSasBuilder("table", null)); Assert.Throws(() => new TableSasBuilder(null)); } @@ -70,5 +69,21 @@ public void SetPermissions(string tableName, string permissionsString, TableSasP Assert.AreEqual(permissionsString.ToLowerInvariant(), tableSasBuilder.Permissions); Assert.AreEqual(tableName, tableSasBuilder.TableName); } + + [Test] + public void UseParameterlessCtor() + { + var now = DateTimeOffset.Now; + var tableSasBuilder = new TableSasBuilder + { + TableName = "table", + ExpiresOn = now.AddHours(1) + }; + tableSasBuilder.SetPermissions(TableSasPermissions.Read); + + Assert.AreEqual("table", tableSasBuilder.TableName); + Assert.AreEqual("r", tableSasBuilder.Permissions); + Assert.AreEqual(now.AddHours(1), tableSasBuilder.ExpiresOn); + } } } From 3e68f387ac8db7f164b74b1d68ab8c228136851f Mon Sep 17 00:00:00 2001 From: Nisha Bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:38:30 -0700 Subject: [PATCH 08/71] [Azure.Monitor.Query] Prepare for release 1.5.0 (#45610) --- sdk/monitor/Azure.Monitor.Query/CHANGELOG.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md b/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md index c2c25ee27bd23..0a89caae8b39c 100644 --- a/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md +++ b/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md @@ -1,16 +1,9 @@ # Release History -## 1.5.0 (Unreleased) - -### Features Added - -### Breaking Changes - +## 1.5.0 (2024-08-21) ### Bugs Fixed - Fix bug in `LogsQueryClient` that defaulted to `Azure.PublicCloud`. `Audience` is now determined from the `endpoint` parameter. -### Other Changes - ## 1.4.0 (2024-06-12) ### Features Added From 985aff3df6ca7b073d4a95cf153d485d19bcda87 Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:57:37 -0700 Subject: [PATCH 09/71] Prepare for release (#45565) --- .../Azure.Messaging.EventGrid/CHANGELOG.md | 9 +-- ...zure.Messaging.EventGrid.netstandard2.0.cs | 28 +++++++++ .../src/Azure.Messaging.EventGrid.csproj | 2 +- .../Customization/EventGridModelFactory.cs | 63 +++++++++++++++++++ .../src/Generated/EventGridModelFactory.cs | 10 ++- .../Generated/Models/StorageBlobAccessTier.cs | 60 ++++++++++++++++++ ...orageBlobCreatedEventData.Serialization.cs | 7 +++ .../Models/StorageBlobCreatedEventData.cs | 10 ++- ...eBlobTierChangedEventData.Serialization.cs | 14 +++++ .../Models/StorageBlobTierChangedEventData.cs | 16 ++++- .../Azure.Messaging.EventGrid/src/autorest.md | 2 +- 11 files changed, 207 insertions(+), 14 deletions(-) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobAccessTier.cs diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md index 952bebd6a3220..fbf2a31af9515 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md @@ -1,14 +1,11 @@ # Release History -## 4.25.0-beta.1 (Unreleased) +## 4.25.0 (2024-08-21) ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added `AccessTier` and `PreviousTier` properties to `StorageBlobTierChangedEventData` system event. +- Added `AccessTier` to `StorageBlobCreatedEventData` system event. ## 4.24.1 (2024-07-16) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs index 7f385c8ad2d42..86c1f7f8124e2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs @@ -341,10 +341,14 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string hubName = null, string connectionId = null, string userId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData StorageAsyncOperationInitiatedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = default(long?), long? contentOffset = default(long?), string blobType = null, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier accessTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = default(long?), long? contentOffset = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobDeletedEventData StorageBlobDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(System.DateTimeOffset? scheduleDateTime = default(System.DateTimeOffset?), string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData StorageBlobRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier accessTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier previousTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string url = null, bool? recursive = default(bool?), string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } @@ -3375,9 +3379,31 @@ internal StorageAsyncOperationInitiatedEventData() { } public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageBlobAccessTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageBlobAccessTier(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Archive { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Cold { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Cool { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Default { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Hot { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } + public override string ToString() { throw null; } + } public partial class StorageBlobCreatedEventData { internal StorageBlobCreatedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier AccessTier { get { throw null; } } public string Api { get { throw null; } } public string BlobType { get { throw null; } } public string ClientRequestId { get { throw null; } } @@ -3430,12 +3456,14 @@ internal StorageBlobRenamedEventData() { } public partial class StorageBlobTierChangedEventData { internal StorageBlobTierChangedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier AccessTier { get { throw null; } } public string Api { get { throw null; } } public string BlobType { get { throw null; } } public string ClientRequestId { get { throw null; } } public long? ContentLength { get { throw null; } } public string ContentType { get { throw null; } } public string Identity { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier PreviousTier { get { throw null; } } public string RequestId { get { throw null; } } public string Sequencer { get { throw null; } } public object StorageDiagnostics { get { throw null; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj index 2d3d6f8ea6a63..e26f900ed4971 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj @@ -2,7 +2,7 @@ This library can be used to publish events to Azure Event Grid and to consume events delivered by EventGrid. It also defines the event schemas for the events published to EventGrid by various Azure services. Microsoft Azure.Messaging.EventGrid client library - 4.25.0-beta.1 + 4.25.0 4.24.1 Microsoft Azure EventGrid;Event Grid;Event Grid Publishing; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs index a365f2da88484..c74913724cf12 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs @@ -726,6 +726,69 @@ public static CommunicationIdentifierModel CommunicationIdentifierModel(string r { return new CommunicationIdentifierModel(default, rawId, communicationUser, phoneNumber, microsoftTeamsUser, default); } + + /// Initializes a new instance of . + /// The name of the API/operation that triggered this event. + /// A request id provided by the client of the storage API operation that triggered this event. + /// The request id generated by the Storage service for the storage API operation that triggered this event. + /// The etag of the blob at the time this event was triggered. + /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. + /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. + /// The offset of the blob in bytes. + /// The type of blob. + /// The path to the blob. + /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. + /// The identity of the requester that triggered this event. + /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static StorageBlobCreatedEventData StorageBlobCreatedEventData( + string api = null, + string clientRequestId = null, + string requestId = null, + string eTag = null, + string contentType = null, + long? contentLength = null, + long? contentOffset = null, + string blobType = null, + string url = null, + string sequencer = null, + string identity = null, + object storageDiagnostics = null) + { + return StorageBlobCreatedEventData(api, clientRequestId, requestId, eTag, contentType, contentLength, + contentOffset, blobType, null, url, sequencer, identity, storageDiagnostics); + } + + /// Initializes a new instance of . + /// The name of the API/operation that triggered this event. + /// A request id provided by the client of the storage API operation that triggered this event. + /// The request id generated by the Storage service for the storage API operation that triggered this event. + /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. + /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. + /// The type of blob. + /// The path to the blob. + /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. + /// The identity of the requester that triggered this event. + /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = null, string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + { + return StorageBlobTierChangedEventData( + api, + clientRequestId, + requestId, + contentType, + contentLength, + blobType, + null, + null, + url, + sequencer, + identity, + storageDiagnostics); + } } #pragma warning restore CA1054 // URI-like parameters should not be strings } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs index 6c19b5da67ac0..c4aff0098a22c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs @@ -24,12 +24,13 @@ public static partial class EventGridModelFactory /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The offset of the blob in bytes. /// The type of blob. + /// The current tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = null, long? contentOffset = null, string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = null, long? contentOffset = null, string blobType = null, StorageBlobAccessTier accessTier = default, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { return new StorageBlobCreatedEventData( api, @@ -40,6 +41,7 @@ public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api contentLength, contentOffset, blobType, + accessTier, url, sequencer, identity, @@ -168,12 +170,14 @@ public static StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyAc /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The type of blob. + /// The current tier of the blob. + /// The previous tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = null, string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = null, string blobType = null, StorageBlobAccessTier accessTier = default, StorageBlobAccessTier previousTier = default, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { return new StorageBlobTierChangedEventData( api, @@ -182,6 +186,8 @@ public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(st contentType, contentLength, blobType, + accessTier, + previousTier, url, sequencer, identity, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobAccessTier.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobAccessTier.cs new file mode 100644 index 0000000000000..b5072eac433ac --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobAccessTier.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 Azure.Messaging.EventGrid.SystemEvents +{ + /// The access tier of the blob. + public readonly partial struct StorageBlobAccessTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StorageBlobAccessTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HotValue = "Hot"; + private const string CoolValue = "Cool"; + private const string ColdValue = "Cold"; + private const string ArchiveValue = "Archive"; + private const string DefaultValue = "Default"; + + /// The blob is in access tier Hot. + public static StorageBlobAccessTier Hot { get; } = new StorageBlobAccessTier(HotValue); + /// The blob is in access tier Cool. + public static StorageBlobAccessTier Cool { get; } = new StorageBlobAccessTier(CoolValue); + /// The blob is in access tier Cold. + public static StorageBlobAccessTier Cold { get; } = new StorageBlobAccessTier(ColdValue); + /// The blob is in access tier Archive. + public static StorageBlobAccessTier Archive { get; } = new StorageBlobAccessTier(ArchiveValue); + /// The blob is in access tier Default(Inferred). + public static StorageBlobAccessTier Default { get; } = new StorageBlobAccessTier(DefaultValue); + /// Determines if two values are the same. + public static bool operator ==(StorageBlobAccessTier left, StorageBlobAccessTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StorageBlobAccessTier left, StorageBlobAccessTier right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator StorageBlobAccessTier(string value) => new StorageBlobAccessTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StorageBlobAccessTier other && Equals(other); + /// + public bool Equals(StorageBlobAccessTier 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/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.Serialization.cs index fd69094430b28..5429ec22864c8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.Serialization.cs @@ -28,6 +28,7 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa long? contentLength = default; long? contentOffset = default; string blobType = default; + StorageBlobAccessTier accessTier = default; string url = default; string sequencer = default; string identity = default; @@ -82,6 +83,11 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa blobType = property.Value.GetString(); continue; } + if (property.NameEquals("accessTier"u8)) + { + accessTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } if (property.NameEquals("url"u8)) { url = property.Value.GetString(); @@ -116,6 +122,7 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa contentLength, contentOffset, blobType, + accessTier, url, sequencer, identity, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.cs index 586b36d3acca6..5f2e4fafe8754 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.cs @@ -11,8 +11,10 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class StorageBlobCreatedEventData { /// Initializes a new instance of . - internal StorageBlobCreatedEventData() + /// The current tier of the blob. + internal StorageBlobCreatedEventData(StorageBlobAccessTier accessTier) { + AccessTier = accessTier; } /// Initializes a new instance of . @@ -24,11 +26,12 @@ internal StorageBlobCreatedEventData() /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The offset of the blob in bytes. /// The type of blob. + /// The current tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - internal StorageBlobCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string contentType, long? contentLength, long? contentOffset, string blobType, string url, string sequencer, string identity, object storageDiagnostics) + internal StorageBlobCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string contentType, long? contentLength, long? contentOffset, string blobType, StorageBlobAccessTier accessTier, string url, string sequencer, string identity, object storageDiagnostics) { Api = api; ClientRequestId = clientRequestId; @@ -38,6 +41,7 @@ internal StorageBlobCreatedEventData(string api, string clientRequestId, string ContentLength = contentLength; ContentOffset = contentOffset; BlobType = blobType; + AccessTier = accessTier; Url = url; Sequencer = sequencer; Identity = identity; @@ -60,6 +64,8 @@ internal StorageBlobCreatedEventData(string api, string clientRequestId, string public long? ContentOffset { get; } /// The type of blob. public string BlobType { get; } + /// The current tier of the blob. + public StorageBlobAccessTier AccessTier { get; } /// The path to the blob. public string Url { get; } /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.Serialization.cs index c499115c5eb5a..f7c4e3a4bc38c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.Serialization.cs @@ -26,6 +26,8 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange string contentType = default; long? contentLength = default; string blobType = default; + StorageBlobAccessTier accessTier = default; + StorageBlobAccessTier previousTier = default; string url = default; string sequencer = default; string identity = default; @@ -66,6 +68,16 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange blobType = property.Value.GetString(); continue; } + if (property.NameEquals("accessTier"u8)) + { + accessTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("previousTier"u8)) + { + previousTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } if (property.NameEquals("url"u8)) { url = property.Value.GetString(); @@ -98,6 +110,8 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange contentType, contentLength, blobType, + accessTier, + previousTier, url, sequencer, identity, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.cs index fdedf0d44345e..edebd32d65c57 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.cs @@ -11,8 +11,12 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class StorageBlobTierChangedEventData { /// Initializes a new instance of . - internal StorageBlobTierChangedEventData() + /// The current tier of the blob. + /// The previous tier of the blob. + internal StorageBlobTierChangedEventData(StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier) { + AccessTier = accessTier; + PreviousTier = previousTier; } /// Initializes a new instance of . @@ -22,11 +26,13 @@ internal StorageBlobTierChangedEventData() /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The type of blob. + /// The current tier of the blob. + /// The previous tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - internal StorageBlobTierChangedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, string url, string sequencer, string identity, object storageDiagnostics) + internal StorageBlobTierChangedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier, string url, string sequencer, string identity, object storageDiagnostics) { Api = api; ClientRequestId = clientRequestId; @@ -34,6 +40,8 @@ internal StorageBlobTierChangedEventData(string api, string clientRequestId, str ContentType = contentType; ContentLength = contentLength; BlobType = blobType; + AccessTier = accessTier; + PreviousTier = previousTier; Url = url; Sequencer = sequencer; Identity = identity; @@ -52,6 +60,10 @@ internal StorageBlobTierChangedEventData(string api, string clientRequestId, str public long? ContentLength { get; } /// The type of blob. public string BlobType { get; } + /// The current tier of the blob. + public StorageBlobAccessTier AccessTier { get; } + /// The previous tier of the blob. + public StorageBlobAccessTier PreviousTier { get; } /// The path to the blob. public string Url { get; } /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md index 0a5b3d31756e0..c61d63368e00f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml title: EventGridClient -require: https://github.com/Azure/azure-rest-api-specs/blob/1b0e82df2f7f953796af2aee0372e34e00baa2d2/specification/eventgrid/data-plane/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/0d023bd802cde559706b5865f685a10a88516e09/specification/eventgrid/data-plane/readme.md generation1-convenience-client: true model-factory-for-hlc: - MediaJobOutputAsset From d7dc5c08fdec3b5c0fcbc53775f5026e887a558f Mon Sep 17 00:00:00 2001 From: Timothy Mothra Date: Wed, 21 Aug 2024 15:44:31 -0700 Subject: [PATCH 10/71] refactor AggregationType (#45631) --- .../Filtering/AccumulatedValues.cs | 20 +++--- ...regationType.cs => AggregationTypeEnum.cs} | 2 +- .../Filtering/CollectionConfiguration.cs | 5 +- .../LiveMetrics/Filtering/DerivedMetric.cs | 2 +- .../src/LiveMetrics/Manager.Metrics.cs | 6 +- .../Filtering/AccumulatedValuesTest.cs | 16 ++--- .../Filtering/DerivedMetricTests.cs | 65 +++++++++---------- 7 files changed, 57 insertions(+), 59 deletions(-) rename sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/{AggregationType.cs => AggregationTypeEnum.cs} (87%) diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AccumulatedValues.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AccumulatedValues.cs index 70699d71c7557..53972e7ccc881 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AccumulatedValues.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AccumulatedValues.cs @@ -13,7 +13,7 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics.Filtering /// internal class AccumulatedValues { - private readonly AggregationType aggregationType; + private readonly AggregationTypeEnum aggregationType; private SpinLock spinLock = new SpinLock(); @@ -25,7 +25,7 @@ internal class AccumulatedValues private double min = double.MaxValue; - public AccumulatedValues(string metricId, AggregationType aggregationType) + public AccumulatedValues(string metricId, AggregationTypeEnum aggregationType) { this.MetricId = metricId; this.aggregationType = aggregationType; @@ -44,18 +44,18 @@ public void AddValue(double value) switch (this.aggregationType) { - case AggregationType.Avg: - case AggregationType.Sum: + case AggregationTypeEnum.Avg: + case AggregationTypeEnum.Sum: this.sum += value; break; - case AggregationType.Min: + case AggregationTypeEnum.Min: if (value < this.min) { this.min = value; } break; - case AggregationType.Max: + case AggregationTypeEnum.Max: if (value > this.max) { this.max = value; @@ -86,13 +86,13 @@ public double CalculateAggregation(out long count) count = this.count; switch (this.aggregationType) { - case AggregationType.Avg: + case AggregationTypeEnum.Avg: return this.count != 0 ? this.sum / this.count : 0.0; - case AggregationType.Sum: + case AggregationTypeEnum.Sum: return this.sum; - case AggregationType.Min: + case AggregationTypeEnum.Min: return this.count != 0 ? this.min : 0.0; - case AggregationType.Max: + case AggregationTypeEnum.Max: return this.count != 0 ? this.max : 0.0; default: throw new ArgumentOutOfRangeException( diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AggregationType.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AggregationTypeEnum.cs similarity index 87% rename from sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AggregationType.cs rename to sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AggregationTypeEnum.cs index 4f4b1c0f98f8e..f3f496a51e331 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AggregationType.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AggregationTypeEnum.cs @@ -3,7 +3,7 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics.Filtering { - internal enum AggregationType + internal enum AggregationTypeEnum { Avg = 0, diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/CollectionConfiguration.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/CollectionConfiguration.cs index 3f39151fb693c..d468857c35b2c 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/CollectionConfiguration.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/CollectionConfiguration.cs @@ -7,7 +7,6 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics.Filtering using System.Collections.Generic; using System.Globalization; using System.Linq; - using Azure.Monitor.OpenTelemetry.Exporter.Internals; using Azure.Monitor.OpenTelemetry.AspNetCore.Models; using ExceptionDocument = Models.Exception; @@ -41,7 +40,7 @@ internal class CollectionConfiguration #endregion #region Metadata used by other components - private readonly List> telemetryMetadata = new List>(); + private readonly List> telemetryMetadata = new List>(); #endregion public CollectionConfiguration( @@ -110,7 +109,7 @@ private void UpdateAllErrorsWithKeyValue(CollectionConfigurationError[] errors, /// /// Gets Telemetry types only. Used by QuickPulseTelemetryProcessor. /// - public IEnumerable> TelemetryMetadata => this.telemetryMetadata; + public IEnumerable> TelemetryMetadata => this.telemetryMetadata; /// /// Gets document streams. Telemetry items are provided by QuickPulseTelemetryProcessor. diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/DerivedMetric.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/DerivedMetric.cs index d55e891cd36d7..a6aa96251b515 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/DerivedMetric.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/DerivedMetric.cs @@ -56,7 +56,7 @@ public DerivedMetric(DerivedMetricInfo info, out CollectionConfigurationError[] public string Id => this.info.Id; - public Models.AggregationType? AggregationType => this.info.Aggregation; // TODO: this was enum. Need to double check new type is parsed and used correctly. + public AggregationType? AggregationType => this.info.Aggregation; // TODO: this was enum. Need to double check new type is parsed and used correctly. public bool CheckFilters(TTelemetry document, out CollectionConfigurationError[] errors) { diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Manager.Metrics.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Manager.Metrics.cs index 9be0c56b3fcc1..628769a1cc32b 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Manager.Metrics.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Manager.Metrics.cs @@ -194,8 +194,8 @@ private Dictionary CreateMetricAccumulators(Collectio Dictionary metricAccumulators = new(); // prepare the accumulators based on the collection configuration - IEnumerable> allMetrics = collectionConfiguration.TelemetryMetadata; - foreach (Tuple metricId in allMetrics) + IEnumerable> allMetrics = collectionConfiguration.TelemetryMetadata; + foreach (Tuple metricId in allMetrics) { var derivedMetricInfoAggregation = metricId.Item2; if (!derivedMetricInfoAggregation.HasValue) @@ -203,7 +203,7 @@ private Dictionary CreateMetricAccumulators(Collectio continue; } - if (Enum.TryParse(derivedMetricInfoAggregation.ToString(), out AspNetCore.LiveMetrics.Filtering.AggregationType aggregationType)) + if (Enum.TryParse(derivedMetricInfoAggregation.ToString(), out AspNetCore.LiveMetrics.Filtering.AggregationTypeEnum aggregationType)) { var accumulatedValues = new AccumulatedValues(metricId.Item1, aggregationType); diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/AccumulatedValuesTest.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/AccumulatedValuesTest.cs index 9cb938544b2b0..12018fd9ae8bc 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/AccumulatedValuesTest.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/AccumulatedValuesTest.cs @@ -13,10 +13,10 @@ public void AccumulatedValuesAggregatesCorrectly() { // ARRANGE double[] accumulatedValues = { 1d, 3d }; - AccumulatedValues accumulatorAverage = new AccumulatedValues("Metric1", AggregationType.Avg); - AccumulatedValues accumulatorSum = new AccumulatedValues("Metric1", AggregationType.Sum); - AccumulatedValues accumulatorMin = new AccumulatedValues("Metric1", AggregationType.Min); - AccumulatedValues accumulatorMax = new AccumulatedValues("Metric1", AggregationType.Max); + AccumulatedValues accumulatorAverage = new AccumulatedValues("Metric1", AggregationTypeEnum.Avg); + AccumulatedValues accumulatorSum = new AccumulatedValues("Metric1", AggregationTypeEnum.Sum); + AccumulatedValues accumulatorMin = new AccumulatedValues("Metric1", AggregationTypeEnum.Min); + AccumulatedValues accumulatorMax = new AccumulatedValues("Metric1", AggregationTypeEnum.Max); // ACT ArrayHelpers.ForEach(accumulatedValues, accumulatorAverage.AddValue); @@ -45,10 +45,10 @@ public void AccumulatedValuesAggregatesCorrectly() public void AccumulatedValuesAggregatesCorrectlyForEmptyDataSet() { // ARRANGE - AccumulatedValues accumulatorAverage = new AccumulatedValues("Metric1", AggregationType.Avg); - AccumulatedValues accumulatorSum = new AccumulatedValues("Metric1", AggregationType.Sum); - AccumulatedValues accumulatorMin = new AccumulatedValues("Metric1", AggregationType.Min); - AccumulatedValues accumulatorMax = new AccumulatedValues("Metric1", AggregationType.Max); + AccumulatedValues accumulatorAverage = new AccumulatedValues("Metric1", AggregationTypeEnum.Avg); + AccumulatedValues accumulatorSum = new AccumulatedValues("Metric1", AggregationTypeEnum.Sum); + AccumulatedValues accumulatorMin = new AccumulatedValues("Metric1", AggregationTypeEnum.Min); + AccumulatedValues accumulatorMax = new AccumulatedValues("Metric1", AggregationTypeEnum.Max); // ACT double avg = accumulatorAverage.CalculateAggregation(out long avgCount); diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/DerivedMetricTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/DerivedMetricTests.cs index 728c1ac0c8435..669a357cdfcb5 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/DerivedMetricTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/DerivedMetricTests.cs @@ -9,7 +9,6 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore.Tests.LiveMetrics.Filtering using Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics.Filtering; using Azure.Monitor.OpenTelemetry.AspNetCore.Models; using Xunit; - using AggregationType = Models.AggregationType; using RequestTelemetry = Azure.Monitor.OpenTelemetry.AspNetCore.Models.Request; using TelemetryType = Models.TelemetryType; @@ -26,8 +25,8 @@ public void DerivedMetricFiltersCorrectly() telemetryType: TelemetryType.Request.ToString(), filterGroups: new[] { new FilterConjunctionGroupInfo(new List { filterInfo1, filterInfo2 }) }, projection: "Name", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetryThatMustPass = new RequestTelemetry() { Name = "Both the words 'dog' and 'CAT' are here, which satisfies both filters" }; @@ -60,8 +59,8 @@ public void DerivedMetricHandlesNoFiltersCorrectly() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "Name", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetryThatMustPass = new RequestTelemetry() { Name = "Both the words 'dog' and 'CAT' are here, which satisfies both filters" }; @@ -86,8 +85,8 @@ public void DerivedMetricHandlesNullFiltersCorrectly() telemetryType: TelemetryType.Request.ToString(), filterGroups: null, projection: "Name", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetryThatMustPass = new RequestTelemetry() { Name = "Both the words 'dog' and 'CAT' are here, which satisfies both filters" }; @@ -121,8 +120,8 @@ public void DerivedMetricPerformsLogicalConnectionsBetweenFiltersCorrectly() new FilterConjunctionGroupInfo(new[] { filterInfoApple, filterInfoOrange }) }, projection: "Name", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetryThatMustPass1 = new RequestTelemetry() { Name = "Both the words 'dog' and 'CAT' are here, which satisfies the first OR." }; @@ -167,8 +166,8 @@ public void DerivedMetricProjectsCorrectly() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "Id", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetry = new DocumentMock() { Name = "1.23", Id = "5.67" }; @@ -179,7 +178,7 @@ public void DerivedMetricProjectsCorrectly() double projection = metric.Project(telemetry); // ASSERT - Assert.Equal(Models.AggregationType.Sum, metric.AggregationType); + Assert.Equal(AggregationType.Sum, metric.AggregationType); Assert.Empty(errors); Assert.Equal(5.67d, projection); } @@ -193,8 +192,8 @@ public void DerivedMetricProjectsCorrectlyWhenCustomDimension() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "CustomDimensions.Dimension1", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetry = new DocumentMock(new List() { new("Dimension.1", "1.5") }); @@ -205,7 +204,7 @@ public void DerivedMetricProjectsCorrectlyWhenCustomDimension() double projection = metric.Project(telemetry); // ASSERT - Assert.Equal(Models.AggregationType.Sum, metric.AggregationType); + Assert.Equal(AggregationType.Sum, metric.AggregationType); Assert.Empty(errors); Assert.Equal(1.5d, projection); } @@ -219,8 +218,8 @@ public void DerivedMetricProjectsCorrectlyWhenCustomMetric() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "CustomMetrics.Metric1", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetry = new DocumentMock() { Metrics = { ["Metric1"] = 1.75d } }; @@ -231,7 +230,7 @@ public void DerivedMetricProjectsCorrectlyWhenCustomMetric() double projection = metric.Project(telemetry); // ASSERT - Assert.Equal(Models.AggregationType.Sum, metric.AggregationType); + Assert.Equal(AggregationType.Sum, metric.AggregationType); Assert.Empty(errors); Assert.Equal(1.75d, projection); } @@ -245,8 +244,8 @@ public void DerivedMetricProjectsCorrectlyWhenCount() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "COUNT()", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetry = new RequestTelemetry(); @@ -257,7 +256,7 @@ public void DerivedMetricProjectsCorrectlyWhenCount() double projection = metric.Project(telemetry); // ASSERT - Assert.Equal(Models.AggregationType.Sum, metric.AggregationType); + Assert.Equal(AggregationType.Sum, metric.AggregationType); Assert.Empty(errors); Assert.Equal(1d, projection); } @@ -271,8 +270,8 @@ public void DerivedMetricProjectsCorrectlyWhenTimeSpan() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "Duration", - aggregation: Models.AggregationType.Avg, - backEndAggregation: Models.AggregationType.Avg + aggregation: AggregationType.Avg, + backEndAggregation: AggregationType.Avg ); var telemetry = new DocumentMock() { Duration = TimeSpan.FromMilliseconds(120) }; @@ -283,7 +282,7 @@ public void DerivedMetricProjectsCorrectlyWhenTimeSpan() double projection = metric.Project(telemetry); // ASSERT - Assert.Equal(Models.AggregationType.Avg, metric.AggregationType); + Assert.Equal(AggregationType.Avg, metric.AggregationType); Assert.Empty(errors); Assert.Equal(120, projection); } @@ -298,7 +297,7 @@ public void DerivedMetricProjectsCorrectlyWhenDurationIsString() filterGroups: new FilterConjunctionGroupInfo[0], projection: "Duration", aggregation: AggregationType.Avg, - backEndAggregation: Models.AggregationType.Avg + backEndAggregation: AggregationType.Avg ); var durationString = TimeSpan.FromMilliseconds(120).ToString(); @@ -326,8 +325,8 @@ public void DerivedMetricReportsErrorsForInvalidFilters() telemetryType: TelemetryType.Request.ToString(), filterGroups: new[] { new FilterConjunctionGroupInfo(new[] { filterInfo1, filterInfo2 }) }, projection: "Name", - aggregation: Models.AggregationType.Avg, - backEndAggregation: Models.AggregationType.Avg + aggregation: AggregationType.Avg, + backEndAggregation: AggregationType.Avg ); // ACT @@ -363,8 +362,8 @@ public void DerivedMetricThrowsWhenInvalidProjection() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "NonExistentFieldName", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); // ACT, ASSERT @@ -381,8 +380,8 @@ public void DerivedMetricReportsErrorWhenProjectionIsNotDouble() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "Id", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetry = new DocumentMock() { Id = "NotDoubleValue" }; @@ -414,8 +413,8 @@ public void DerivedMetricReportsErrorWhenProjectionIsAsterisk() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "*", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); // ACT, ASSERT From b39a20c7252bc0d06a829511bd235b3d3bc2bac8 Mon Sep 17 00:00:00 2001 From: Bidisha Chakraborty <29803402+bidisha-c@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:40:24 -0700 Subject: [PATCH 11/71] Conversations SDK: Update documentation (#45593) * Conversations SDK: Update documentation * Add supported Api versions * revert relative links --------- Co-authored-by: Bidisha Chakraborty --- .../Azure.AI.Language.Conversations/README.md | 31 +++- .../samples/README.md | 2 +- ...lyzeConversation_ConversationPrediction.md | 6 +- .../samples/Sample5_ImportProject.md | 165 ++++++++++++++++++ ...eConversation_ConversationSummarization.md | 6 +- .../samples/Sample7_ExportProject.md | 76 ++++++++ ...e8_AnalyzeConversation_ConversationPii.md} | 2 +- .../tests/Samples/Readme.cs | 10 ++ 8 files changed, 289 insertions(+), 9 deletions(-) create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_ImportProject.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample7_ExportProject.md rename sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/{Sample5_AnalyzeConversation_ConversationPii.md => Sample8_AnalyzeConversation_ConversationPii.md} (98%) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md index 803aca9a0355c..354e9a8b5a16f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md @@ -8,7 +8,7 @@ Conversation Language Understanding - aka CLU for short - is a cloud-based conve Conversation Summarization is one feature offered by Azure AI Language, which is a combination of generative Large Language models and task-optimized encoder models that offer summarization solutions with higher quality, cost efficiency, and lower latency. -Conversation PII detection another feature offered by Azure AI Language, which is a collection of machine learning and AI algorithms to identify, categorize, and redact sensitive information in text. The Conversational PII model is a specialized model for handling speech transcriptions and the more informal, conversational tone of meeting and call transcripts. +Conversation PII detection another feature offered by Azure AI Language, which is a collection of machine learning and AI algorithms to identify, categorize, and redact sensitive information in text. The Conversational PII model is a specialized model for handling speech transcriptions and the more informal, conversational tone of meeting and call transcripts. [Source code][conversationanalysis_client_src] | [Package (NuGet)][conversationanalysis_nuget_package] | [API reference documentation][conversationanalysis_refdocs] | [Samples][conversationanalysis_samples] | [Product documentation][conversationanalysis_docs] | [Analysis REST API documentation][conversationanalysis_restdocs] @@ -94,6 +94,35 @@ ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, cre Note that regional endpoints do not support AAD authentication. Instead, create a [custom domain][custom_domain] name for your resource to use AAD authentication. +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +|SDK version |Supported API version of service +|-------------|----------------------------------------------------- +|2.0.0-beta.1 | 2022-05-01, 2023-04-01, 2024-05-01, 2024-05-15-preview (default) +|1.1.0 | 2022-05-01, 2023-04-01 (default) +|1.0.0 | 2022-05-01 (default) + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example, + +```C# Snippet:CreateConversationAnalysisClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); +ConversationsClientOptions options = new ConversationsClientOptions(ConversationsClientOptions.ServiceVersion.V2024_05_01); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential, options); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +If you do not select an api version we will default to the latest version available, which has the possibility of being a preview version. + ## Key concepts ### ConversationAnalysisClient diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/README.md index d2c48cd682258..98f303c8c81a9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/README.md @@ -20,5 +20,5 @@ You can work with request and response content more easily by using our [Dynamic - [Analyze an utterance - Orchestration project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample2_AnalyzeConversation_OrchestrationPrediction.md) - [Analyze an utterance in a different language](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample3_AnalyzeConversationWithLanguage.md) - [Analyze an utterance using extra options](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample4_AnalyzeConversationWithOptions.md) -- [Analyze a conversation with Conversation PII](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_AnalyzeConversation_ConversationPii.md) +- [Analyze a conversation with Conversation PII](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample8_AnalyzeConversation_ConversationPii.md) - [Analyze a conversation with Conversation Summarization](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample6_AnalyzeConversation_ConversationSummarization.md) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample1_AnalyzeConversation_ConversationPrediction.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample1_AnalyzeConversation_ConversationPrediction.md index f7f054ba8eb0d..360527108ea00 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample1_AnalyzeConversation_ConversationPrediction.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample1_AnalyzeConversation_ConversationPrediction.md @@ -14,11 +14,11 @@ using Azure.AI.Language.Conversations; To analyze an utterance, you need to first create a `ConversationAnalysisClient` using an endpoint and API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. -```C# Snippet:ConversationAnalysisClient_Create +```C# Snippet:CreateConversationAnalysisClientForSpecificApiVersion Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); - -ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +ConversationsClientOptions options = new ConversationsClientOptions(ConversationsClientOptions.ServiceVersion.V2024_05_01); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential, options); ``` Once you have created a client, you can call synchronous or asynchronous methods. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_ImportProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_ImportProject.md new file mode 100644 index 0000000000000..488202b170785 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_ImportProject.md @@ -0,0 +1,165 @@ +# Import a project + +This sample demonstrates how to import a project. To get started, you'll need to create a Cognitive Language service endpoint and an API key. See the [README](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.Language.Conversations_1.1.0/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md) for links and instructions. + +> [!NOTE] +> Conversational Authoring is not supported in version 2.0.0-beta.1. If you use Conversational Authoring, please continue to use version 1.1.0. + +Start by importing the namespace for the `ConversationAuthoringClient` and related classes: + +```C# +using Azure.Core; +using Azure.AI.Language.Conversations.Authoring; +``` + +To import a project, you'll need to first create a `ConversationAuthoringClient` using an endpoint and an API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. + +```C# +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); + +ConversationAuthoringClient client = new ConversationAuthoringClient(endpoint, credential); +``` + +Once you have created a client, you can call synchronous or asynchronous methods. Typically, the content would come from a file but a small sample is shown here for demonstration purposes. + +## Synchronous + +```C# +string projectName = "Menu"; + +// Define our project assets and import. In practice this would most often be read from a file. +var importData = new +{ + projectFileVersion = "2022-05-01", + metadata = new { + projectName, + projectKind = "Conversation", + multilingual = true, + language = "en", + }, + + assets = new + { + projectKind = "Conversation", + entities = new[] // ConversationalAnalysisAuthoringConversationExportedEntity + { + new + { + category = "Contact", + compositionSetting = "combineComponents", + prebuilts = new[] + { + new + { + category = "Person.Name", + }, + }, + + // ... more entities. + } + }, + + intents = new[] // ConversationalAnalysisAuthoringConversationExportedIntent + { + new + { + category = "Send", + }, + + // ... more intents. + }, + + utterances = new[] // ConversationalAnalysisAuthoringConversationExportedUtterance + { + new + { + text = "Send an email to Johnson", + language = "en", + intent = "Send", + entities = new[] + { + new + { + category = "Contact", + offset = 17, + length = 7, + }, + }, + }, + new + { + text = "Send Kathy a calendar invite", + language = "en", + intent = "Send", + entities = new[] + { + new + { + category = "Contact", + offset = 5, + length = 5, + }, + }, + }, + + // ... more utterances. + }, + }, + + // Use Utf16CodeUnit for strings in .NET. + stringIndexType = "Utf16CodeUnit", +}; + +Operation importOperation = client.ImportProject(WaitUntil.Completed, projectName, RequestContent.Create(importData)); + +// Train the model. +var trainData = new +{ + modelLabel = "Sample5", + trainingMode = "standard", +}; + +Console.WriteLine($"Training project {projectName}..."); +Operation trainOperation = client.Train(WaitUntil.Completed, projectName, RequestContent.Create(trainData)); + + // Deploy the model. + var deployData = new + { + trainedModelLabel = "Sample5", + }; + +Console.WriteLine($"Deploying project {projectName} to production..."); +Operation deployOperation = client.DeployProject(WaitUntil.Completed, projectName, "production", RequestContent.Create(deployData)); + +Console.WriteLine("Import complete"); +``` + +## Asynchronous + +Using the same `importData` definition above, you can make an asynchronous request by calling `ImportProjectAsync`: + +```C# +Operation importOperation = await client.ImportProjectAsync(WaitUntil.Completed, projectName, RequestContent.Create(importData)); + +// Train the model. +var trainData = new +{ + modelLabel = "Sample5", + trainingMode = "standard", +}; + +Console.WriteLine($"Training project {projectName}..."); +Operation trainOperation = await client.TrainAsync(WaitUntil.Completed, projectName, RequestContent.Create(trainData)); + +// Deploy the model. +var deployData = new +{ + trainedModelLabel = "Sample5", +}; + +Console.WriteLine($"Deploying project {projectName} to production..."); +Operation deployOperation = await client.DeployProjectAsync(WaitUntil.Completed, projectName, "production", RequestContent.Create(deployData)); + +Console.WriteLine("Import complete"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample6_AnalyzeConversation_ConversationSummarization.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample6_AnalyzeConversation_ConversationSummarization.md index 1988f7fa15f7f..653147aefb0f2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample6_AnalyzeConversation_ConversationSummarization.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample6_AnalyzeConversation_ConversationSummarization.md @@ -14,11 +14,11 @@ using Azure.AI.Language.Conversations; To analyze an utterance, you need to first create a `ConversationAnalysisClient` using an endpoint and API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. -```C# Snippet:ConversationAnalysisClient_Create +```C# Snippet:CreateConversationAnalysisClientForSpecificApiVersion Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); - -ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +ConversationsClientOptions options = new ConversationsClientOptions(ConversationsClientOptions.ServiceVersion.V2024_05_01); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential, options); ``` Once you have created a client, you can call synchronous or asynchronous methods. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample7_ExportProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample7_ExportProject.md new file mode 100644 index 0000000000000..1385cc5630168 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample7_ExportProject.md @@ -0,0 +1,76 @@ +# Export a project + +This sample demonstrates how to export a project. To get started, you'll need to create a Cognitive Language service endpoint and an API key. See the [README](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.Language.Conversations_1.1.0/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md) for links and instructions. + +> [!NOTE] +> Conversational Authoring is not supported in version 2.0.0-beta.1. If you use Conversational Authoring, please continue to use version 1.1.0. + +Start by importing the namespace for the `ConversationAuthoringClient` and related classes: + +```C# +using Azure.Core; +using Azure.AI.Language.Conversations.Authoring; +``` + +To export a project, you'll need to first create a `ConversationAuthoringClient` using an endpoint and an API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. + +```C# +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); + +ConversationAuthoringClient client = new ConversationAuthoringClient(endpoint, credential); +``` + +Once you have created a client, you can call synchronous or asynchronous methods. Typically, the content would come from a file but a small sample is shown here for demonstration purposes. + +## Synchronous + +Exporting a project returns an operation. Once this operation completes, you can get the `resultUrl` out of the response body and pass through the HTTP pipeline exposed by the client to download the project. + +```C# +string projectName = "project-to-export"; +Operation exportOperation = client.ExportProject(WaitUntil.Completed, projectName); + +// Get the resultUrl from the response, which contains the exported project. +using JsonDocument doc = JsonDocument.Parse(exportOperation.Value.ToStream()); +string resultUrl = doc.RootElement.GetProperty("resultUrl").GetString(); + +// Use the client pipeline to create and send a request to download the raw URL. +RequestUriBuilder builder = new RequestUriBuilder(); +builder.Reset(new Uri(resultUrl)); + +Request request = client.Pipeline.CreateRequest(); +request.Method = RequestMethod.Get; +request.Uri = builder; + +// Save the project to a file in the current working directory. +Response response = client.Pipeline.SendRequest(request, cancellationToken: default); + +string path = "project.json"; +response.ContentStream.CopyTo(File.Create(path)); +``` + +## Asynchronous + +```C# +string projectName = "project-to-export"; +Operation exportOperation = await client.ExportProjectAsync(WaitUntil.Completed, projectName); + +// Get the resultUrl from the response, which contains the exported project. +using JsonDocument doc = JsonDocument.Parse(exportOperation.Value.ToStream()); +string resultUrl = doc.RootElement.GetProperty("resultUrl").GetString(); + +// Use the client pipeline to create and send a request to download the raw URL. +RequestUriBuilder builder = new RequestUriBuilder(); +builder.Reset(new Uri(resultUrl)); + +Request request = client.Pipeline.CreateRequest(); +request.Method = RequestMethod.Get; +request.Uri = builder; + +// Save the project to a file in the current working directory. +Response response = await client.Pipeline.SendRequestAsync(request, cancellationToken: default); + +string path = "project.json"; +await response.ContentStream.CopyToAsync(File.Create(path)); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_AnalyzeConversation_ConversationPii.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample8_AnalyzeConversation_ConversationPii.md similarity index 98% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_AnalyzeConversation_ConversationPii.md rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample8_AnalyzeConversation_ConversationPii.md index c01baa621f33d..666773152f580 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_AnalyzeConversation_ConversationPii.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample8_AnalyzeConversation_ConversationPii.md @@ -1,4 +1,4 @@ -# Analyze a conversation with Conversation Summarization +# Analyze a conversation with Conversation PII This sample demonstrates how to detect and redact personally identifiable information from a conversation with Conversation Pii. To get started, you'll need to create a Cognitive Language service endpoint and an API key. See the [README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md) for links and instructions. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Readme.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Readme.cs index 90ea66beed09d..b99bc4763d790 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Readme.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Readme.cs @@ -28,6 +28,16 @@ public void CreateConversationClient() #endregion } + public void CreateConversationClientWithSpecificApiVersion() + { + #region Snippet:CreateConversationAnalysisClientForSpecificApiVersion + Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); + AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); + ConversationsClientOptions options = new ConversationsClientOptions(ConversationsClientOptions.ServiceVersion.V2024_05_01); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential, options); + #endregion + } + public void CreateConversationClientWithDefaultAzureCredential() { #region Snippet:ConversationAnalysisClient_CreateWithDefaultAzureCredential From f2864e777b8f0067c3948909d8d18bba9c84bf64 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Thu, 22 Aug 2024 15:55:33 +0800 Subject: [PATCH 12/71] eng/Template modification for typespec (#45596) --- .../.template.config/template.json | 53 ++++++++++-------- .../CHANGELOG.md | 4 +- .../assets.json | 2 +- .../src/autorest.md | 56 ------------------- .../tsp-location.yaml | 3 + eng/templates/README.md | 2 +- 6 files changed, 37 insertions(+), 83 deletions(-) delete mode 100644 eng/templates/Azure.ResourceManager.Template/src/autorest.md create mode 100644 eng/templates/Azure.ResourceManager.Template/tsp-location.yaml diff --git a/eng/templates/Azure.ResourceManager.Template/.template.config/template.json b/eng/templates/Azure.ResourceManager.Template/.template.config/template.json index 94d5c03086dac..2463ab5b258a4 100644 --- a/eng/templates/Azure.ResourceManager.Template/.template.config/template.json +++ b/eng/templates/Azure.ResourceManager.Template/.template.config/template.json @@ -46,13 +46,37 @@ "description": "The Azure provider name. ie. Microsoft.Network or Microsoft.Compute", "replaces": "ProviderFullName" }, - "tagVersion": { + "TypeSpecDirectory": { "type": "parameter", "datatype":"text", "isRequired": false, - "description": "The optional parameter specifies the tag in the README.MD. If empty, the default tag in the README.MD is used.", + "description": "TypeSpecDirectory under sdk/providername.", + "defaultValue": "TypeSpecDirectory", + "replaces": "TypeSpecDirectory" + }, + "CommitId": { + "type": "parameter", + "datatype":"text", + "isRequired": false, + "description": "the commit id of Azure spec repo.", + "defaultValue": "CommitId", + "replaces": "CommitId" + }, + "ChangeLogH2Title": { + "type": "parameter", + "datatype":"text", + "isRequired": false, + "description": "the H2 title of Changelog", + "defaultValue": "1.0.0-beta.1 (Unreleased)", + "replaces": "ChangeLogH2Title" + }, + "ChangeLogSdkDescription": { + "type": "parameter", + "datatype":"text", + "isRequired": false, + "description": "Sdk description", "defaultValue": "", - "replaces": "SwaggerVersionTag" + "replaces": "ChangeLogSdkDescription" }, "includeCI": { "type": "parameter", @@ -61,12 +85,12 @@ "description": "The optional parameter specifies whether generate related pipline ci.yml and test-resources.json in parent folder.", "defaultValue": "false" }, - "ProviderShortNameLowercase": { + "LowercaseProviderShortName": { "type": "derived", "datatype": "text", "valueSource": "provider", "valueTransform": "ProviderShortNameLowerForm", - "replaces": "ProviderNameLowercase" + "replaces": "LowercaseProviderShortName" }, "ProviderShortName": { "type": "derived", @@ -88,25 +112,6 @@ { "regex": "\\.", "replacement": "" } ] } - }, - "tagPrefix": { - "type": "generated", - "generator": "switch", - "replaces": "tagPrefix", - "parameters": { - "evaluator": "MSBUILD", - "datatype": "string", - "cases": [ - { - "condition": "('tagVersion' == '')", - "value": "" - }, - { - "condition": "('tagVersion' != '')", - "value": "tag:" - } - ] - } } }, "forms": { diff --git a/eng/templates/Azure.ResourceManager.Template/CHANGELOG.md b/eng/templates/Azure.ResourceManager.Template/CHANGELOG.md index 6a9f3bac33c1d..9410023df8670 100644 --- a/eng/templates/Azure.ResourceManager.Template/CHANGELOG.md +++ b/eng/templates/Azure.ResourceManager.Template/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## ChangeLogH2Title + +ChangeLogSdkDescription ### Features Added diff --git a/eng/templates/Azure.ResourceManager.Template/assets.json b/eng/templates/Azure.ResourceManager.Template/assets.json index 8fe6b015af19b..44e528c06061f 100644 --- a/eng/templates/Azure.ResourceManager.Template/assets.json +++ b/eng/templates/Azure.ResourceManager.Template/assets.json @@ -1,6 +1,6 @@ { "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", - "TagPrefix": "net//Azure.ResourceManager.Template", + "TagPrefix": "net/LowercaseProviderShortName/Azure.ResourceManager.Template", "Tag": "" } diff --git a/eng/templates/Azure.ResourceManager.Template/src/autorest.md b/eng/templates/Azure.ResourceManager.Template/src/autorest.md deleted file mode 100644 index cbbc44c8aad43..0000000000000 --- a/eng/templates/Azure.ResourceManager.Template/src/autorest.md +++ /dev/null @@ -1,56 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateCode` to generate code. - -``` yaml -azure-arm: true -csharp: true -library-name: ProviderShortName -namespace: Azure.ResourceManager.ProviderShortName -require: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/ProviderNameLowercase/resource-manager/readme.md -output-folder: $(this-folder)/Generated -clear-output-folder: true -sample-gen: - output-folder: $(this-folder)/../samples/Generated - clear-output-folder: true -skip-csproj: true -modelerfour: - flatten-payloads: false -use-model-reader-writer: true - -#mgmt-debug: -# show-serialized-names: true - -tagPrefix SwaggerVersionTag - -format-by-name-rules: - 'tenantId': 'uuid' - 'ETag': 'etag' - 'location': 'azure-location' - '*Uri': 'Uri' - '*Uris': 'Uri' - -acronym-mapping: - CPU: Cpu - CPUs: Cpus - Os: OS - Ip: IP - Ips: IPs|ips - ID: Id - IDs: Ids - VM: Vm - VMs: Vms - Vmos: VmOS - VMScaleSet: VmScaleSet - DNS: Dns - VPN: Vpn - NAT: Nat - WAN: Wan - Ipv4: IPv4|ipv4 - Ipv6: IPv6|ipv6 - Ipsec: IPsec|ipsec - SSO: Sso - URI: Uri - Etag: ETag|etag - -``` \ No newline at end of file diff --git a/eng/templates/Azure.ResourceManager.Template/tsp-location.yaml b/eng/templates/Azure.ResourceManager.Template/tsp-location.yaml new file mode 100644 index 0000000000000..cd8ab8802f688 --- /dev/null +++ b/eng/templates/Azure.ResourceManager.Template/tsp-location.yaml @@ -0,0 +1,3 @@ +directory: specification/LowercaseProviderShortName/TypeSpecDirectory +commit: CommitId +repo: Azure/azure-rest-api-specs \ No newline at end of file diff --git a/eng/templates/README.md b/eng/templates/README.md index 35e0508087b99..94efe37d8fd9f 100644 --- a/eng/templates/README.md +++ b/eng/templates/README.md @@ -42,7 +42,7 @@ Following parameter is available ### Next Step -1. Inspect `src\autorest.md` to ensure the REST Api path is valid +1. Inspect `tsp-location.yaml` to ensure the REST Api path is valid 2. Run `dotnet build` to ensure empty project builds successfully. 3. Run `dotnet build /t:GenerateCode` to generate C# code and ensure no fatal errors. 4. Run `dotnet build` to ensure now generated project builds successfully. From 28ce8f9b287a0bcb5ec208817247a47047fc1f4a Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:00:22 -0700 Subject: [PATCH 13/71] Increment package version after release of Azure.Messaging.EventGrid (#45637) --- sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Messaging.EventGrid.csproj | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md index fbf2a31af9515..9311fd17d303e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 4.26.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 4.25.0 (2024-08-21) ### Features Added diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj index e26f900ed4971..6904a5b6fe8fd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj @@ -2,9 +2,9 @@ This library can be used to publish events to Azure Event Grid and to consume events delivered by EventGrid. It also defines the event schemas for the events published to EventGrid by various Azure services. Microsoft Azure.Messaging.EventGrid client library - 4.25.0 + 4.26.0-beta.1 - 4.24.1 + 4.25.0 Microsoft Azure EventGrid;Event Grid;Event Grid Publishing; true $(RequiredTargetFrameworks) From 425f4e6b41827222f1ecae12607726e705272a30 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:00:48 -0700 Subject: [PATCH 14/71] Increment package version after release of Azure.Monitor.Query (#45628) --- sdk/monitor/Azure.Monitor.Query/CHANGELOG.md | 10 ++++++++++ .../Azure.Monitor.Query/src/Azure.Monitor.Query.csproj | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md b/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md index 0a89caae8b39c..463fdcc858018 100644 --- a/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md +++ b/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.6.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.5.0 (2024-08-21) ### Bugs Fixed - Fix bug in `LogsQueryClient` that defaulted to `Azure.PublicCloud`. `Audience` is now determined from the `endpoint` parameter. diff --git a/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj b/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj index efd42c3a2bf8c..e6fcaa9dbbbf2 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj +++ b/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj @@ -2,9 +2,9 @@ A library for querying Azure Monitor's Logs and Metrics data sources. Azure Monitor Query client library - 1.5.0 + 1.6.0-beta.1 - 1.4.0 + 1.5.0 Azure Monitor Query true $(RequiredTargetFrameworks) From c0a661fef7aec0a16eebf59eb33dba7de042559e Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:56:24 -0700 Subject: [PATCH 15/71] Increment package version after release of Azure.ResourceManager.DataFactory (#45562) --- .../Azure.ResourceManager.DataFactory/CHANGELOG.md | 10 ++++++++++ .../src/Azure.ResourceManager.DataFactory.csproj | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/CHANGELOG.md b/sdk/datafactory/Azure.ResourceManager.DataFactory/CHANGELOG.md index 06a0e0e839005..77afc20c6396f 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/CHANGELOG.md +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.4.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.3.0 (2024-08-16) ### Features Added diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Azure.ResourceManager.DataFactory.csproj b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Azure.ResourceManager.DataFactory.csproj index 3d76b61309d6d..77413add30143 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Azure.ResourceManager.DataFactory.csproj +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Azure.ResourceManager.DataFactory.csproj @@ -1,8 +1,8 @@ - 1.3.0 + 1.4.0-beta.1 - 1.2.0 + 1.3.0 Azure.ResourceManager.DataFactory Microsoft Azure Resource Manager client SDK for Azure resource provider Microsoft.DataFactory. azure;management;arm;resource manager;datafactory From 16a351e3959bd0b08215838d67c67816324a756e Mon Sep 17 00:00:00 2001 From: Paul Harrington Date: Thu, 22 Aug 2024 14:05:03 -0700 Subject: [PATCH 16/71] Introduce overloaded constructor on AzureEventSourceListener (#45191) * Introduce overloaded constructor on AzureEventSourceListener taking a delegate without the formatted message. * Update CHANGELOG * Use new constructor in tests, where appropriate * Update public API --- sdk/core/Azure.Core/CHANGELOG.md | 2 ++ sdk/core/Azure.Core/api/Azure.Core.net461.cs | 1 + sdk/core/Azure.Core/api/Azure.Core.net472.cs | 1 + sdk/core/Azure.Core/api/Azure.Core.net6.0.cs | 1 + .../Azure.Core/api/Azure.Core.netstandard2.0.cs | 1 + .../Azure.Core/perf/EventSourceBenchmark.cs | 3 ++- .../src/Diagnostics/AzureEventSourceListener.cs | 17 +++++++++++++---- .../Azure.Core/tests/AzureEventSourceTests.cs | 2 +- .../Azure.Core/tests/HttpPipelineBuilderTest.cs | 5 +---- 9 files changed, 23 insertions(+), 10 deletions(-) diff --git a/sdk/core/Azure.Core/CHANGELOG.md b/sdk/core/Azure.Core/CHANGELOG.md index 73dbbcc750940..d35fa12939afc 100644 --- a/sdk/core/Azure.Core/CHANGELOG.md +++ b/sdk/core/Azure.Core/CHANGELOG.md @@ -10,6 +10,8 @@ ### Other Changes +- Added a new constructor on `AzureEventSourceListener` for callers that don't need the formatted message ([#45191](https://github.com/Azure/azure-sdk-for-net/pull/45191)). + ## 1.42.0 (2024-08-01) ### Other Changes diff --git a/sdk/core/Azure.Core/api/Azure.Core.net461.cs b/sdk/core/Azure.Core/api/Azure.Core.net461.cs index 5f34b2c37794b..35906202bd9f1 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net461.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net461.cs @@ -807,6 +807,7 @@ public partial class AzureEventSourceListener : System.Diagnostics.Tracing.Event public const string TraitName = "AzureEventSource"; public const string TraitValue = "true"; public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } + public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateConsoleLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateTraceLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } protected sealed override void OnEventSourceCreated(System.Diagnostics.Tracing.EventSource eventSource) { } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net472.cs b/sdk/core/Azure.Core/api/Azure.Core.net472.cs index 5f34b2c37794b..35906202bd9f1 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net472.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net472.cs @@ -807,6 +807,7 @@ public partial class AzureEventSourceListener : System.Diagnostics.Tracing.Event public const string TraitName = "AzureEventSource"; public const string TraitValue = "true"; public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } + public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateConsoleLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateTraceLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } protected sealed override void OnEventSourceCreated(System.Diagnostics.Tracing.EventSource eventSource) { } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net6.0.cs b/sdk/core/Azure.Core/api/Azure.Core.net6.0.cs index 7c538465c29bb..9b0a433af9747 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net6.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net6.0.cs @@ -812,6 +812,7 @@ public partial class AzureEventSourceListener : System.Diagnostics.Tracing.Event public const string TraitName = "AzureEventSource"; public const string TraitValue = "true"; public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } + public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateConsoleLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateTraceLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } protected sealed override void OnEventSourceCreated(System.Diagnostics.Tracing.EventSource eventSource) { } diff --git a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs index 5f34b2c37794b..35906202bd9f1 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs @@ -807,6 +807,7 @@ public partial class AzureEventSourceListener : System.Diagnostics.Tracing.Event public const string TraitName = "AzureEventSource"; public const string TraitValue = "true"; public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } + public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateConsoleLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateTraceLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } protected sealed override void OnEventSourceCreated(System.Diagnostics.Tracing.EventSource eventSource) { } diff --git a/sdk/core/Azure.Core/perf/EventSourceBenchmark.cs b/sdk/core/Azure.Core/perf/EventSourceBenchmark.cs index d05eebd0787ad..d4e2e0163c938 100644 --- a/sdk/core/Azure.Core/perf/EventSourceBenchmark.cs +++ b/sdk/core/Azure.Core/perf/EventSourceBenchmark.cs @@ -33,7 +33,7 @@ public class EventSourceBenchmark [GlobalSetup] public void SetUp() { - _sourceListener = new AzureEventSourceListener((_, _) => { }, EventLevel.LogAlways); + _sourceListener = new AzureEventSourceListener(_ => { }, EventLevel.LogAlways); _eventSource = new EventSource(); _sourceListener.EnableEvents(_eventSource, EventLevel.LogAlways); @@ -84,6 +84,7 @@ private byte[] FormatHeaders() string newValue = Sanitizer.SanitizeHeader(header.Name, header.Value); stringBuilder.AppendLine(newValue); } + return Encoding.UTF8.GetBytes(stringBuilder.ToString()); } diff --git a/sdk/core/Azure.Core/src/Diagnostics/AzureEventSourceListener.cs b/sdk/core/Azure.Core/src/Diagnostics/AzureEventSourceListener.cs index c0a51d5372fd3..5f66f0bffb580 100644 --- a/sdk/core/Azure.Core/src/Diagnostics/AzureEventSourceListener.cs +++ b/sdk/core/Azure.Core/src/Diagnostics/AzureEventSourceListener.cs @@ -25,15 +25,15 @@ public class AzureEventSourceListener: EventListener public const string TraitValue = "true"; private readonly List _eventSources = new List(); - private readonly Action _log; + private readonly Action _log; private readonly EventLevel _level; /// /// Creates an instance of that executes a callback every time event is written. /// - /// The to call when event is written. The second parameter is formatted message. + /// The to call when event is written. /// The level of events to enable. - public AzureEventSourceListener(Action log, EventLevel level) + public AzureEventSourceListener(Action log, EventLevel level) { _log = log ?? throw new ArgumentNullException(nameof(log)); @@ -47,6 +47,15 @@ public AzureEventSourceListener(Action log, Event _eventSources.Clear(); } + /// + /// Creates an instance of that executes a callback every time event is written. + /// + /// The to call when event is written. The second parameter is the formatted message. + /// The level of events to enable. + public AzureEventSourceListener(Action log, EventLevel level) : this(e => log(e, EventSourceEventFormatting.Format(e)), level) + { + } + /// protected sealed override void OnEventSourceCreated(EventSource eventSource) { @@ -74,7 +83,7 @@ protected sealed override void OnEventWritten(EventWrittenEventArgs eventData) // There is a very tight race during the AzureEventSourceListener creation where EnableEvents was called // and the thread producing events not observing the `_log` field assignment - _log?.Invoke(eventData, EventSourceEventFormatting.Format(eventData)); + _log?.Invoke(eventData); } /// diff --git a/sdk/core/Azure.Core/tests/AzureEventSourceTests.cs b/sdk/core/Azure.Core/tests/AzureEventSourceTests.cs index f08008869e280..03d1a1a8bfb8a 100644 --- a/sdk/core/Azure.Core/tests/AzureEventSourceTests.cs +++ b/sdk/core/Azure.Core/tests/AzureEventSourceTests.cs @@ -39,7 +39,7 @@ void LogEvent(EventSource azureCoreEventSource) try { List events = new(); - using var listener = new AzureEventSourceListener((args, s) => events.Add(args), EventLevel.Verbose); + using var listener = new AzureEventSourceListener(events.Add, EventLevel.Verbose); alc.LoadFromAssemblyPath(typeof(TestEventSource).Assembly.Location); alc2.LoadFromAssemblyPath(typeof(TestEventSource).Assembly.Location); diff --git a/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs b/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs index a7ee3ab94645d..bc0e6cac371f2 100644 --- a/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs +++ b/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs @@ -250,10 +250,7 @@ public void SetTransportOptions([Values(true, false)] bool isCustomTransportSet) List events = new(); using var listener = new AzureEventSourceListener( - (args, s) => - { - events.Add(args); - }, + events.Add, EventLevel.Verbose); var pipeline = HttpPipelineBuilder.Build( From 150082bd7ac135540c5e3ec145ca596cc7e20716 Mon Sep 17 00:00:00 2001 From: Rajkumar Rangaraj Date: Thu, 22 Aug 2024 14:05:23 -0700 Subject: [PATCH 17/71] [AzureMonitorDistro] Update AzureEventSourceLogForwarder defaults to warning (#45649) * Default log level set to Warning for Azure SDKs * changelog * Drop the customization change logic, give complete control to customers. * Update test * test change. --- .../CHANGELOG.md | 6 + .../AzureEventSourceLogForwarder.cs | 18 ++- .../src/OpenTelemetryBuilderExtensions.cs | 3 +- .../AzureSdkLoggingTests.cs | 131 ++++++++++++++++-- 4 files changed, 145 insertions(+), 13 deletions(-) diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md index 32db15360c8c9..ad520cffeae6a 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md @@ -20,6 +20,12 @@ ### Other Changes +* Updated log collection to default to Warning level and above for Azure SDKs + via `Microsoft.Extensions.Logging`. For more information, refer to [Logging + with the Azure SDK for + .NET](https://learn.microsoft.com/dotnet/azure/sdk/logging). + ([#45649](https://github.com/Azure/azure-sdk-for-net/pull/45649)) + ## 1.3.0-beta.1 (2024-07-12) ### Bugs Fixed diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs index 81120d325d82a..e8d1f476644a5 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs @@ -14,8 +14,9 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore.Internals.AzureSdkCompat { internal sealed class AzureEventSourceLogForwarder : IHostedService, IDisposable { - internal static readonly AzureEventSourceLogForwarder Noop = new AzureEventSourceLogForwarder(null); + internal static readonly AzureEventSourceLogForwarder Noop = new AzureEventSourceLogForwarder(null, null); private readonly ILoggerFactory _loggerFactory; + private readonly bool _hasAzureLoggerFilterOptionsRules = false; private readonly ConcurrentDictionary _loggers = new ConcurrentDictionary(); @@ -23,9 +24,18 @@ internal sealed class AzureEventSourceLogForwarder : IHostedService, IDisposable private AzureEventSourceListener _listener; - public AzureEventSourceLogForwarder(ILoggerFactory loggerFactory) + public AzureEventSourceLogForwarder(ILoggerFactory loggerFactory, LoggerFilterOptions loggerFilterOptions) { _loggerFactory = loggerFactory; + + foreach (var rule in loggerFilterOptions?.Rules ?? Enumerable.Empty()) + { + if (!string.IsNullOrEmpty(rule.CategoryName) && + (rule.CategoryName.StartsWith("Azure.") || rule.CategoryName.StartsWith("Microsoft.Azure."))) + { + _hasAzureLoggerFilterOptionsRules = true; + } + } } private void LogEvent(EventWrittenEventArgs eventData) @@ -67,7 +77,9 @@ public Task StartAsync(CancellationToken cancellationToken) { if (_loggerFactory != null) { - _listener ??= new AzureEventSourceListener((e, s) => LogEvent(e), EventLevel.Verbose); + // Setting even a single custom filter for Azure SDK logs will reset the default warning level and switch to listening at the verbose level. + // This gives the customer full control over the log levels for all Azure SDK components. + _listener ??= new AzureEventSourceListener((e, s) => LogEvent(e), _hasAzureLoggerFilterOptionsRules ? EventLevel.Verbose : EventLevel.Warning); } return Task.CompletedTask; diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs index 6b3a6167abbd9..a3ad51fe2019e 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs @@ -176,7 +176,8 @@ public static OpenTelemetryBuilder UseAzureMonitor(this OpenTelemetryBuilder bui } var loggerFactory = sp.GetRequiredService(); - return new AzureEventSourceLogForwarder(loggerFactory); + var loggerFilterOptions = sp.GetRequiredService>().CurrentValue; + return new AzureEventSourceLogForwarder(loggerFactory, loggerFilterOptions); }); // Register Manager as a singleton diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs index d2b336bb29325..99e574bd694ce 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs @@ -27,19 +27,27 @@ public class AzureSdkLoggingTests #else [Theory] #endif - [InlineData(LogLevel.Information, "TestInfoEvent: hello")] - [InlineData(LogLevel.Warning, "TestWarningEvent: hello")] - [InlineData(LogLevel.Debug, null)] - public async Task DistroLogForwarderIsAdded(LogLevel eventLevel, string expectedMessage) + [InlineData(false, LogLevel.Debug, null)] + [InlineData(false, LogLevel.Information, null)] + [InlineData(false, LogLevel.Warning, "TestWarningEvent: hello")] + [InlineData(true, LogLevel.Information, "TestInfoEvent: hello")] + [InlineData(true, LogLevel.Warning, "TestWarningEvent: hello")] + [InlineData(true, LogLevel.Debug, "TestVerboseEvent: hello")] + public async Task DistroLogForwarderIsAdded(bool addLoggingFilter, LogLevel eventLevel, string expectedMessage) { var builder = WebApplication.CreateBuilder(); + using TestEventSource source = new TestEventSource(addLoggingFilter ? "Azure-LoggingFilter" : "Azure-Test"); + + if (addLoggingFilter) + { + builder.Logging.AddFilter(source.Name.Replace('-', '.'), eventLevel); + } var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); SetUpOTelAndLogging(builder, transport, LogLevel.Information); using var app = builder.Build(); await app.StartAsync(); - using TestEventSource source = new TestEventSource(); Assert.True(source.IsEnabled()); source.LogMessage("hello", eventLevel); WaitForRequest(transport); @@ -79,7 +87,7 @@ public async Task PublicLogForwarderIsAdded(LogLevel eventLevel, string expected await app.StartAsync(); - using TestEventSource source = new TestEventSource(); + using TestEventSource source = new TestEventSource("Azure-Test"); Assert.True(source.IsEnabled()); source.LogMessage("hello", eventLevel); @@ -140,6 +148,99 @@ public async Task SelfDiagnosticsIsDisabled() Assert.False(logAzureFilterCalled); } + [Fact] + public async Task DistroLogForwarderAppliesWildCardFilter() + { + var builder = WebApplication.CreateBuilder(); + builder.Logging.AddFilter("Azure.*", LogLevel.Warning); + + var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); + SetUpOTelAndLogging(builder, transport, LogLevel.Information); + + using var app = builder.Build(); + await app.StartAsync(); + + using TestEventSource source = new TestEventSource("Azure-Test"); + Assert.True(source.IsEnabled()); + source.LogMessage("hello", LogLevel.Warning); + WaitForRequest(transport); + + Assert.Single(transport.Requests); + await AssertContentContains(transport.Requests.Single(), "TestWarningEvent: hello", LogLevel.Warning); + } + + [Fact] + public async Task SettingCustomLoggingFilterResetsDefaultWarningLevel() + { + var builder = WebApplication.CreateBuilder(); + // Even when a single custom filter is set, it should reset the default warning level. + builder.Logging.AddFilter("Azure.One", LogLevel.Information); + + var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); + SetUpOTelAndLogging(builder, transport, LogLevel.Information); + + using var app = builder.Build(); + await app.StartAsync(); + + // Azure-One is added as a logging filter, the default warning level is reset. + // Informational-level logs from Azure-One sources are collected. + using TestEventSource source1 = new TestEventSource("Azure-One"); + Assert.True(source1.IsEnabled()); + + source1.LogMessage("hello one", LogLevel.Information); + WaitForRequest(transport); + Assert.Single(transport.Requests); + await AssertContentContains(transport.Requests.Single(), "TestInfoEvent: hello one", LogLevel.Information); + transport.Requests.Clear(); + + // Azure-Two is not part of the logging filter. + // Since the logging filter is customized for the Azure SDK, the default warning level is reset. + // Informational-level logs from Azure-Two sources are collected. + using TestEventSource source2 = new TestEventSource("Azure-Two"); + Assert.True(source2.IsEnabled()); + + source2.LogMessage("hello two", LogLevel.Information); + WaitForRequest(transport); + Assert.Single(transport.Requests); + await AssertContentContains(transport.Requests.Single(), "TestInfoEvent: hello two", LogLevel.Information); + } + + [Fact] + public async Task CustomLoggingFilterOverridesDefaultWarningAndCapturesErrorLogs() + { + var builder = WebApplication.CreateBuilder(); + // Even when a single custom filter is set, it should reset the default warning level. + builder.Logging.AddFilter("Azure.One", LogLevel.Error); + + var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); + SetUpOTelAndLogging(builder, transport, LogLevel.Information); + + using var app = builder.Build(); + await app.StartAsync(); + + using TestEventSource source1 = new TestEventSource("Azure-One"); + Assert.True(source1.IsEnabled()); + + // Only log level with errors should be captured as it is set in the logging filter. + source1.LogMessage("Hello Information", LogLevel.Information); + source1.LogMessage("Hello Debug", LogLevel.Debug); + source1.LogMessage("Hello Warning", LogLevel.Warning); + source1.LogMessage("Hello Error", LogLevel.Error); + WaitForRequest(transport); + Assert.Single(transport.Requests); + await AssertContentContains(transport.Requests.Single(), "TestErrorEvent: Hello Error", LogLevel.Error); + + // Azure-Two is not part of the logging filter, it should capture all logs. + using TestEventSource source2 = new TestEventSource("Azure-Two"); + Assert.True(source2.IsEnabled()); + transport.Requests.Clear(); + + source2.LogMessage("hello two", LogLevel.Information); + WaitForRequest(transport); + Assert.Single(transport.Requests); + await AssertContentContains(transport.Requests.Single(), "TestInfoEvent: hello two", LogLevel.Information); + } + private IEnumerable WaitForRequest(MockTransport transport, Func? filter = null) { filter = filter ?? (_ => true); @@ -161,7 +262,8 @@ private static async Task AssertContentContains(MockRequest request, str contentStream.Position = 0; var content = BinaryData.FromStream(contentStream).ToString(); var jsonMessage = $"\"message\":\"{expectedMessage}\""; - var jsonLevel = $"\"severityLevel\":\"{expectedLevel}\""; + var level = expectedLevel == LogLevel.Debug ? "Verbose" : expectedLevel.ToString(); + var jsonLevel = $"\"severityLevel\":\"{level}\""; Assert.Contains(jsonMessage, content); Assert.Contains(jsonLevel, content); @@ -206,9 +308,11 @@ private static void SetUpOTelAndLogging(WebApplicationBuilder builder, MockTrans internal class TestEventSource : AzureEventSource { - private const string EventSourceName = "Azure-Test"; - public TestEventSource() : base(EventSourceName) + private readonly string EventSourceName; + + public TestEventSource(string eventSourceName) : base(eventSourceName) { + EventSourceName = eventSourceName; } [Event(1, Level = EventLevel.Informational, Message = "TestInfoEvent: {0}")] @@ -229,10 +333,19 @@ public void LogTestWarningEvent(string message) WriteEvent(3, message); } + [Event(4, Level = EventLevel.Error, Message = "TestErrorEvent: {0}")] + public void LogTestErrorEvent(string message) + { + WriteEvent(4, message); + } + public void LogMessage(string message, LogLevel level) { switch (level) { + case LogLevel.Error: + LogTestErrorEvent(message); + break; case LogLevel.Warning: LogTestWarningEvent(message); break; From cf860363b0a20eefcb783c0289802701e3878cf7 Mon Sep 17 00:00:00 2001 From: Timothy Mothra Date: Fri, 23 Aug 2024 11:10:30 -0700 Subject: [PATCH 18/71] disable tests in net6 and MacOS (#45656) --- .../AzureSdkLoggingTests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs index 99e574bd694ce..773abfebf60bb 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs @@ -148,7 +148,11 @@ public async Task SelfDiagnosticsIsDisabled() Assert.False(logAzureFilterCalled); } +#if NET6_0 + [ConditionallySkipOSFact(platformToSkip: "macos", reason: "This test consistently exceeds 1 hour runtime limit when running on MacOS & Net60")] +#else [Fact] +#endif public async Task DistroLogForwarderAppliesWildCardFilter() { var builder = WebApplication.CreateBuilder(); @@ -169,7 +173,11 @@ public async Task DistroLogForwarderAppliesWildCardFilter() await AssertContentContains(transport.Requests.Single(), "TestWarningEvent: hello", LogLevel.Warning); } +#if NET6_0 + [ConditionallySkipOSFact(platformToSkip: "macos", reason: "This test consistently exceeds 1 hour runtime limit when running on MacOS & Net60")] +#else [Fact] +#endif public async Task SettingCustomLoggingFilterResetsDefaultWarningLevel() { var builder = WebApplication.CreateBuilder(); @@ -205,7 +213,11 @@ public async Task SettingCustomLoggingFilterResetsDefaultWarningLevel() await AssertContentContains(transport.Requests.Single(), "TestInfoEvent: hello two", LogLevel.Information); } +#if NET6_0 + [ConditionallySkipOSFact(platformToSkip: "macos", reason: "This test consistently exceeds 1 hour runtime limit when running on MacOS & Net60")] +#else [Fact] +#endif public async Task CustomLoggingFilterOverridesDefaultWarningAndCapturesErrorLogs() { var builder = WebApplication.CreateBuilder(); From 91dc3f14f2d219c61ec7cdb715764becfce8fc73 Mon Sep 17 00:00:00 2001 From: Timothy Mothra Date: Fri, 23 Aug 2024 13:11:56 -0700 Subject: [PATCH 19/71] [AzureMonitorDistro] fix for LiveMetrics Dependencies (#45103) * fix for LiveMetrics and manual Dependencies * changelog * update all dependency mappings * fix * update tests * cleanup * cleanup * drop ActivityType * changelog * update changelog * update mappings * fix tests --- .../CHANGELOG.md | 6 ++ .../DataCollection/DocumentHelper.cs | 41 +++++++----- .../DocumentTests/HttpClientDependecyTests.cs | 4 +- .../DocumentTests/ManualDependencyTests.cs | 66 +++++++++++++++++++ .../DocumentTests/SqlClientDependencyTests.cs | 8 +-- 5 files changed, 101 insertions(+), 24 deletions(-) create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/ManualDependencyTests.cs diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md index ad520cffeae6a..9351eb7c2f83b 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md @@ -18,8 +18,14 @@ * Fixed a bug where LiveMetrics displays "UNKNOWN_INSTANCE" and "UNKNOWN_NAME" for "server name" and "role name" respectively. ([#45433](https://github.com/Azure/azure-sdk-for-net/pull/45433)) +* Fixed a bug in LiveMetrics that counted all manually created Dependencies as failures. + ([#45103](https://github.com/Azure/azure-sdk-for-net/pull/45103)) + ### Other Changes +* Updated field mappings for telemetry sent to LiveMetrics. + ([#45103](https://github.com/Azure/azure-sdk-for-net/pull/45103)) + * Updated log collection to default to Warning level and above for Azure SDKs via `Microsoft.Extensions.Logging`. For more information, refer to [Logging with the Azure SDK for diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/DataCollection/DocumentHelper.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/DataCollection/DocumentHelper.cs index c4727d0dbc4bb..a083e3ede32b2 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/DataCollection/DocumentHelper.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/DataCollection/DocumentHelper.cs @@ -108,8 +108,13 @@ internal static RemoteDependency ConvertToDependencyDocument(Activity activity) RemoteDependency remoteDependencyDocument = new() { DocumentType = DocumentType.RemoteDependency, + Duration = activity.Duration < SchemaConstants.RemoteDependencyData_Duration_LessThanDays + ? activity.Duration.ToString("c", CultureInfo.InvariantCulture) + : SchemaConstants.Duration_MaxValue, + // The following "EXTENSION" properties are used to calculate metrics. These are not serialized. Extension_Duration = activity.Duration.TotalMilliseconds, + Extension_IsSuccess = activity.Status != ActivityStatusCode.Error, }; var liveMetricsTagsProcessor = new LiveMetricsTagsProcessor(); @@ -119,41 +124,41 @@ internal static RemoteDependency ConvertToDependencyDocument(Activity activity) { case OperationType.Http: remoteDependencyDocument.Name = activity.DisplayName; - remoteDependencyDocument.CommandName = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeUrlFull)?.ToString(); + + var httpUrl = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeUrlFull)?.ToString(); + remoteDependencyDocument.CommandName = httpUrl; + var httpResponseStatusCode = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeHttpResponseStatusCode)?.ToString(); - remoteDependencyDocument.ResultCode = httpResponseStatusCode; - remoteDependencyDocument.Duration = activity.Duration < SchemaConstants.RequestData_Duration_LessThanDays - ? activity.Duration.ToString("c", CultureInfo.InvariantCulture) - : SchemaConstants.Duration_MaxValue; + remoteDependencyDocument.ResultCode = httpResponseStatusCode ?? "0"; // The following "EXTENSION" properties are used to calculate metrics. These are not serialized. remoteDependencyDocument.Extension_IsSuccess = IsHttpSuccess(activity, httpResponseStatusCode); break; case OperationType.Db: - // Note: The Exception details are recorded in Activity.Events only if the configuration has opt-ed into this (SqlClientInstrumentationOptions.RecordException). - - var (_, dbTarget) = liveMetricsTagsProcessor.Tags.GetDbDependencyTargetAndName(); + remoteDependencyDocument.Name = activity.DisplayName; - remoteDependencyDocument.Name = dbTarget; remoteDependencyDocument.CommandName = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeDbStatement)?.ToString(); - remoteDependencyDocument.Duration = activity.Duration.ToString("c", CultureInfo.InvariantCulture); // TODO: remoteDependencyDocumentIngress.ResultCode = ""; // AI SDK reads a Number property from Connection or Command objects. // As of Feb 2024, OpenTelemetry doesn't record this. This may change in the future when the semantic convention stabalizes. - // The following "EXTENSION" properties are used to calculate metrics. These are not serialized. - remoteDependencyDocument.Extension_IsSuccess = activity.Status != ActivityStatusCode.Error; - break; - case OperationType.Rpc: - // TODO RPC break; case OperationType.Messaging: - // TODO MESSAGING + remoteDependencyDocument.Name = activity.DisplayName; + + var (messagingUrl, _) = liveMetricsTagsProcessor.Tags.GetMessagingUrlAndSourceOrTarget(activity.Kind); + remoteDependencyDocument.CommandName = messagingUrl; + break; + case OperationType.Rpc: + // remoteDependencyDocument.Name = activity.DisplayName; + // remoteDependencyDocument.CommandName = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeRpcService)?.ToString(); + // remoteDependencyDocument.ResultCode = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeRpcStatus)?.ToString(); default: - // Unknown or Unexpected Dependency Type - remoteDependencyDocument.Name = liveMetricsTagsProcessor.ActivityType.ToString(); + // Unknown or Manual or Unexpected Dependency Type + remoteDependencyDocument.Name = activity.DisplayName; + remoteDependencyDocument.Properties.Add(new KeyValuePairString("ActivitySource", activity.Source.Name)); break; } diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/HttpClientDependecyTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/HttpClientDependecyTests.cs index 0a1f042a6a072..828d42055c467 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/HttpClientDependecyTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/HttpClientDependecyTests.cs @@ -43,7 +43,7 @@ public void VerifyHttpClientAttributes() ActivitySource.AddActivityListener(listener); // ACT - using var dependencyActivity = activitySource.StartActivity(name: "HelloWorld", kind: ActivityKind.Client); + using var dependencyActivity = activitySource.StartActivity(name: "TestActivityName", kind: ActivityKind.Client); Assert.NotNull(dependencyActivity); dependencyActivity.SetTag("http.request.method", "GET"); dependencyActivity.SetTag("url.full", "http://bing.com"); @@ -67,7 +67,7 @@ public void VerifyHttpClientAttributes() // ASSERT Assert.Equal("http://bing.com", dependencyDocument.CommandName); Assert.Equal(DocumentType.RemoteDependency, dependencyDocument.DocumentType); - Assert.Equal("HelloWorld", dependencyDocument.Name); + Assert.Equal("TestActivityName", dependencyDocument.Name); Assert.Equal("200", dependencyDocument.ResultCode); VerifyCustomProperties(dependencyDocument); diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/ManualDependencyTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/ManualDependencyTests.cs new file mode 100644 index 0000000000000..5df314e5098fe --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/ManualDependencyTests.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Net.Http; +using System.Threading.Tasks; +using Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics.DataCollection; +using Azure.Monitor.OpenTelemetry.AspNetCore.Models; +using Microsoft.AspNetCore.Builder; +using OpenTelemetry; +using OpenTelemetry.Trace; +using Xunit; +using Xunit.Abstractions; + +namespace Azure.Monitor.OpenTelemetry.AspNetCore.Tests.LiveMetrics.DocumentTests +{ + public class ManualDependencyTests : DocumentTestBase + { + public ManualDependencyTests(ITestOutputHelper output) : base(output) + { + } + + [Theory] + [InlineData(ActivityStatusCode.Ok, true)] + [InlineData(ActivityStatusCode.Error, false)] + [InlineData(ActivityStatusCode.Unset, true)] + public void VerifyManualDependency(ActivityStatusCode activityStatusCode, bool expectedIsSuccess) + { + var exportedActivities = new List(); + + var testActivitySource = new ActivitySource("TestActivitySource"); + + // SETUP + using var tracerProvider = Sdk.CreateTracerProviderBuilder() + .AddSource("TestActivitySource") + .AddInMemoryExporter(exportedActivities) + .Build(); + + // ACT + using (var activity = testActivitySource.StartActivity("TestActivityName", ActivityKind.Internal)) + { + activity?.SetStatus(activityStatusCode); + } + + tracerProvider.ForceFlush(); + WaitForActivityExport(exportedActivities); + + // Assert + var dependencyActivity = exportedActivities.Last(); + PrintActivity(dependencyActivity); + var dependencyDocument = DocumentHelper.ConvertToDependencyDocument(dependencyActivity); + + Assert.Null(dependencyDocument.CommandName); + Assert.Equal(DocumentType.RemoteDependency, dependencyDocument.DocumentType); + Assert.Equal("TestActivityName", dependencyDocument.Name); + Assert.Equal("TestActivitySource", dependencyDocument.Properties.Single(x => x.Key == "ActivitySource").Value); + + //// The following "EXTENSION" properties are used to calculate metrics. These are not serialized. + Assert.Equal(dependencyActivity.Duration.TotalMilliseconds, dependencyDocument.Extension_Duration); + Assert.Equal(expectedIsSuccess, dependencyDocument.Extension_IsSuccess); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/SqlClientDependencyTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/SqlClientDependencyTests.cs index 83201283846aa..fa6a782ff2bbe 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/SqlClientDependencyTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/SqlClientDependencyTests.cs @@ -46,7 +46,7 @@ public void VerifySqlClientAttributes() ActivitySource.AddActivityListener(listener); // ACT - using var dependencyActivity = activitySource.StartActivity(name: "HelloWorld", kind: ActivityKind.Client); + using var dependencyActivity = activitySource.StartActivity(name: "TestActivityName", kind: ActivityKind.Client); Assert.NotNull(dependencyActivity); dependencyActivity.SetTag("db.system", "mssql"); dependencyActivity.SetTag("db.name", "MyDatabase"); @@ -71,7 +71,7 @@ public void VerifySqlClientAttributes() Assert.Equal("select * from sys.databases", dependencyDocument.CommandName); Assert.Equal(DocumentType.RemoteDependency, dependencyDocument.DocumentType); Assert.Equal(dependencyActivity.Duration.ToString("c"), dependencyDocument.Duration); - Assert.Equal("(localdb)\\MSSQLLocalDB | MyDatabase", dependencyDocument.Name); + Assert.Equal("TestActivityName", dependencyDocument.Name); VerifyCustomProperties(dependencyDocument); @@ -141,7 +141,7 @@ public void VerifySqlClientDependency( Assert.Equal(commandText, dependencyDocument.CommandName); Assert.Equal(DocumentType.RemoteDependency, dependencyDocument.DocumentType); Assert.Equal(dependencyActivity.Duration.ToString("c"), dependencyDocument.Duration); - Assert.Equal("(localdb)\\MSSQLLocalDB | MyDatabase", dependencyDocument.Name); + Assert.Equal("MyDatabase", dependencyDocument.Name); // The following "EXTENSION" properties are used to calculate metrics. These are not serialized. Assert.Equal(dependencyActivity.Duration.TotalMilliseconds, dependencyDocument.Extension_Duration); @@ -214,7 +214,7 @@ public void VerifySqlClientDependencyWithException( Assert.Equal(commandText, dependencyDocument.CommandName); Assert.Equal(DocumentType.RemoteDependency, dependencyDocument.DocumentType); Assert.Equal(dependencyActivity.Duration.ToString("c"), dependencyDocument.Duration); - Assert.Equal("(localdb)\\MSSQLLocalDB | MyDatabase", dependencyDocument.Name); + Assert.Equal("MyDatabase", dependencyDocument.Name); // The following "EXTENSION" properties are used to calculate metrics. These are not serialized. Assert.Equal(dependencyActivity.Duration.TotalMilliseconds, dependencyDocument.Extension_Duration); From df209754cbfaf90e0b7e67664e00afa26c2df6a8 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Fri, 23 Aug 2024 16:07:21 -0700 Subject: [PATCH 20/71] Add support for logging custom events (#45630) * Add support for logging custom events * fix test * review * namespace rename * rename * api * rename * refactor * todo * change loglevl and apply filter * Add tests * nt * refactor * review * skip -azure forwarder tests + address feedback * revert signature change --- ...re.Monitor.OpenTelemetry.AspNetCore.csproj | 4 +- .../src/OpenTelemetryBuilderExtensions.cs | 30 +++ .../AzureSdkLoggingTests.cs | 36 +--- .../E2ETests/ILoggerTests.cs | 187 ++++++++++++++++++ ...e.Monitor.OpenTelemetry.Exporter.net6.0.cs | 12 ++ ...r.OpenTelemetry.Exporter.netstandard2.0.cs | 12 ++ .../ApplicationInsightsEventLogger.cs | 43 ++++ .../IApplicationInsightsEventLogger.cs | 20 ++ .../Models/TelemetryEventData.cs | 26 +++ .../Customizations/Models/TelemetryItem.cs | 4 +- .../src/Internals/LogsHelper.cs | 12 +- .../TelemetryItemOutputHelper.cs | 14 ++ .../LogsHelperTests.cs | 40 ++++ 13 files changed, 405 insertions(+), 35 deletions(-) create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/E2ETests/ILoggerTests.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/ApplicationInsightsEventLogger.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/IApplicationInsightsEventLogger.cs create mode 100644 sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryEventData.cs diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Azure.Monitor.OpenTelemetry.AspNetCore.csproj b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Azure.Monitor.OpenTelemetry.AspNetCore.csproj index 2474f074dc023..1e16c984cda59 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Azure.Monitor.OpenTelemetry.AspNetCore.csproj +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Azure.Monitor.OpenTelemetry.AspNetCore.csproj @@ -23,10 +23,10 @@ - + - + diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs index a3ad51fe2019e..4906a3aff5659 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs @@ -6,6 +6,7 @@ using Azure.Monitor.OpenTelemetry.AspNetCore.Internals.LiveMetrics; using Azure.Monitor.OpenTelemetry.AspNetCore.Internals.Profiling; using Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics; +using Azure.Monitor.OpenTelemetry.Events; using Azure.Monitor.OpenTelemetry.Exporter; using Azure.Monitor.OpenTelemetry.Exporter.Internals.Platform; using Microsoft.Extensions.Configuration; @@ -28,6 +29,7 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore public static class OpenTelemetryBuilderExtensions { private const string SqlClientInstrumentationPackageName = "OpenTelemetry.Instrumentation.SqlClient"; + private const string EventLoggerName = "Azure.Monitor.OpenTelemetry.CustomEvents"; /// /// Configures Azure Monitor for logging, distributed tracing, and metrics. @@ -212,6 +214,34 @@ public static OpenTelemetryBuilder UseAzureMonitor(this OpenTelemetryBuilder bui } }); + // Enable custom events and set filter to enable collection. + builder.Services.TryAddSingleton(); + + // The default behavior is to always capture logs for custom events. + // This can achieved with this code level filter -> loggingBuilder.AddFilter("",LogLevel.Information); + // However, this may run into issues when users try to override this behavior from Configuration like below using appsettings.json: + // { + // "Logging": { + // "OpenTelemetry": { + // "LogLevel": { + // "Azure.Monitor.OpenTelemetry.CustomEvents": "None" + // } + // } + // }, + // ... + // } + // The reason is as both rules will match the filter, the last one added wins. + // To ensure that the default filter is in the beginning of filter rules, so that user override from Configuration will always win, + // we add code filter rule to the 0th position as below. + builder.Services.Configure( + options => options.Rules.Insert( + 0, + new LoggerFilterRule( + "OpenTelemetry", + EventLoggerName, + LogLevel.Information, + null))); + return builder; } diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs index 773abfebf60bb..c2c5fd0e6e786 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs @@ -22,11 +22,7 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore.Tests { public class AzureSdkLoggingTests { -#if NET6_0 - [ConditionallySkipOSTheory(platformToSkip: "macos", reason: "This test consistently exceeds 1 hour runtime limit when running on MacOS & Net60")] -#else - [Theory] -#endif + [Theory(Skip = "Test is unstable and need to be re-written without the need to create a web server.")] [InlineData(false, LogLevel.Debug, null)] [InlineData(false, LogLevel.Information, null)] [InlineData(false, LogLevel.Warning, "TestWarningEvent: hello")] @@ -62,11 +58,7 @@ public async Task DistroLogForwarderIsAdded(bool addLoggingFilter, LogLevel even } } -#if NET6_0 - [ConditionallySkipOSTheory(platformToSkip: "macos", reason: "This test consistently exceeds 1 hour runtime limit when running on MacOS & Net60")] -#else - [Theory] -#endif + [Theory(Skip = "Test is unstable and need to be re-written without the need to create a web server.")] [InlineData(LogLevel.Information, "TestInfoEvent: hello")] [InlineData(LogLevel.Warning, "TestWarningEvent: hello")] [InlineData(LogLevel.Debug, null)] @@ -103,11 +95,7 @@ public async Task PublicLogForwarderIsAdded(LogLevel eventLevel, string expected } } -#if NET6_0 - [ConditionallySkipOSFact(platformToSkip: "macos", reason: "This test consistently exceeds 1 hour runtime limit when running on MacOS & Net60")] -#else - [Fact] -#endif + [Fact(Skip = "Test is unstable and need to be re-written without the need to create a web server.")] public async Task SelfDiagnosticsIsDisabled() { var enableLevel = LogLevel.Debug; @@ -148,11 +136,7 @@ public async Task SelfDiagnosticsIsDisabled() Assert.False(logAzureFilterCalled); } -#if NET6_0 - [ConditionallySkipOSFact(platformToSkip: "macos", reason: "This test consistently exceeds 1 hour runtime limit when running on MacOS & Net60")] -#else - [Fact] -#endif + [Fact(Skip = "Test is unstable and need to be re-written without the need to create a web server.")] public async Task DistroLogForwarderAppliesWildCardFilter() { var builder = WebApplication.CreateBuilder(); @@ -173,11 +157,7 @@ public async Task DistroLogForwarderAppliesWildCardFilter() await AssertContentContains(transport.Requests.Single(), "TestWarningEvent: hello", LogLevel.Warning); } -#if NET6_0 - [ConditionallySkipOSFact(platformToSkip: "macos", reason: "This test consistently exceeds 1 hour runtime limit when running on MacOS & Net60")] -#else - [Fact] -#endif + [Fact(Skip = "Test is unstable and need to be re-written without the need to create a web server.")] public async Task SettingCustomLoggingFilterResetsDefaultWarningLevel() { var builder = WebApplication.CreateBuilder(); @@ -213,11 +193,7 @@ public async Task SettingCustomLoggingFilterResetsDefaultWarningLevel() await AssertContentContains(transport.Requests.Single(), "TestInfoEvent: hello two", LogLevel.Information); } -#if NET6_0 - [ConditionallySkipOSFact(platformToSkip: "macos", reason: "This test consistently exceeds 1 hour runtime limit when running on MacOS & Net60")] -#else - [Fact] -#endif + [Fact(Skip = "Test is unstable and need to be re-written without the need to create a web server.")] public async Task CustomLoggingFilterOverridesDefaultWarningAndCapturesErrorLogs() { var builder = WebApplication.CreateBuilder(); diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/E2ETests/ILoggerTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/E2ETests/ILoggerTests.cs new file mode 100644 index 0000000000000..c6b5368c5f5d3 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/E2ETests/ILoggerTests.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#if !NETFRAMEWORK +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using Azure.Monitor.OpenTelemetry.Events; +using Azure.Monitor.OpenTelemetry.Exporter.Models; +using Azure.Monitor.OpenTelemetry.Exporter.Tests.CommonTestFramework; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.AspNetCore.TestHost; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using OpenTelemetry.Logs; +using OpenTelemetry.Trace; +using Xunit; +using Xunit.Abstractions; + +namespace Azure.Monitor.OpenTelemetry.AspNetCore.Tests.E2ETests +{ + public partial class ILoggerTests + : IClassFixture>, IDisposable + { + private readonly WebApplicationFactory _factory; + private readonly TelemetryItemOutputHelper _telemetryOutput; + + public ILoggerTests(WebApplicationFactory factory, ITestOutputHelper output) + { + _factory = factory; + _telemetryOutput = new TelemetryItemOutputHelper(output); + } + + [Fact] + public void CustomEventsAreCapturedCorrectly() + { + // SETUP MOCK TRANSMITTER TO CAPTURE AZURE MONITOR TELEMETRY + var testConnectionString = $"InstrumentationKey=unitTest-{nameof(CustomEventsAreCapturedCorrectly)}"; + var telemetryItems = new List(); + var mockTransmitter = new Exporter.Tests.CommonTestFramework.MockTransmitter(telemetryItems); + // The TransmitterFactory is invoked by the Exporter during initialization to ensure that there's only one instance of a transmitter/connectionString shared by all Exporters. + // Here we're setting that instance to use the MockTransmitter so this test can capture telemetry before it's sent to Azure Monitor. + Exporter.Internals.TransmitterFactory.Instance.Set(connectionString: testConnectionString, transmitter: mockTransmitter); + + // SETUP WEBAPPLICATIONFACTORY WITH OPENTELEMETRY + using (var client = _factory + .WithWebHostBuilder(builder => + { + builder.ConfigureLogging(loggingBuilder => loggingBuilder.ClearProviders()); + builder.ConfigureTestServices(serviceCollection => + { + serviceCollection.AddOpenTelemetry() + .UseAzureMonitor(x => + { + x.EnableLiveMetrics = false; + x.ConnectionString = testConnectionString; + }); + }); + + builder.Configure(app => + { + app.UseRouting(); + + app.UseEndpoints(endpoints => + { + endpoints.MapGet("/", (IApplicationInsightsEventLogger CustomEventLogger) => + { + CustomEventLogger.TrackEvent("TestCustomEvent"); + }); + }); + }); + }) + .CreateClient()) + { + // Act + try + { + using var response = client.GetAsync("/").Result; + } + catch + { + // Ignore exceptions + } + } + + // SHUTDOWN + var loggerProvider = _factory.Factories.Last().Services.GetRequiredService(); + loggerProvider.ForceFlush(); + + // ASSERT + _telemetryOutput.Write(telemetryItems); + Assert.True(telemetryItems.Any(), "Unit test failed to collect telemetry."); + var telemetryItem = telemetryItems.Where(x => x.Name == "Event").Single(); + var eventData = (TelemetryEventData)(telemetryItem.Data.BaseData); + Assert.Equal("TestCustomEvent", eventData.Name); + } + + [Fact] + public void IloggerFilterCanBeAppliedToCustomEvent() + { + // SETUP MOCK TRANSMITTER TO CAPTURE AZURE MONITOR TELEMETRY + var testConnectionString = $"InstrumentationKey=unitTest-{nameof(CustomEventsAreCapturedCorrectly)}"; + var telemetryItems = new List(); + var mockTransmitter = new Exporter.Tests.CommonTestFramework.MockTransmitter(telemetryItems); + // The TransmitterFactory is invoked by the Exporter during initialization to ensure that there's only one instance of a transmitter/connectionString shared by all Exporters. + // Here we're setting that instance to use the MockTransmitter so this test can capture telemetry before it's sent to Azure Monitor. + Exporter.Internals.TransmitterFactory.Instance.Set(connectionString: testConnectionString, transmitter: mockTransmitter); + + // SETUP WEBAPPLICATIONFACTORY WITH OPENTELEMETRY + using (var client = _factory + .WithWebHostBuilder(builder => + { + builder.ConfigureLogging(loggingBuilder => + { + loggingBuilder.ClearProviders(); + + // Filter out custom events. + loggingBuilder.AddFilter("Azure.Monitor.OpenTelemetry.CustomEvents", LogLevel.None); + }); + builder.ConfigureTestServices(serviceCollection => + { + serviceCollection.AddOpenTelemetry() + .UseAzureMonitor(x => + { + x.EnableLiveMetrics = false; + x.ConnectionString = testConnectionString; + }); + }); + + builder.Configure(app => + { + app.UseRouting(); + + app.UseEndpoints(endpoints => + { + endpoints.MapGet("/", (IApplicationInsightsEventLogger CustomEventLogger) => + { + CustomEventLogger.TrackEvent("TestCustomEvent"); + }); + }); + }); + }) + .CreateClient()) + { + // Act + try + { + using var response = client.GetAsync("/").Result; + } + catch + { + // Ignore exceptions + } + } + + // SHUTDOWN + var loggerProvider = _factory.Factories.Last().Services.GetRequiredService(); + loggerProvider.ForceFlush(); + + // ASSERT + _telemetryOutput.Write(telemetryItems); + + // Internal Asp.NetCore logging. + Assert.NotNull(telemetryItems); + + var traceTelemetry = telemetryItems.Where(x => x.Name == "Message").FirstOrDefault(); + Assert.NotNull(traceTelemetry); + + // Custom event should not be collected. + var eventTelemetry = telemetryItems.Where(x => x.Name == "Event").FirstOrDefault(); + Assert.Null(eventTelemetry); + } + + public void Dispose() + { + // OpenTelemetry is registered on a nested Factory which is not disposed between test runs! + // MUST explicitly dispose the nested Factory to avoid test conflicts. + _factory.Factories.Last().Dispose(); + + _factory.Dispose(); + } + } +} +#endif diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.net6.0.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.net6.0.cs index 43332b65beaff..5ce7a8e922bff 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.net6.0.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.net6.0.cs @@ -1,3 +1,15 @@ +namespace Azure.Monitor.OpenTelemetry.Events +{ + public sealed partial class ApplicationInsightsEventLogger : Azure.Monitor.OpenTelemetry.Events.IApplicationInsightsEventLogger + { + public ApplicationInsightsEventLogger(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) { } + public void TrackEvent(string name, System.Collections.Generic.IReadOnlyList>? attributes = null) { } + } + public partial interface IApplicationInsightsEventLogger + { + void TrackEvent(string name, System.Collections.Generic.IReadOnlyList>? attributes = null); + } +} namespace Azure.Monitor.OpenTelemetry.Exporter { public static partial class AzureMonitorExporterExtensions diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.netstandard2.0.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.netstandard2.0.cs index 43332b65beaff..5ce7a8e922bff 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.netstandard2.0.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.netstandard2.0.cs @@ -1,3 +1,15 @@ +namespace Azure.Monitor.OpenTelemetry.Events +{ + public sealed partial class ApplicationInsightsEventLogger : Azure.Monitor.OpenTelemetry.Events.IApplicationInsightsEventLogger + { + public ApplicationInsightsEventLogger(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) { } + public void TrackEvent(string name, System.Collections.Generic.IReadOnlyList>? attributes = null) { } + } + public partial interface IApplicationInsightsEventLogger + { + void TrackEvent(string name, System.Collections.Generic.IReadOnlyList>? attributes = null); + } +} namespace Azure.Monitor.OpenTelemetry.Exporter { public static partial class AzureMonitorExporterExtensions diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/ApplicationInsightsEventLogger.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/ApplicationInsightsEventLogger.cs new file mode 100644 index 0000000000000..26bb5164f0885 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/ApplicationInsightsEventLogger.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using Microsoft.Extensions.Logging; + +namespace Azure.Monitor.OpenTelemetry.Events +{ + /// + /// Default logger for logging Application Insights custom events. + /// + public sealed class ApplicationInsightsEventLogger : IApplicationInsightsEventLogger + { + private const string EventLoggerName = "Azure.Monitor.OpenTelemetry.CustomEvents"; + private static readonly Func>?, Exception?, string> s_formatter = (state, ex) => + { + return "Application Insights Custom Event"; + }; + + private readonly ILogger _logger; + + /// + /// Creates an instance of CustomEventLogger to log custom events. + /// + /// LoggerFactory instance for logging events. + /// + public ApplicationInsightsEventLogger(ILoggerFactory loggerFactory) + { + if (loggerFactory == null) + throw new ArgumentNullException(nameof(loggerFactory)); + + _logger = loggerFactory.CreateLogger(EventLoggerName); + } + + // TODO: Follow up to check if nullables are ok. + /// + public void TrackEvent(string name, IReadOnlyList>? attributes = null) + { + _logger.Log(LogLevel.Information, eventId: new EventId(1, name), attributes, exception: null, formatter: s_formatter); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/IApplicationInsightsEventLogger.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/IApplicationInsightsEventLogger.cs new file mode 100644 index 0000000000000..85be24b791e52 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/IApplicationInsightsEventLogger.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.Events +{ + /// + /// An interface for logging custom events telemetry. + /// + public interface IApplicationInsightsEventLogger + { + /// + /// Tracks Application Insights custom events. + /// + /// Name of the CustomEvent. + /// Custom dimensions of the event. + public void TrackEvent(string name, IReadOnlyList>? attributes = null); + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryEventData.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryEventData.cs new file mode 100644 index 0000000000000..8c2a632ebeefc --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryEventData.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using OpenTelemetry.Logs; + +namespace Azure.Monitor.OpenTelemetry.Exporter.Models +{ + internal partial class TelemetryEventData + { + public TelemetryEventData(int version, LogRecord logRecord) : base(version) + { + Properties = new ChangeTrackingDictionary(); + Measurements = new ChangeTrackingDictionary(); + + Name = logRecord.EventId.Name; + + if (logRecord.Attributes != null) + { + foreach (var kv in logRecord.Attributes) + { + Properties.Add(kv.Key, kv.Value?.ToString()); + } + } + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryItem.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryItem.cs index e6fadd8f6986f..c02c464f0b9b3 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryItem.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryItem.cs @@ -91,8 +91,8 @@ public TelemetryItem(string name, TelemetryItem telemetryItem, ActivitySpanId ac } } - public TelemetryItem (LogRecord logRecord, AzureMonitorResource? resource, string instrumentationKey) : - this(logRecord.Exception != null ? "Exception" : "Message", FormatUtcTimestamp(logRecord.Timestamp)) + public TelemetryItem (string name, LogRecord logRecord, AzureMonitorResource? resource, string instrumentationKey) : + this(name, FormatUtcTimestamp(logRecord.Timestamp)) { if (logRecord.TraceId != default) { diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/LogsHelper.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/LogsHelper.cs index 26b05b6e7beca..927837c9e6d5e 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/LogsHelper.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/LogsHelper.cs @@ -56,17 +56,27 @@ internal static List OtelToAzureMonitorLogs(Batch batc { try { - telemetryItem = new TelemetryItem(logRecord, resource, instrumentationKey); if (logRecord.Exception != null) { + telemetryItem = new TelemetryItem("Exception", logRecord, resource, instrumentationKey); telemetryItem.Data = new MonitorBase { BaseType = "ExceptionData", BaseData = new TelemetryExceptionData(Version, logRecord), }; } + else if (logRecord.CategoryName == "Azure.Monitor.OpenTelemetry.CustomEvents") + { + telemetryItem = new TelemetryItem("Event", logRecord, resource, instrumentationKey); + telemetryItem.Data = new MonitorBase + { + BaseType = "EventData", + BaseData = new TelemetryEventData(Version, logRecord), + }; + } else { + telemetryItem = new TelemetryItem("Message", logRecord, resource, instrumentationKey); telemetryItem.Data = new MonitorBase { BaseType = "MessageData", diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/CommonTestFramework/TelemetryItemOutputHelper.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/CommonTestFramework/TelemetryItemOutputHelper.cs index 1d00594ee09ed..d8adb65abbabf 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/CommonTestFramework/TelemetryItemOutputHelper.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/CommonTestFramework/TelemetryItemOutputHelper.cs @@ -70,12 +70,26 @@ private void WriteBaseData(TelemetryItem telemetryItem) case "ExceptionData": WriteExceptionData((TelemetryExceptionData)baseData); break; + case "EventData": + WriteEventData((TelemetryEventData)baseData); + break; default: output.WriteLine($"***WriteBaseData not implemented for '{baseType}'***"); break; } } + private void WriteEventData(TelemetryEventData eventData) + { + output.WriteLine($"Name: {eventData.Name}"); + + output.WriteLine($"Properties: {eventData.Properties.Count}"); + foreach (var prop in eventData.Properties) + { + output.WriteLine($"\t{prop.Key}: {prop.Value}"); + } + } + private void WriteExceptionData(TelemetryExceptionData exceptionData) { output.WriteLine($"SeverityLevel: {exceptionData.SeverityLevel}"); diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/LogsHelperTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/LogsHelperTests.cs index 87bbbc96535ef..861b2b5c57875 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/LogsHelperTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/LogsHelperTests.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using Azure.Core; +using Azure.Monitor.OpenTelemetry.Events; using Azure.Monitor.OpenTelemetry.Exporter.Internals; using Azure.Monitor.OpenTelemetry.Exporter.Models; @@ -544,6 +545,45 @@ public void DuplicateKeysInLogRecordAttributesAndLogScope2() Assert.Equal(duplicateScopeValue2, actualScopeValue); } + [Fact] + public void ValidateCustomEvent() + { + // Arrange. + var logRecords = new List(1); + using var loggerFactory = LoggerFactory.Create(builder => + { + builder.AddOpenTelemetry(options => + { + options.AddInMemoryExporter(logRecords); + }); + }); + + var eventLogger = new ApplicationInsightsEventLogger(loggerFactory); + + var attributesList = new List> + { + new KeyValuePair("customEventKey", "customEventValue") + }; + + eventLogger.TrackEvent("MyCustomEvent", attributesList); + + // Assert. + var logRecord = logRecords.Single(); + var logRecodBatch = new Batch(new[] { logRecord } , 1); + var properties = new ChangeTrackingDictionary(); + var telemetryItems = LogsHelper.OtelToAzureMonitorLogs(logRecodBatch, null, "Ikey"); + + var telemetryItem = telemetryItems.FirstOrDefault(); + var telemetryEventData = telemetryItem?.Data.BaseData as TelemetryEventData; + + Assert.NotNull(telemetryEventData); + Assert.Equal("MyCustomEvent", telemetryEventData.Name); + Assert.Single(telemetryEventData.Properties); + var property = telemetryEventData.Properties.Single(); + Assert.Equal("customEventKey", property.Key); + Assert.Equal("customEventValue", property.Value); + } + private class CustomObject { public override string ToString() From 8a1e79b818cfa7fecffc0568d919e93d4d9fa435 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 23 Aug 2024 17:17:30 -0700 Subject: [PATCH 21/71] Allow Save-package-properties to exit 0 when prs produce no package changes (#45664) Co-authored-by: Patrick Hallisey --- .../scripts/Save-Package-Properties.ps1 | 87 ++++++++++--------- 1 file changed, 47 insertions(+), 40 deletions(-) diff --git a/eng/common/scripts/Save-Package-Properties.ps1 b/eng/common/scripts/Save-Package-Properties.ps1 index c234d8b28ede4..1922da5adff48 100644 --- a/eng/common/scripts/Save-Package-Properties.ps1 +++ b/eng/common/scripts/Save-Package-Properties.ps1 @@ -99,56 +99,63 @@ $exportedPaths = @{} $allPackageProperties = @() if ($prDiff) { + Write-Host "Getting package properties for PR diff file: $prDiff" $allPackageProperties = Get-PrPkgProperties $prDiff + + if (!$allPackageProperties) { + Write-Host "No packages found matching PR diff file $prDiff" + Write-Host "Setting NoPackagesChanged variable to true" + Write-Host "##vso[task.setvariable variable=NoPackagesChanged]true" + exit 0 + } } else { + Write-Host "Getting package properties for service directory: $serviceDirectory" $allPackageProperties = Get-AllPkgProperties $serviceDirectory + + if (!$allPackageProperties) { + Write-Error "Package properties are not available for service directory $serviceDirectory" + exit 1 + } +} + +if (-not (Test-Path -Path $outDirectory)) +{ + New-Item -ItemType Directory -Force -Path $outDirectory | Out-Null } -if ($allPackageProperties) +foreach($pkg in $allPackageProperties) { - if (-not (Test-Path -Path $outDirectory)) + if ($pkg.Name) { + Write-Host "Package Name: $($pkg.Name)" + Write-Host "Package Version: $($pkg.Version)" + Write-Host "Package SDK Type: $($pkg.SdkType)" + Write-Host "Artifact Name: $($pkg.ArtifactName)" + Write-Host "Release date: $($pkg.ReleaseStatus)" + $configFilePrefix = $pkg.Name + if ($pkg.ArtifactName) { - New-Item -ItemType Directory -Force -Path $outDirectory + $configFilePrefix = $pkg.ArtifactName } - foreach($pkg in $allPackageProperties) + $outputPath = Join-Path -Path $outDirectory "$configFilePrefix.json" + Write-Host "Output path of json file: $outputPath" + $outDir = Split-Path $outputPath -parent + if (-not (Test-Path -path $outDir)) { - if ($pkg.Name) { - Write-Host "Package Name: $($pkg.Name)" - Write-Host "Package Version: $($pkg.Version)" - Write-Host "Package SDK Type: $($pkg.SdkType)" - Write-Host "Artifact Name: $($pkg.ArtifactName)" - Write-Host "Release date: $($pkg.ReleaseStatus)" - $configFilePrefix = $pkg.Name - if ($pkg.ArtifactName) - { - $configFilePrefix = $pkg.ArtifactName - } - $outputPath = Join-Path -Path $outDirectory "$configFilePrefix.json" - Write-Host "Output path of json file: $outputPath" - $outDir = Split-Path $outputPath -parent - if (-not (Test-Path -path $outDir)) - { - Write-Host "Creating directory $($outDir) for json property file" - New-Item -ItemType Directory -Path $outDir - } - - # If package properties for a track 2 (IsNewSdk = true) package has - # already been written, skip writing to that same path. - if ($exportedPaths.ContainsKey($outputPath) -and $exportedPaths[$outputPath].IsNewSdk -eq $true) { - Write-Host "Track 2 package info with file name $($outputPath) already exported. Skipping export." - continue - } - $exportedPaths[$outputPath] = $pkg - - SetOutput $outputPath $pkg - } + Write-Host "Creating directory $($outDir) for json property file" + New-Item -ItemType Directory -Path $outDir | Out-Null } - Get-ChildItem -Path $outDirectory -} -else -{ - Write-Error "Package properties are not available for service directory $serviceDirectory or $prdiff" - exit 1 + # If package properties for a track 2 (IsNewSdk = true) package has + # already been written, skip writing to that same path. + if ($exportedPaths.ContainsKey($outputPath) -and $exportedPaths[$outputPath].IsNewSdk -eq $true) { + Write-Host "Track 2 package info with file name $($outputPath) already exported. Skipping export." + continue + } + $exportedPaths[$outputPath] = $pkg + + SetOutput $outputPath $pkg + } } + +Get-ChildItem -Path $outDirectory From a54f81543f4e6a7a2c5b20591aa5226e399b9393 Mon Sep 17 00:00:00 2001 From: Ralph <18542438+ralph-msft@users.noreply.github.com> Date: Fri, 23 Aug 2024 19:59:10 -0700 Subject: [PATCH 22/71] Azure OpenAI: 2.0.0-beta.3 updates (#45479) Updated to use the latest OpenAI library. Also includes the following changes: - Moved to the latest 2024-07-01-preview service version for Azure OpenAI - Updated test recordings --------- Co-authored-by: Jose Arriaga Maldonado <45773732+joseharriaga@users.noreply.github.com> Co-authored-by: Travis Wilson --- sdk/openai/{Azure.AI.OpenAI => }/.gitignore | 2 + .../Azure.AI.OpenAI.Assistants/.gitignore | 4 - sdk/openai/Azure.AI.OpenAI/CHANGELOG.md | 24 +- .../Azure.AI.OpenAI/Directory.Build.props | 15 ++ sdk/openai/Azure.AI.OpenAI/README.md | 6 +- .../api/Azure.AI.OpenAI.netstandard2.0.cs | 13 +- sdk/openai/Azure.AI.OpenAI/assets.json | 2 +- .../src/Azure.AI.OpenAI.csproj | 47 +++- .../AzureAssistantClient.Protocol.cs | 78 +++--- .../Custom/Assistants/AzureAssistantClient.cs | 11 +- .../AzureAssistantsPageEnumerator.cs | 49 ++++ .../Pagination/AzureMessagesPageEnumerator.cs | 52 ++++ .../Pagination/AzureRunStepsPageEnumerator.cs | 54 ++++ .../Pagination/AzureRunsPageEnumerator.cs | 51 ++++ .../src/Custom/Audio/AzureAudioClient.cs | 12 +- .../src/Custom/AzureOpenAIClient.cs | 235 ++++++++---------- .../src/Custom/AzureOpenAIClientOptions.cs | 5 +- .../src/Custom/Batch/AzureBatchClient.cs | 13 +- .../src/Custom/Chat/AzureChatClient.cs | 18 +- .../src/Custom/Chat/AzureChatCompletion.cs | 6 +- .../Custom/Chat/AzureChatCompletionOptions.cs | 10 +- .../AzureStreamingChatCompletionUpdate.cs | 6 +- .../src/Custom/Chat/GeneratorStubs.cs | 4 +- .../Custom/Chat/Internal/GeneratorStubs.cs | 1 + ...urce.cs => AzureCosmosDBChatDataSource.cs} | 17 +- ...zureMachineLearningIndexChatDataSource.cs} | 17 +- .../OnYourData/AzureSearchChatDataSource.cs | 17 +- .../OnYourData/ElasticsearchChatDataSource.cs | 18 +- .../Chat/OnYourData/PineconeChatDataSource.cs | 17 +- .../src/Custom/Common/GeneratorStubs.cs | 2 +- .../Custom/Common/PageableResultHelpers.cs | 93 ------- .../Custom/Embeddings/AzureEmbeddingClient.cs | 12 +- .../Custom/Files/AzureFileClient.Protocol.cs | 1 - .../src/Custom/Files/AzureFileClient.cs | 10 +- .../FineTuning/AzureFineTuningClient.cs | 10 +- .../src/Custom/Images/AzureGeneratedImage.cs | 4 +- .../src/Custom/Images/AzureImageClient.cs | 12 +- .../src/Custom/Internal/GeneratorStubs.cs | 4 +- .../AzureVectorStoreClient.Protocol.cs | 76 ++---- .../VectorStores/AzureVectorStoreClient.cs | 10 +- ...ureVectorStoreFileBatchesPageEnumerator.cs | 54 ++++ .../AzureVectorStoreFilesPageEnumerator.cs | 53 ++++ .../AzureVectorStoresPageEnumerator.cs | 47 ++++ .../AzureChatCitation.Serialization.cs | 24 +- .../src/Generated/AzureChatCitation.cs | 5 +- .../AzureChatDataSource.Serialization.cs | 15 +- .../src/Generated/AzureChatDataSource.cs | 5 +- .../AzureChatMessageContext.Serialization.cs | 15 +- .../src/Generated/AzureChatMessageContext.cs | 5 +- ...zureChatRetrievedDocument.Serialization.cs | 60 +++-- .../Generated/AzureChatRetrievedDocument.cs | 9 +- .../AzureChatRetrievedDocumentFilterReason.cs | 4 +- ...ureCosmosDBChatDataSource.Serialization.cs | 23 +- .../Generated/AzureCosmosDBChatDataSource.cs | 10 - ...arningIndexChatDataSource.Serialization.cs | 23 +- ...AzureMachineLearningIndexChatDataSource.cs | 10 - .../AzureOpenAIChatError.Serialization.cs | 19 +- .../src/Generated/AzureOpenAIChatError.cs | 5 +- ...reOpenAIChatErrorResponse.Serialization.cs | 11 +- .../Generated/AzureOpenAIChatErrorResponse.cs | 5 +- .../AzureOpenAIDalleError.Serialization.cs | 19 +- .../src/Generated/AzureOpenAIDalleError.cs | 5 +- ...eOpenAIDalleErrorResponse.Serialization.cs | 11 +- .../AzureOpenAIDalleErrorResponse.cs | 5 +- ...AzureSearchChatDataSource.Serialization.cs | 23 +- .../Generated/AzureSearchChatDataSource.cs | 10 - ...tentFilterBlocklistResult.Serialization.cs | 18 +- .../Generated/ContentFilterBlocklistResult.cs | 5 +- ...tentFilterDetectionResult.Serialization.cs | 23 +- .../Generated/ContentFilterDetectionResult.cs | 5 +- ...tectedMaterialCitedResult.Serialization.cs | 13 +- ...ntentFilterProtectedMaterialCitedResult.cs | 5 +- ...erProtectedMaterialResult.Serialization.cs | 25 +- .../ContentFilterProtectedMaterialResult.cs | 5 +- ...tentFilterResultForPrompt.Serialization.cs | 12 +- .../Generated/ContentFilterResultForPrompt.cs | 5 +- ...ntFilterResultForResponse.Serialization.cs | 27 +- .../ContentFilterResultForResponse.cs | 5 +- .../src/Generated/ContentFilterSeverity.cs | 4 +- ...ntentFilterSeverityResult.Serialization.cs | 23 +- .../Generated/ContentFilterSeverityResult.cs | 5 +- .../DataSourceAuthentication.Serialization.cs | 15 +- .../src/Generated/DataSourceAuthentication.cs | 9 +- .../DataSourceFieldMappings.Serialization.cs | 23 +- .../src/Generated/DataSourceFieldMappings.cs | 4 +- .../src/Generated/DataSourceQueryType.cs | 4 +- .../DataSourceVectorizer.Serialization.cs | 15 +- .../src/Generated/DataSourceVectorizer.cs | 5 +- ...asticsearchChatDataSource.Serialization.cs | 23 +- .../Generated/ElasticsearchChatDataSource.cs | 10 - ...tentFilterResultForPrompt.Serialization.cs | 28 ++- ...ntFilterResultForResponse.Serialization.cs | 17 +- .../ImageContentFilterResultForResponse.cs | 5 +- .../Generated/Internal/BinaryContentHelper.cs | 14 ++ .../Generated/Internal/ClientUriBuilder.cs | 6 +- .../Internal/ModelSerializationExtensions.cs | 8 + ...okenAuthenticationOptions.Serialization.cs | 23 +- ...aSourceAccessTokenAuthenticationOptions.cs | 2 +- ...iKeyAuthenticationOptions.Serialization.cs | 23 +- ...atDataSourceApiKeyAuthenticationOptions.cs | 2 +- ...ringAuthenticationOptions.Serialization.cs | 23 +- ...ceConnectionStringAuthenticationOptions.cs | 2 +- ...ntNameVectorizationSource.Serialization.cs | 25 +- ...iKeyAuthenticationOptions.Serialization.cs | 23 +- ...ourceEncodedApiKeyAuthenticationOptions.cs | 2 +- ...dpointVectorizationSource.Serialization.cs | 32 ++- ...eyIdAuthenticationOptions.Serialization.cs | 30 ++- ...aSourceKeyAndKeyIdAuthenticationOptions.cs | 2 +- ...odelIdVectorizationSource.Serialization.cs | 23 +- ...tityAuthenticationOptions.Serialization.cs | 16 +- ...nedManagedIdentityAuthenticationOptions.cs | 2 +- ...tityAuthenticationOptions.Serialization.cs | 23 +- ...nedManagedIdentityAuthenticationOptions.cs | 2 +- ...ntFilterBlocklistIdResult.Serialization.cs | 23 +- ...rnalAzureContentFilterBlocklistIdResult.cs | 5 +- ...lterBlocklistResultDetail.Serialization.cs | 23 +- ...AzureContentFilterBlocklistResultDetail.cs | 5 +- ...romptContentFilterResults.Serialization.cs | 37 ++- ...lterResultForPromptContentFilterResults.cs | 5 +- ...ContentFilterResultsError.Serialization.cs | 23 +- ...esultForPromptContentFilterResultsError.cs | 5 +- ...BChatDataSourceParameters.Serialization.cs | 65 +++-- ...alAzureCosmosDBChatDataSourceParameters.cs | 5 +- ...xChatDataSourceParameters.Serialization.cs | 53 ++-- ...neLearningIndexChatDataSourceParameters.cs | 5 +- ...OpenAIChatErrorInnerError.Serialization.cs | 25 +- .../InternalAzureOpenAIChatErrorInnerError.cs | 9 +- ...ernalAzureOpenAIChatErrorInnerErrorCode.cs | 2 +- ...penAIDalleErrorInnerError.Serialization.cs | 25 +- ...InternalAzureOpenAIDalleErrorInnerError.cs | 9 +- ...rnalAzureOpenAIDalleErrorInnerErrorCode.cs | 2 +- ...hChatDataSourceParameters.Serialization.cs | 54 ++-- ...rnalAzureSearchChatDataSourceParameters.cs | 5 +- ...hChatDataSourceParametersIncludeContext.cs | 52 ++++ ...hChatDataSourceParameters.Serialization.cs | 50 ++-- ...alElasticsearchChatDataSourceParameters.cs | 5 +- ...eChatDataSourceParameters.Serialization.cs | 58 +++-- ...nternalPineconeChatDataSourceParameters.cs | 5 +- ...nknownAzureChatDataSource.Serialization.cs | 16 +- ...urceAuthenticationOptions.Serialization.cs | 16 +- ...zureChatDataSourceAuthenticationOptions.cs | 2 +- ...SourceVectorizationSource.Serialization.cs | 16 +- .../PineconeChatDataSource.Serialization.cs | 23 +- .../src/Generated/PineconeChatDataSource.cs | 10 - .../AzureOpenAIPipelineMessageBuilder.cs | 15 ++ .../src/Utility/CustomSerializationHelpers.cs | 131 ++++++++++ .../Utility/GenericActionPipelinePolicy.cs | 18 +- .../Azure.AI.OpenAI/tests/AssistantTests.cs | 47 ++-- .../tests/Azure.AI.OpenAI.Tests.csproj | 9 + .../tests/ChatTests.Functions.cs | 2 +- .../Azure.AI.OpenAI/tests/ChatTests.Tools.cs | 2 +- .../Azure.AI.OpenAI/tests/ChatTests.Vision.cs | 2 +- sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs | 6 +- sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs | 2 +- .../Azure.AI.OpenAI/tests/ImageTests.cs | 4 +- .../Azure.AI.OpenAI/tests/Samples/01_Chat.cs | 2 +- .../tests/Utils/AoaiTestBase.cs | 31 ++- .../tests/Utils/Config/JsonConfig.cs | 1 + .../tests/Utils/Pipeline/ProxyTransport.cs | 4 +- .../Utils/SyncToAsyncCollectionResult.cs | 88 +++++++ .../tests/Utils/SyncToAsyncPageCollection.cs | 73 ++++++ .../Utils/SyncToAsyncPageableCollection.cs | 75 ------ .../Utils/SyncToAsyncResultCollection.cs | 63 ----- .../Azure.AI.OpenAI/tests/Utils/TestConfig.cs | 4 +- .../Azure.AI.OpenAI/tests/VectorStoreTests.cs | 16 +- 165 files changed, 2161 insertions(+), 1206 deletions(-) rename sdk/openai/{Azure.AI.OpenAI => }/.gitignore (74%) delete mode 100644 sdk/openai/Azure.AI.OpenAI.Assistants/.gitignore create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureAssistantsPageEnumerator.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureMessagesPageEnumerator.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunStepsPageEnumerator.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunsPageEnumerator.cs rename sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/{AzureCosmosDBDataSource.cs => AzureCosmosDBChatDataSource.cs} (84%) rename sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/{AzureMachineLearningChatDataSource.cs => AzureMachineLearningIndexChatDataSource.cs} (83%) delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Custom/Common/PageableResultHelpers.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFileBatchesPageEnumerator.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFilesPageEnumerator.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoresPageEnumerator.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Utility/CustomSerializationHelpers.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncCollectionResult.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageCollection.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageableCollection.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncResultCollection.cs diff --git a/sdk/openai/Azure.AI.OpenAI/.gitignore b/sdk/openai/.gitignore similarity index 74% rename from sdk/openai/Azure.AI.OpenAI/.gitignore rename to sdk/openai/.gitignore index 852a4791f1ab0..ecc762b5c51bf 100644 --- a/sdk/openai/Azure.AI.OpenAI/.gitignore +++ b/sdk/openai/.gitignore @@ -1,4 +1,6 @@ package-lock.json TempTypeSpecFiles/ +tests/SessionRecords +external/ **/Generated/cadl.json **/Generated/configuration.json \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI.Assistants/.gitignore b/sdk/openai/Azure.AI.OpenAI.Assistants/.gitignore deleted file mode 100644 index 5ff7b673e6450..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI.Assistants/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -package-lock.json -TempTypeSpecFiles/ -tests/SessionRecords -**/Generated/configuration.json diff --git a/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md b/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md index 0a01e3c9e6290..972422632d617 100644 --- a/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md +++ b/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md @@ -1,13 +1,33 @@ # Release History -## 2.0.0-beta.3 (Unreleased) +## 2.0.0-beta.3 (2024-08-23) + +This change updates the library for compatibility with the latest `2.0.0-beta.9` of the `OpenAI` package and the `2024-07-01-preview` Azure OpenAI service API version label, as published on 8/5. ### Features Added - The library now directly supports alternative authentication audiences, including Azure Government. This can be specified by providing an appropriate `AzureOpenAIAudience` value to the `AzureOpenAIClientOptions.Audience` property when creating a client. See the client configuration section of the README for more details. +Additional new features from the `OpenAI` package can be found in [the OpenAI changelog](https://github.com/openai/openai-dotnet/blob/main/CHANGELOG.md). + +**Please note**: Structured Outputs support is not yet available with the `2024-07-01-preview` service API version. This means that attempting to use the feature with this library version will fail with an unrecognized property for either `response_format` or `strict` in request payloads; all existing functionality is unaffected. Azure OpenAI support for Structured Outputs is coming soon. + ### Breaking Changes +No Azure-specific breaking changes are present in this update. + +The update from `OpenAI` `2.0.0-beta.7` to `2.0.0-beta.9` does bring a number of breaking changes, however, as described in [the OpenAI changelog](https://github.com/openai/openai-dotnet/blob/main/CHANGELOG.md): + +- Removed client constructors that do not explicitly take an API key parameter or an endpoint via an `OpenAIClientOptions` parameter, making it clearer how to appropriately instantiate a client. ([13a9c68](https://github.com/openai/openai-dotnet/commit/13a9c68647c8d54475f1529a63b13ad711bd4ba6)) +- Removed the endpoint parameter from all client constructors, making it clearer that an alternative endpoint must be specified via the `OpenAIClientOptions` parameter. ([13a9c68](https://github.com/openai/openai-dotnet/commit/13a9c68647c8d54475f1529a63b13ad711bd4ba6)) +- Removed `OpenAIClient`'s `Endpoint` `protected` property. ([13a9c68](https://github.com/openai/openai-dotnet/commit/13a9c68647c8d54475f1529a63b13ad711bd4ba6)) +- Made `OpenAIClient`'s constructor that takes a `ClientPipeline` parameter `protected internal` instead of just `protected`. ([13a9c68](https://github.com/openai/openai-dotnet/commit/13a9c68647c8d54475f1529a63b13ad711bd4ba6)) +- Renamed the `User` property in applicable Options classes to `EndUserId`, making its purpose clearer. ([13a9c68](https://github.com/openai/openai-dotnet/commit/13a9c68647c8d54475f1529a63b13ad711bd4ba6)) +- Changed name of return types from methods returning streaming collections from `ResultCollection` to `CollectionResult`. ([7bdecfd](https://github.com/openai/openai-dotnet/commit/7bdecfd8d294be933c7779c7e5b6435ba8a8eab0)) +- Changed return types from methods returning paginated collections from `PageableCollection` to `PageCollection`. ([7bdecfd](https://github.com/openai/openai-dotnet/commit/7bdecfd8d294be933c7779c7e5b6435ba8a8eab0)) +- Users must now call `GetAllValues` on the collection of pages to enumerate collection items directly. Corresponding protocol methods return `IEnumerable` where each collection item represents a single service response holding a page of values. ([7bdecfd](https://github.com/openai/openai-dotnet/commit/7bdecfd8d294be933c7779c7e5b6435ba8a8eab0)) +- Updated `VectorStoreFileCounts` and `VectorStoreFileAssociationError` types from `readonly struct` to `class`. ([58f93c8](https://github.com/openai/openai-dotnet/commit/58f93c8d5ea080adfee8b37ae3cc034ebb06c79f)) + ### Bugs Fixed - Removed an inappropriate null check in `FileClient.GetFiles()` (azure-sdk-for-net 44912) @@ -16,7 +36,7 @@ - Automatic retry behavior will now honor header-based intervals from `Retry-After` and related response headers - The client will now originate an `x-ms-client-request-id` header to match prior library behavior and facilitate troubleshooting -### Other Changes +Additional, non-Azure-specific bug fixes can be found in [the OpenAI changelog](https://github.com/openai/openai-dotnet/blob/main/CHANGELOG.md). ## 2.0.0-beta.2 (2024-06-14) diff --git a/sdk/openai/Azure.AI.OpenAI/Directory.Build.props b/sdk/openai/Azure.AI.OpenAI/Directory.Build.props index 1a9611bd49242..34f0ec9782bf3 100644 --- a/sdk/openai/Azure.AI.OpenAI/Directory.Build.props +++ b/sdk/openai/Azure.AI.OpenAI/Directory.Build.props @@ -1,4 +1,19 @@  + + + + + diff --git a/sdk/openai/Azure.AI.OpenAI/README.md b/sdk/openai/Azure.AI.OpenAI/README.md index fd8b2bdb4eeaf..3a201aa890968 100644 --- a/sdk/openai/Azure.AI.OpenAI/README.md +++ b/sdk/openai/Azure.AI.OpenAI/README.md @@ -169,7 +169,7 @@ Console.WriteLine($"{completion.Role}: {completion.Content[0].Text}"); ### Stream chat messages -Streaming chat completions use the `CompleteChatStreaming` and `CompleteChatStreamingAsync` method, which return a `ResultCollection` or `AsyncResultCollection` instead of a `ClientResult`. These result collections can be iterated over using `foreach` or `await foreach`, with each update arriving as new data is available from the streamed response. +Streaming chat completions use the `CompleteChatStreaming` and `CompleteChatStreamingAsync` method, which return a `ResultCollection` or `AsyncCollectionResult` instead of a `ClientResult`. These result collections can be iterated over using `foreach` or `await foreach`, with each update arriving as new data is available from the streamed response. ```C# Snippet:StreamChatMessages AzureOpenAIClient azureClient = new( @@ -177,7 +177,7 @@ AzureOpenAIClient azureClient = new( new DefaultAzureCredential()); ChatClient chatClient = azureClient.GetChatClient("my-gpt-35-turbo-deployment"); -ResultCollection completionUpdates = chatClient.CompleteChatStreaming( +CollectionResult completionUpdates = chatClient.CompleteChatStreaming( [ new SystemChatMessage("You are a helpful assistant that talks like a pirate."), new UserChatMessage("Hi, can you help me?"), @@ -533,4 +533,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [email_opencode]: mailto:opencode@microsoft.com -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/openai/Azure.AI.OpenAI/README.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/openai/Azure.AI.OpenAI/README.png) \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs b/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs index b2d9b8d09ca6a..2a47a4534fee7 100644 --- a/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs +++ b/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs @@ -37,11 +37,13 @@ public static partial class AzureGeneratedImageExtensions public partial class AzureOpenAIClient : OpenAI.OpenAIClient { protected AzureOpenAIClient() { } - public AzureOpenAIClient(Azure.AI.OpenAI.AzureOpenAIClientOptions options = null) { } protected AzureOpenAIClient(System.ClientModel.Primitives.ClientPipeline pipeline, System.Uri endpoint, Azure.AI.OpenAI.AzureOpenAIClientOptions options) { } - public AzureOpenAIClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.OpenAI.AzureOpenAIClientOptions options = null) { } + public AzureOpenAIClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public AzureOpenAIClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.OpenAI.AzureOpenAIClientOptions options) { } + public AzureOpenAIClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } public AzureOpenAIClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.OpenAI.AzureOpenAIClientOptions options = null) { } - public AzureOpenAIClient(System.Uri endpoint, System.ClientModel.ApiKeyCredential credential, Azure.AI.OpenAI.AzureOpenAIClientOptions options = null) { } + public AzureOpenAIClient(System.Uri endpoint, System.ClientModel.ApiKeyCredential credential) { } + public AzureOpenAIClient(System.Uri endpoint, System.ClientModel.ApiKeyCredential credential, Azure.AI.OpenAI.AzureOpenAIClientOptions options) { } public override OpenAI.Assistants.AssistantClient GetAssistantClient() { throw null; } public override OpenAI.Audio.AudioClient GetAudioClient(string deploymentName) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -60,7 +62,7 @@ public AzureOpenAIClient(System.Uri endpoint, System.ClientModel.ApiKeyCredentia } public partial class AzureOpenAIClientOptions : System.ClientModel.Primitives.ClientPipelineOptions { - public AzureOpenAIClientOptions(Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion version = Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion.V2024_05_01_Preview) { } + public AzureOpenAIClientOptions(Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion version = Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion.V2024_07_01_Preview) { } public string ApplicationId { get { throw null; } set { } } public Azure.AI.OpenAI.AzureOpenAIAudience? Audience { get { throw null; } set { } } public enum ServiceVersion @@ -68,6 +70,7 @@ public enum ServiceVersion V2024_04_01_Preview = 7, V2024_05_01_Preview = 8, V2024_06_01 = 9, + V2024_07_01_Preview = 10, } } public static partial class AzureStreamingChatCompletionUpdateExtensions @@ -256,7 +259,7 @@ internal AzureChatRetrievedDocument() { } public string Content { get { throw null; } } public int DataSourceIndex { get { throw null; } } public string Filepath { get { throw null; } } - public string FilterReason { get { throw null; } } + public Azure.AI.OpenAI.Chat.AzureChatRetrievedDocumentFilterReason? FilterReason { get { throw null; } } public double? OriginalSearchScore { get { throw null; } } public double? RerankScore { get { throw null; } } public System.Collections.Generic.IReadOnlyList SearchQueries { get { throw null; } } diff --git a/sdk/openai/Azure.AI.OpenAI/assets.json b/sdk/openai/Azure.AI.OpenAI/assets.json index ca993e4d28337..39d86235b4861 100644 --- a/sdk/openai/Azure.AI.OpenAI/assets.json +++ b/sdk/openai/Azure.AI.OpenAI/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/openai/Azure.AI.OpenAI", - "Tag": "net/openai/Azure.AI.OpenAI_495c397a52" + "Tag": "net/openai/Azure.AI.OpenAI_23ae923738" } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj b/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj index f42413e324b5c..00d702ca8473c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj +++ b/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj @@ -1,4 +1,4 @@ - + @@ -11,21 +11,54 @@ $(RequiredTargetFrameworks) true $(NoWarn);CS1591;AZC0012;AZC0102;CS8002;CS0436;AZC0112 - true enable preview disable - - - - - 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.Protocol.cs index 2246b43712d1a..36e30a5d64782 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.Protocol.cs @@ -27,16 +27,16 @@ public override ClientResult CreateAssistant(BinaryContent content, RequestOptio return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); } - public override async Task GetAssistantsAsync(int? limit, string order, string after, string before, RequestOptions options) + public override IAsyncEnumerable GetAssistantsAsync(int? limit, string order, string after, string before, RequestOptions options) { - using PipelineMessage message = CreateGetAssistantsRequest(limit, order, after, before, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + AzureAssistantsPageEnumerator enumerator = new(Pipeline, _endpoint, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - public override ClientResult GetAssistants(int? limit, string order, string after, string before, RequestOptions options) + public override IEnumerable GetAssistants(int? limit, string order, string after, string before, RequestOptions options) { - using PipelineMessage message = CreateGetAssistantsRequest(limit, order, after, before, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureAssistantsPageEnumerator enumerator = new(Pipeline, _endpoint, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.Create(enumerator); } public override async Task GetAssistantAsync(string assistantId, RequestOptions options) @@ -107,22 +107,21 @@ public override ClientResult CreateMessage(string threadId, BinaryContent conten return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); } - /// - public override async Task GetMessagesAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options) + /// + public override IAsyncEnumerable GetMessagesAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); - using PipelineMessage message = CreateGetMessagesRequest(threadId, limit, order, after, before, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + AzureMessagesPageEnumerator enumerator = new(Pipeline, _endpoint, threadId, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - /// - public override ClientResult GetMessages(string threadId, int? limit, string order, string after, string before, RequestOptions options) + public override IEnumerable GetMessages(string threadId, int? limit, string order, string after, string before, RequestOptions options) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); - using PipelineMessage message = CreateGetMessagesRequest(threadId, limit, order, after, before, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureMessagesPageEnumerator enumerator = new(Pipeline, _endpoint, threadId, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.Create(enumerator); } /// @@ -259,22 +258,20 @@ public override ClientResult CreateRun(string threadId, BinaryContent content, R } } - /// - public override async Task GetRunsAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options) + public override IAsyncEnumerable GetRunsAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); - using PipelineMessage message = CreateGetRunsRequest(threadId, limit, order, after, before, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + AzureRunsPageEnumerator enumerator = new(Pipeline, _endpoint, threadId, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - /// - public override ClientResult GetRuns(string threadId, int? limit, string order, string after, string before, RequestOptions options) + public override IEnumerable GetRuns(string threadId, int? limit, string order, string after, string before, RequestOptions options) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); - using PipelineMessage message = CreateGetRunsRequest(threadId, limit, order, after, before, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureRunsPageEnumerator enumerator = new(Pipeline, _endpoint, threadId, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.Create(enumerator); } /// @@ -379,24 +376,22 @@ public override ClientResult SubmitToolOutputsToRun(string threadId, string runI } } - /// - public override async Task GetRunStepsAsync(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) + public override IAsyncEnumerable GetRunStepsAsync(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNullOrEmpty(runId, nameof(runId)); - using PipelineMessage message = CreateGetRunStepsRequest(threadId, runId, limit, order, after, before, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + AzureRunStepsPageEnumerator enumerator = new(Pipeline, _endpoint, threadId, runId, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - /// - public override ClientResult GetRunSteps(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) + public override IEnumerable GetRunSteps(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNullOrEmpty(runId, nameof(runId)); - using PipelineMessage message = CreateGetRunStepsRequest(threadId, runId, limit, order, after, before, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureRunStepsPageEnumerator enumerator = new(Pipeline, _endpoint, threadId, runId, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.Create(enumerator); } /// @@ -492,9 +487,6 @@ public override ClientResult DeleteThread(string threadId, RequestOptions option private new PipelineMessage CreateCreateAssistantRequest(BinaryContent content, RequestOptions options = null) => NewJsonPostBuilder(content, options).WithPath("assistants").Build(); - private new PipelineMessage CreateGetAssistantsRequest(int? limit, string order, string after, string before, RequestOptions options) - => NewGetListBuilder(limit, order, after, before, options).WithPath("assistants").Build(); - private new PipelineMessage CreateGetAssistantRequest(string assistantId, RequestOptions options) => NewJsonGetBuilder(options).WithPath("assistants", assistantId).Build(); @@ -522,9 +514,6 @@ private PipelineMessage CreateDeleteThreadRequest(string threadId, RequestOption private PipelineMessage CreateCreateMessageRequest(string threadId, BinaryContent content, RequestOptions options) => NewJsonPostBuilder(content, options).WithPath("threads", threadId, "messages").Build(); - private PipelineMessage CreateGetMessagesRequest(string threadId, int? limit, string order, string after, string before, RequestOptions options) - => NewGetListBuilder(limit, order, after, before, options).WithPath("threads", threadId, "messages").Build(); - private PipelineMessage CreateGetMessageRequest(string threadId, string messageId, RequestOptions options) => NewJsonGetBuilder(options).WithPath("threads", threadId, "messages", messageId).Build(); @@ -540,9 +529,6 @@ private PipelineMessage CreateCreateThreadAndRunRequest(BinaryContent content, R private PipelineMessage CreateCreateRunRequest(string threadId, BinaryContent content, RequestOptions options) => NewJsonPostBuilder(content, options).WithPath("threads", threadId, "runs").Build(); - private PipelineMessage CreateGetRunsRequest(string threadId, int? limit, string order, string after, string before, RequestOptions options) - => NewGetListBuilder(limit, order, after, before, options).WithPath("threads", threadId, "runs").Build(); - private PipelineMessage CreateGetRunRequest(string threadId, string runId, RequestOptions options) => NewJsonGetBuilder(options).WithPath("threads", threadId, "runs", runId).Build(); @@ -555,16 +541,14 @@ private PipelineMessage CreateCancelRunRequest(string threadId, string runId, Re private PipelineMessage CreateSubmitToolOutputsToRunRequest(string threadId, string runId, BinaryContent content, RequestOptions options) => NewJsonPostBuilder(content, options).WithPath("threads", threadId, "runs", runId, "submit_tool_outputs").Build(); - private PipelineMessage CreateGetRunStepsRequest(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) - => NewGetListBuilder(limit, order, after, before, options).WithPath("threads", threadId, "runs", runId, "steps").Build(); - private PipelineMessage CreateGetRunStepRequest(string threadId, string runId, string stepId, RequestOptions options) => NewJsonGetBuilder(options).WithPath("threads", threadId, "runs", runId, "steps", stepId).Build(); private AzureOpenAIPipelineMessageBuilder NewBuilder(RequestOptions options) => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) - .WithHeader(s_OpenAIBetaFeatureHeader, s_OpenAIBetaAssistantsV2HeaderValue) + .WithAssistantsHeader() .WithOptions(options); + private AzureOpenAIPipelineMessageBuilder NewJsonPostBuilder(BinaryContent content, RequestOptions options) => NewBuilder(options) .WithMethod("POST") @@ -583,11 +567,5 @@ private AzureOpenAIPipelineMessageBuilder NewJsonDeleteBuilder(RequestOptions op private AzureOpenAIPipelineMessageBuilder NewGetListBuilder(int? limit, string order, string after, string before, RequestOptions options) => NewJsonGetBuilder(options) - .WithOptionalQueryParameter("limit", limit) - .WithOptionalQueryParameter("order", order) - .WithOptionalQueryParameter("after", after) - .WithOptionalQueryParameter("before", before); - - private static readonly string s_OpenAIBetaFeatureHeader = "OpenAI-Beta"; - private static readonly string s_OpenAIBetaAssistantsV2HeaderValue = "assistants=v2"; + .WithCommonListParameters(limit, order, after, before); } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.cs index 1d1b3b840f153..c8b48f925c281 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using OpenAI.Assistants; using System.ClientModel.Primitives; namespace Azure.AI.OpenAI.Assistants; @@ -17,13 +16,13 @@ internal partial class AzureAssistantClient : AssistantClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureAssistantClient( - ClientPipeline pipeline, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, endpoint, null) + internal AzureAssistantClient(ClientPipeline pipeline, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _endpoint = endpoint; _apiVersion = options.Version; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureAssistantsPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureAssistantsPageEnumerator.cs new file mode 100644 index 0000000000000..f351279a7f04c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureAssistantsPageEnumerator.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +#nullable enable + +namespace Azure.AI.OpenAI.Assistants; + +internal partial class AzureAssistantsPageEnumerator : AssistantsPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureAssistantsPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + int? limit, string order, string after, string before, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, limit, order, after, before, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetAssistantsAsync(int? limit, string order, string after, string before, RequestOptions options) + { + using PipelineMessage message = CreateGetAssistantsRequest(limit, order, after, before, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetAssistants(int? limit, string order, string after, string before, RequestOptions options) + { + using PipelineMessage message = CreateGetAssistantsRequest(limit, order, after, before, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private PipelineMessage CreateGetAssistantsRequest(int? limit, string order, string after, string before, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithPath("assistants") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureMessagesPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureMessagesPageEnumerator.cs new file mode 100644 index 0000000000000..79ad28d13aa4d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureMessagesPageEnumerator.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Azure.AI.OpenAI.Assistants; + +internal partial class AzureMessagesPageEnumerator : MessagesPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureMessagesPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + string threadId, + int? limit, string order, string after, string before, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, threadId, limit, order, after, before, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetMessagesAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); + + using PipelineMessage message = CreateGetMessagesRequest(threadId, limit, order, after, before, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetMessages(string threadId, int? limit, string order, string after, string before, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); + + using PipelineMessage message = CreateGetMessagesRequest(threadId, limit, order, after, before, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private PipelineMessage CreateGetMessagesRequest(string threadId, int? limit, string order, string after, string before, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithPath("threads", threadId, "messages") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunStepsPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunStepsPageEnumerator.cs new file mode 100644 index 0000000000000..e7f6ae90293fb --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunStepsPageEnumerator.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Azure.AI.OpenAI.Assistants; + +internal partial class AzureRunStepsPageEnumerator : RunStepsPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureRunStepsPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + string threadId, string runId, + int? limit, string order, string after, string before, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, threadId, runId, limit, order, after, before, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetRunStepsAsync(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); + Argument.AssertNotNullOrEmpty(runId, nameof(runId)); + + using PipelineMessage message = CreateGetRunStepsRequest(threadId, runId, limit, order, after, before, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetRunSteps(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); + Argument.AssertNotNullOrEmpty(runId, nameof(runId)); + + using PipelineMessage message = CreateGetRunStepsRequest(threadId, runId, limit, order, after, before, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private PipelineMessage CreateGetRunStepsRequest(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithPath("threads", threadId, "runs", runId, "steps") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunsPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunsPageEnumerator.cs new file mode 100644 index 0000000000000..65afbca20db1f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunsPageEnumerator.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Azure.AI.OpenAI.Assistants; + +internal partial class AzureRunsPageEnumerator : RunsPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureRunsPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + string threadId, int? limit, string order, string after, string before, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, threadId, limit, order, after, before, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetRunsAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); + + using PipelineMessage message = CreateGetRunsRequest(threadId, limit, order, after, before, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetRuns(string threadId, int? limit, string order, string after, string before, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); + + using PipelineMessage message = CreateGetRunsRequest(threadId, limit, order, after, before, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private PipelineMessage CreateGetRunsRequest(string threadId, int? limit, string order, string after, string before, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithPath("threads", threadId, "runs") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.cs index 30cfa64294718..f15480951d1a7 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.cs @@ -18,14 +18,14 @@ internal partial class AzureAudioClient : AudioClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureAudioClient( - ClientPipeline pipeline, - string deploymentName, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, model: deploymentName, endpoint, null) + internal AzureAudioClient(ClientPipeline pipeline, string deploymentName, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, model: deploymentName, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _deploymentName = deploymentName; _endpoint = endpoint; _apiVersion = options.Version; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs index c44bac27f1294..9569b4ef6abdc 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs @@ -1,6 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +global using OpenAI; +global using OpenAI.Assistants; +global using OpenAI.Audio; +global using OpenAI.Batch; +global using OpenAI.Chat; +global using OpenAI.Embeddings; +global using OpenAI.Files; +global using OpenAI.FineTuning; +global using OpenAI.Images; +global using OpenAI.Models; +global using OpenAI.Moderations; +global using OpenAI.VectorStores; + using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; @@ -15,18 +28,6 @@ using Azure.AI.OpenAI.Images; using Azure.AI.OpenAI.VectorStores; using Azure.Core; -using OpenAI; -using OpenAI.Assistants; -using OpenAI.Audio; -using OpenAI.Batch; -using OpenAI.Chat; -using OpenAI.Embeddings; -using OpenAI.Files; -using OpenAI.FineTuning; -using OpenAI.Images; -using OpenAI.Models; -using OpenAI.Moderations; -using OpenAI.VectorStores; #pragma warning disable AZC0007 @@ -40,6 +41,7 @@ namespace Azure.AI.OpenAI; /// public partial class AzureOpenAIClient : OpenAIClient { + private readonly Uri _endpoint; private readonly AzureOpenAIClientOptions _options; /// @@ -52,64 +54,77 @@ public partial class AzureOpenAIClient : OpenAIClient /// /// /// - /// - /// - /// The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. - /// + /// The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com. + /// The API key to authenticate with the service. + public AzureOpenAIClient(Uri endpoint, ApiKeyCredential credential) : this(endpoint, credential, new AzureOpenAIClientOptions()) + { + } + + /// + /// Creates a new instance of that will connect to a specified Azure OpenAI + /// service resource endpoint using an API key. + /// + /// /// - /// Example: https://my-resource.openai.azure.com + /// For token-based authentication, including the use of managed identity, please use the alternate constructor: + /// /// - /// - /// The API key to use when authenticating with the specified endpoint. - /// Additional options for the client. - public AzureOpenAIClient(Uri endpoint, ApiKeyCredential credential, AzureOpenAIClientOptions options = null) - : this( - CreatePipeline(GetApiKey(credential, requireExplicitCredential: true), options), - GetEndpoint(endpoint, requireExplicitEndpoint: true), - options) - {} - - /// - public AzureOpenAIClient(Uri endpoint, AzureKeyCredential credential, AzureOpenAIClientOptions options = null) - : this( - CreatePipeline(GetApiKey(new ApiKeyCredential(credential?.Key), requireExplicitCredential: true), options), - GetEndpoint(endpoint, requireExplicitEndpoint: true), - options) - {} + /// + /// The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com. + /// The API key to authenticate with the service. + public AzureOpenAIClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AzureOpenAIClientOptions()) + { + } /// /// Creates a new instance of that will connect to an Azure OpenAI service resource - /// using endpoint and authentication settings from available configuration information. + /// using token authentication, including for tokens issued via managed identity. + /// + /// + /// For API-key-based authentication, please use the alternate constructor: + /// + /// + /// The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com. + /// The token credential to authenticate with the service. + public AzureOpenAIClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AzureOpenAIClientOptions()) + { + } + + /// + /// Creates a new instance of that will connect to a specified Azure OpenAI + /// service resource endpoint using an API key. /// /// /// /// For token-based authentication, including the use of managed identity, please use the alternate constructor: /// /// + /// + /// The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com. + /// The API key to authenticate with the service. + /// The options to configure the client. + public AzureOpenAIClient(Uri endpoint, ApiKeyCredential credential, AzureOpenAIClientOptions options) + : this(CreatePipeline(credential, options), endpoint, options) + { + } + + /// + /// Creates a new instance of that will connect to a specified Azure OpenAI + /// service resource endpoint using an API key. + /// + /// /// - /// The client selects its resource endpoint in the following order of precedence: - /// - /// The property on , if available - /// The setting in an applicable IConfiguration instance, if available - /// The value of the AZURE_OPENAI_ENDPOINT environment variable, if present - /// - /// - /// The client selects its API key credential in the following order of precedence: - /// - /// The setting in an applicable IConfiguration instance, if available - /// The value of the AZURE_OPENAI_API_KEY environment variable, if present - /// - /// - /// Note: resource endpoints should not include model deployment or operation information. - /// - /// - /// Example: https://my-resource.openai.azure.com + /// For token-based authentication, including the use of managed identity, please use the alternate constructor: + /// /// /// - /// Additional options for the client. - public AzureOpenAIClient(AzureOpenAIClientOptions options = null) - : this(CreatePipeline(GetApiKey(), options), GetEndpoint(), options) - {} + /// The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com. + /// The API key to authenticate with the service. + /// The options to configure the client. + public AzureOpenAIClient(Uri endpoint, AzureKeyCredential credential, AzureOpenAIClientOptions options) + : this(CreatePipeline(credential?.Key, options), endpoint, options) + { + } /// /// Creates a new instance of that will connect to an Azure OpenAI service resource @@ -127,15 +142,11 @@ public AzureOpenAIClient(AzureOpenAIClientOptions options = null) /// Example: https://my-resource.openai.azure.com /// /// - /// - /// - /// The API key to use when authenticating with the provided endpoint. - /// - /// + /// The API key to use when authenticating with the provided endpoint. /// The scenario-independent options to use. public AzureOpenAIClient(Uri endpoint, TokenCredential credential, AzureOpenAIClientOptions options = null) - : this(CreatePipeline(credential, options), GetEndpoint(endpoint, requireExplicitEndpoint: true), options) - {} + : this(CreatePipeline(credential, options), endpoint, options) + { } /// /// Creates a new instance of . @@ -144,8 +155,13 @@ public AzureOpenAIClient(Uri endpoint, TokenCredential credential, AzureOpenAICl /// The endpoint to use. /// The additional client options to use. protected AzureOpenAIClient(ClientPipeline pipeline, Uri endpoint, AzureOpenAIClientOptions options) - : base(pipeline, endpoint, null) + : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); + options ??= new(); + + _endpoint = endpoint; _options = options; } @@ -161,7 +177,7 @@ protected AzureOpenAIClient() /// A new instance. [Experimental("OPENAI001")] public override AssistantClient GetAssistantClient() - => new AzureAssistantClient(Pipeline, Endpoint, _options); + => new AzureAssistantClient(Pipeline, _endpoint, _options); /// /// Gets a new instance configured for audio operation use with the Azure OpenAI service. @@ -169,7 +185,7 @@ public override AssistantClient GetAssistantClient() /// The model deployment name to use for the new client's audio operations. /// A new instance. public override AudioClient GetAudioClient(string deploymentName) - => new AzureAudioClient(Pipeline, deploymentName, Endpoint, _options); + => new AzureAudioClient(Pipeline, deploymentName, _endpoint, _options); /// /// Gets a new instance configured for batch operation use with the Azure OpenAI service. @@ -177,7 +193,7 @@ public override AudioClient GetAudioClient(string deploymentName) /// The model deployment name to use for the new client's audio operations. /// A new instance. public BatchClient GetBatchClient(string deploymentName) - => new AzureBatchClient(Pipeline, deploymentName, Endpoint, _options); + => new AzureBatchClient(Pipeline, deploymentName, _endpoint, _options); /// /// This method is unsupported for Azure OpenAI. Please use the alternate @@ -192,7 +208,7 @@ public BatchClient GetBatchClient(string deploymentName) /// The model deployment name to use for the new client's chat completion operations. /// A new instance. public override ChatClient GetChatClient(string deploymentName) - => new AzureChatClient(Pipeline, deploymentName, Endpoint, _options); + => new AzureChatClient(Pipeline, deploymentName, _endpoint, _options); /// /// Gets a new instance configured for embedding operation use with the Azure OpenAI service. @@ -200,21 +216,21 @@ public override ChatClient GetChatClient(string deploymentName) /// The model deployment name to use for the new client's embedding operations. /// A new instance. public override EmbeddingClient GetEmbeddingClient(string deploymentName) - => new AzureEmbeddingClient(Pipeline, deploymentName, Endpoint, _options); + => new AzureEmbeddingClient(Pipeline, deploymentName, _endpoint, _options); /// /// Gets a new instance configured for file operation use with the Azure OpenAI service. /// /// A new instance. public override FileClient GetFileClient() - => new AzureFileClient(Pipeline, Endpoint, _options); + => new AzureFileClient(Pipeline, _endpoint, _options); /// /// Gets a new instance configured for fine-tuning operation use with the Azure OpenAI service. /// /// A new instance. public override FineTuningClient GetFineTuningClient() - => new AzureFineTuningClient(Pipeline, Endpoint, _options); + => new AzureFineTuningClient(Pipeline, _endpoint, _options); /// /// Gets a new instance configured for image operation use with the Azure OpenAI service. @@ -222,7 +238,7 @@ public override FineTuningClient GetFineTuningClient() /// The model deployment name to use for the new client's image operations. /// A new instance. public override ImageClient GetImageClient(string deploymentName) - => new AzureImageClient(Pipeline, deploymentName, Endpoint, _options); + => new AzureImageClient(Pipeline, deploymentName, _endpoint, _options); /// /// Model management operations are not supported with Azure OpenAI. @@ -248,7 +264,7 @@ public override ModerationClient GetModerationClient(string _) /// A new instance. [Experimental("OPENAI001")] public override VectorStoreClient GetVectorStoreClient() - => new AzureVectorStoreClient(Pipeline, Endpoint, _options); + => new AzureVectorStoreClient(Pipeline, _endpoint, _options); private static ClientPipeline CreatePipeline(PipelinePolicy authenticationPolicy, AzureOpenAIClientOptions options) => ClientPipeline.Create( @@ -278,84 +294,33 @@ internal static ClientPipeline CreatePipeline(TokenCredential credential, AzureO return CreatePipeline(new AzureTokenAuthenticationPolicy(credential, [authorizationScope]), options); } - internal static new ApiKeyCredential GetApiKey(ApiKeyCredential explicitCredential = null, bool requireExplicitCredential = false) - { - if (explicitCredential is not null) - { - return explicitCredential; - } - // To do: IConfiguration support - else if (requireExplicitCredential) - { - throw new ArgumentNullException(nameof(explicitCredential), $"A non-null credential value is required."); - } - else - { - string environmentApiKey = Environment.GetEnvironmentVariable(s_aoaiApiKeyEnvironmentVariable); - if (string.IsNullOrEmpty(environmentApiKey)) - { - throw new InvalidOperationException( - $"No environment variable value was found for AZURE_OPENAI_API_KEY. " - + "Please either populate this environment variable or provide authentication information directly " - + "to the client constructor."); - } - return new(environmentApiKey); - } - } - - internal static Uri GetEndpoint(Uri explicitEndpoint = null, bool requireExplicitEndpoint = false, AzureOpenAIClientOptions options = null) - { - if (explicitEndpoint is not null) - { - return explicitEndpoint; - } - // To do: IConfiguration support - else if (requireExplicitEndpoint) - { - throw new ArgumentNullException(nameof(explicitEndpoint), $"A non-null endpoint value is required."); - } - else - { - string environmentApiKey = Environment.GetEnvironmentVariable(s_aoaiEndpointEnvironmentVariable); - if (string.IsNullOrEmpty(environmentApiKey)) - { - throw new InvalidOperationException( - $"No environment variable value was found for AZURE_OPENAI_ENDPOINT. " - + "Please either populate this environment variable or provide endpoint information directly " - + "to the client constructor."); - } - return new(environmentApiKey); - } - } - private static PipelinePolicy CreateAddUserAgentHeaderPolicy(AzureOpenAIClientOptions options = null) { Core.TelemetryDetails telemetryDetails = new(typeof(AzureOpenAIClient).Assembly, options?.ApplicationId); - return new GenericActionPipelinePolicy(message => - { - if (message?.Request?.Headers?.TryGetValue(s_userAgentHeaderKey, out string _) == false) + return new GenericActionPipelinePolicy( + requestAction: request => { - message.Request.Headers.Set(s_userAgentHeaderKey, telemetryDetails.ToString()); - } - }); + if (request?.Headers?.TryGetValue(s_userAgentHeaderKey, out string _) == false) + { + request.Headers.Set(s_userAgentHeaderKey, telemetryDetails.ToString()); + } + }); } private static PipelinePolicy CreateAddClientRequestIdHeaderPolicy() { - return new GenericActionPipelinePolicy(message => + return new GenericActionPipelinePolicy(request => { - if (message?.Request?.Headers is not null) + if (request?.Headers is not null) { - string requestId = message.Request.Headers.TryGetValue(s_clientRequestIdHeaderKey, out string existingHeader) == true + string requestId = request.Headers.TryGetValue(s_clientRequestIdHeaderKey, out string existingHeader) == true ? existingHeader : Guid.NewGuid().ToString().ToLowerInvariant(); - message.Request.Headers.Set(s_clientRequestIdHeaderKey, requestId); + request.Headers.Set(s_clientRequestIdHeaderKey, requestId); } }); } - private static readonly string s_aoaiEndpointEnvironmentVariable = "AZURE_OPENAI_ENDPOINT"; - private static readonly string s_aoaiApiKeyEnvironmentVariable = "AZURE_OPENAI_API_KEY"; private static readonly string s_userAgentHeaderKey = "User-Agent"; private static readonly string s_clientRequestIdHeaderKey = "x-ms-client-request-id"; private static PipelineMessageClassifier s_pipelineMessageClassifier; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs index 35149393235b0..1b2989bfb2f31 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System.ClientModel.Primitives; -using OpenAI; namespace Azure.AI.OpenAI; @@ -56,6 +55,7 @@ public AzureOpenAIClientOptions(ServiceVersion version = LatestVersion) ServiceVersion.V2024_04_01_Preview => "2024-04-01-preview", ServiceVersion.V2024_05_01_Preview => "2024-05-01-preview", ServiceVersion.V2024_06_01 => "2024-06-01", + ServiceVersion.V2024_07_01_Preview => "2024-07-01-preview", _ => throw new NotSupportedException() }; RetryPolicy = new RetryWithDelaysPolicy(); @@ -68,6 +68,7 @@ public enum ServiceVersion V2024_04_01_Preview = 7, V2024_05_01_Preview = 8, V2024_06_01 = 9, + V2024_07_01_Preview = 10, } internal class RetryWithDelaysPolicy : ClientRetryPolicy @@ -98,5 +99,5 @@ protected override TimeSpan GetNextDelay(PipelineMessage message, int tryCount) } } - private const ServiceVersion LatestVersion = ServiceVersion.V2024_05_01_Preview; + private const ServiceVersion LatestVersion = ServiceVersion.V2024_07_01_Preview; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.cs index f2777135e638c..e04d9daf972b2 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.cs @@ -18,15 +18,14 @@ internal partial class AzureBatchClient : BatchClient private readonly string _deploymentName; private readonly string _apiVersion; - internal AzureBatchClient( - ClientPipeline pipeline, - string deploymentName, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, endpoint, null) + internal AzureBatchClient(ClientPipeline pipeline, string deploymentName, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { - options ??= new(); + Argument.AssertNotNull(pipeline, nameof(pipeline)); Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); + options ??= new(); + _deploymentName = deploymentName; _endpoint = endpoint; _apiVersion = options.Version; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatClient.cs index 8b1df86399f58..73ee82a0398bd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatClient.cs @@ -21,24 +21,24 @@ internal partial class AzureChatClient : ChatClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureChatClient( - ClientPipeline pipeline, - string deploymentName, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, model: deploymentName, endpoint, null) + internal AzureChatClient(ClientPipeline pipeline, string deploymentName, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, model: deploymentName, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _deploymentName = deploymentName; - _endpoint = endpoint; _apiVersion = options.Version; + _endpoint = endpoint; } protected AzureChatClient() { } /// - public override AsyncResultCollection CompleteChatStreamingAsync(IEnumerable messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default) + public override AsyncCollectionResult CompleteChatStreamingAsync(IEnumerable messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default) { options ??= new(); options.StreamOptions = null; @@ -46,7 +46,7 @@ public override AsyncResultCollection CompleteCha } /// - public override ResultCollection CompleteChatStreaming(IEnumerable messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default) + public override CollectionResult CompleteChatStreaming(IEnumerable messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default) { options ??= new(); options.StreamOptions = null; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletion.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletion.cs index 104fa3770be3e..299f2dea3a59c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletion.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletion.cs @@ -16,7 +16,7 @@ public static partial class AzureChatCompletionExtensions public static ContentFilterResultForPrompt GetContentFilterResultForPrompt(this ChatCompletion chatCompletion) { return AdditionalPropertyHelpers.GetAdditionalListProperty( - chatCompletion._serializedAdditionalRawData, + chatCompletion.SerializedAdditionalRawData, "prompt_filter_results")?[0]; } @@ -24,7 +24,7 @@ public static ContentFilterResultForPrompt GetContentFilterResultForPrompt(this public static ContentFilterResultForResponse GetContentFilterResultForResponse(this ChatCompletion chatCompletion) { return AdditionalPropertyHelpers.GetAdditionalProperty( - chatCompletion.Choices?[0]?._serializedAdditionalRawData, + chatCompletion.Choices?[0]?.SerializedAdditionalRawData, "content_filter_results"); } @@ -32,7 +32,7 @@ public static ContentFilterResultForResponse GetContentFilterResultForResponse(t public static AzureChatMessageContext GetAzureMessageContext(this ChatCompletion chatCompletion) { return AdditionalPropertyHelpers.GetAdditionalProperty( - chatCompletion.Choices?[0]?.Message?._serializedAdditionalRawData, + chatCompletion.Choices?[0]?.Message?.SerializedAdditionalRawData, "context"); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletionOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletionOptions.cs index d452e882995b3..54ab5606ebbbb 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletionOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletionOptions.cs @@ -4,7 +4,6 @@ using System.Diagnostics.CodeAnalysis; using Azure.AI.OpenAI.Chat; using Azure.AI.OpenAI.Internal; -using OpenAI.Chat; namespace Azure.AI.OpenAI; @@ -13,15 +12,16 @@ public static partial class AzureChatCompletionOptionsExtensions [Experimental("AOAI001")] public static void AddDataSource(this ChatCompletionOptions options, AzureChatDataSource dataSource) { - options._serializedAdditionalRawData ??= new ChangeTrackingDictionary(); + options.SerializedAdditionalRawData ??= new Dictionary(); + IList existingSources = AdditionalPropertyHelpers.GetAdditionalListProperty( - options._serializedAdditionalRawData, + options.SerializedAdditionalRawData, "data_sources") ?? new ChangeTrackingList(); existingSources.Add(dataSource); AdditionalPropertyHelpers.SetAdditionalProperty( - options._serializedAdditionalRawData, + options.SerializedAdditionalRawData, "data_sources", existingSources); } @@ -30,7 +30,7 @@ IList existingSources public static IReadOnlyList GetDataSources(this ChatCompletionOptions options) { return AdditionalPropertyHelpers.GetAdditionalListProperty( - options._serializedAdditionalRawData, + options.SerializedAdditionalRawData, "data_sources") as IReadOnlyList; } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureStreamingChatCompletionUpdate.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureStreamingChatCompletionUpdate.cs index 3799a9068247b..9de53f530bc39 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureStreamingChatCompletionUpdate.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureStreamingChatCompletionUpdate.cs @@ -18,7 +18,7 @@ public static AzureChatMessageContext GetAzureMessageContext(this StreamingChatC if (chatUpdate.Choices?.Count > 0) { return AdditionalPropertyHelpers.GetAdditionalProperty( - chatUpdate.Choices[0].Delta?._serializedAdditionalRawData, + chatUpdate.Choices[0].Delta?.SerializedAdditionalRawData, "context"); } return null; @@ -28,7 +28,7 @@ public static AzureChatMessageContext GetAzureMessageContext(this StreamingChatC public static ContentFilterResultForPrompt GetContentFilterResultForPrompt(this StreamingChatCompletionUpdate chatUpdate) { return AdditionalPropertyHelpers.GetAdditionalListProperty( - chatUpdate._serializedAdditionalRawData, + chatUpdate.SerializedAdditionalRawData, "prompt_filter_results")?[0]; } @@ -36,7 +36,7 @@ public static ContentFilterResultForPrompt GetContentFilterResultForPrompt(this public static ContentFilterResultForResponse GetContentFilterResultForResponse(this StreamingChatCompletionUpdate chatUpdate) { return AdditionalPropertyHelpers.GetAdditionalProperty( - chatUpdate?.Choices?.ElementAtOrDefault(0)?._serializedAdditionalRawData, + chatUpdate?.Choices?.ElementAtOrDefault(0)?.SerializedAdditionalRawData, "content_filter_results"); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/GeneratorStubs.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/GeneratorStubs.cs index 50801d6056402..368320c833136 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/GeneratorStubs.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/GeneratorStubs.cs @@ -6,6 +6,6 @@ namespace Azure.AI.OpenAI.Chat; [CodeGenModel("AzureChatDataSource")] public abstract partial class AzureChatDataSource { } [CodeGenModel("AzureChatMessageContextCitation")] public partial class AzureChatCitation { } [CodeGenModel("AzureChatMessageContextAllRetrievedDocuments")] public partial class AzureChatRetrievedDocument { } +[CodeGenModel("AzureChatMessageContextAllRetrievedDocumentsFilterReason")] public readonly partial struct AzureChatRetrievedDocumentFilterReason { } [CodeGenModel("AzureChatMessageContext")] public partial class AzureChatMessageContext { } -[CodeGenModel("InternalAzureSearchChatDataSourceParametersQueryType")] public readonly partial struct DataSourceQueryType { } -[CodeGenModel("AzureChatRetrievedDocumentFilterReason")] public readonly partial struct AzureChatRetrievedDocumentFilterReason { } +[CodeGenModel("AzureSearchChatDataSourceParametersQueryType")] public readonly partial struct DataSourceQueryType { } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/GeneratorStubs.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/GeneratorStubs.cs index 8e3ce0996c52b..4a2bb2bcdbb49 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/GeneratorStubs.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/GeneratorStubs.cs @@ -12,6 +12,7 @@ namespace Azure.AI.OpenAI.Chat; [CodeGenModel("AzureChatDataSourceModelIdVectorizationSource")] internal partial class InternalAzureChatDataSourceModelIdVectorizationSource { } [CodeGenModel("AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions")] internal partial class InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions { } [CodeGenModel("AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions")] internal partial class InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions { } +[CodeGenModel("AzureSearchChatDataSourceParametersIncludeContext")] internal readonly partial struct InternalAzureSearchChatDataSourceParametersIncludeContext { } [CodeGenModel("UnknownAzureChatDataSource")] internal partial class InternalUnknownAzureChatDataSource { } [CodeGenModel("UnknownAzureChatDataSourceAuthenticationOptions")] internal partial class InternalUnknownAzureChatDataSourceAuthenticationOptions { } [CodeGenModel("UnknownAzureChatDataSourceVectorizationSource")] internal partial class InternalUnknownAzureChatDataSourceVectorizationSource { } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureCosmosDBDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureCosmosDBChatDataSource.cs similarity index 84% rename from sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureCosmosDBDataSource.cs rename to sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureCosmosDBChatDataSource.cs index 4db71eab73f1a..9f3933cdec690 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureCosmosDBDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureCosmosDBChatDataSource.cs @@ -105,11 +105,19 @@ public DataSourceOutputContextFlags? OutputContextFlags /// /// Initializes a new instance of . /// - public AzureCosmosDBChatDataSource() + public AzureCosmosDBChatDataSource() : base(type: "azure_cosmos_db", serializedAdditionalRawData: null) { - Type = "azure_cosmos_db"; InternalParameters = new(); - _serializedAdditionalRawData = new ChangeTrackingDictionary(); + } + + // CUSTOM: Made internal. + /// Initializes a new instance of . + /// The parameter information to control the use of the Azure CosmosDB data source. + /// is null. + internal AzureCosmosDBChatDataSource(InternalAzureCosmosDBChatDataSourceParameters internalParameters) : this() + { + Argument.AssertNotNull(internalParameters, nameof(internalParameters)); + InternalParameters = internalParameters; } /// Initializes a new instance of . @@ -117,7 +125,8 @@ public AzureCosmosDBChatDataSource() /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal AzureCosmosDBChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureCosmosDBChatDataSourceParameters internalParameters) : base(type, serializedAdditionalRawData) + internal AzureCosmosDBChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureCosmosDBChatDataSourceParameters internalParameters) + : base(type, serializedAdditionalRawData) { InternalParameters = internalParameters; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureMachineLearningChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureMachineLearningIndexChatDataSource.cs similarity index 83% rename from sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureMachineLearningChatDataSource.cs rename to sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureMachineLearningIndexChatDataSource.cs index 0d44d8f3a2f02..cd0550e0fa917 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureMachineLearningChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureMachineLearningIndexChatDataSource.cs @@ -98,11 +98,19 @@ public string Filter /// /// Creates a new instance of . /// - public AzureMachineLearningIndexChatDataSource() + public AzureMachineLearningIndexChatDataSource() : base(type: "azure_ml_index", serializedAdditionalRawData: null) { - Type = "azure_ml_index"; InternalParameters = new(); - _serializedAdditionalRawData = new ChangeTrackingDictionary(); + } + + // CUSTOM: Made internal. + /// Initializes a new instance of . + /// The parameter information to control the use of the Azure Machine Learning Index data source. + /// is null. + internal AzureMachineLearningIndexChatDataSource(InternalAzureMachineLearningIndexChatDataSourceParameters internalParameters) + { + Argument.AssertNotNull(internalParameters, nameof(internalParameters)); + InternalParameters = internalParameters; } /// Initializes a new instance of . @@ -110,7 +118,8 @@ public AzureMachineLearningIndexChatDataSource() /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal AzureMachineLearningIndexChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureMachineLearningIndexChatDataSourceParameters internalParameters) : base(type, serializedAdditionalRawData) + internal AzureMachineLearningIndexChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureMachineLearningIndexChatDataSourceParameters internalParameters) + : base(type, serializedAdditionalRawData) { InternalParameters = internalParameters; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureSearchChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureSearchChatDataSource.cs index 698a04331b184..799cc13dc82df 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureSearchChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureSearchChatDataSource.cs @@ -119,11 +119,19 @@ public DataSourceVectorizer VectorizationSource /// /// Creates a new instance of . /// - public AzureSearchChatDataSource() + public AzureSearchChatDataSource() : base(type: "azure_search", serializedAdditionalRawData: null) { - Type = "azure_search"; InternalParameters = new(); - _serializedAdditionalRawData = new ChangeTrackingDictionary(); + } + + // CUSTOM: Made internal. + /// Initializes a new instance of . + /// The parameter information to control the use of the Azure Search data source. + /// is null. + internal AzureSearchChatDataSource(InternalAzureSearchChatDataSourceParameters internalParameters) : this() + { + Argument.AssertNotNull(internalParameters, nameof(internalParameters)); + InternalParameters = internalParameters; } /// Initializes a new instance of . @@ -131,7 +139,8 @@ public AzureSearchChatDataSource() /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal AzureSearchChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureSearchChatDataSourceParameters internalParameters) : base(type, serializedAdditionalRawData) + internal AzureSearchChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureSearchChatDataSourceParameters internalParameters) + : base(type, serializedAdditionalRawData) { InternalParameters = internalParameters; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/ElasticsearchChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/ElasticsearchChatDataSource.cs index f65d0aff16655..8ded23802340f 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/ElasticsearchChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/ElasticsearchChatDataSource.cs @@ -102,11 +102,20 @@ public DataSourceVectorizer VectorizationSource init => InternalParameters.VectorizationSource = value; } - public ElasticsearchChatDataSource() + public ElasticsearchChatDataSource() : base(type: "elasticsearch", serializedAdditionalRawData: null) { - Type = "elasticsearch"; InternalParameters = new(); - _serializedAdditionalRawData = new ChangeTrackingDictionary(); + } + + // CUSTOM: Made internal. + /// Initializes a new instance of . + /// The parameter information to control the use of the Elasticsearch data source. + /// is null. + internal ElasticsearchChatDataSource(InternalElasticsearchChatDataSourceParameters internalParameters) + : this() + { + Argument.AssertNotNull(internalParameters, nameof(internalParameters)); + InternalParameters = internalParameters; } /// Initializes a new instance of . @@ -114,7 +123,8 @@ public ElasticsearchChatDataSource() /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal ElasticsearchChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalElasticsearchChatDataSourceParameters internalParameters) : base(type, serializedAdditionalRawData) + internal ElasticsearchChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalElasticsearchChatDataSourceParameters internalParameters) + : base(type, serializedAdditionalRawData) { InternalParameters = internalParameters; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/PineconeChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/PineconeChatDataSource.cs index e4b20f1c168ab..fd7106040de3c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/PineconeChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/PineconeChatDataSource.cs @@ -95,11 +95,19 @@ public DataSourceOutputContextFlags? OutputContextFlags init => InternalParameters.OutputContextFlags = value; } - public PineconeChatDataSource() + public PineconeChatDataSource() : base(type: "pinecone", serializedAdditionalRawData: null) { - Type = "pinecone"; InternalParameters = new(); - _serializedAdditionalRawData = new ChangeTrackingDictionary(); + } + + // CUSTOM: Made internal. + /// Initializes a new instance of . + /// The parameter information to control the use of the Pinecone data source. + /// is null. + internal PineconeChatDataSource(InternalPineconeChatDataSourceParameters internalParameters) : this() + { + Argument.AssertNotNull(internalParameters, nameof(internalParameters)); + InternalParameters = internalParameters; } /// Initializes a new instance of . @@ -107,7 +115,8 @@ public PineconeChatDataSource() /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal PineconeChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalPineconeChatDataSourceParameters internalParameters) : base(type, serializedAdditionalRawData) + internal PineconeChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalPineconeChatDataSourceParameters internalParameters) + : base(type, serializedAdditionalRawData) { InternalParameters = internalParameters; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/GeneratorStubs.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/GeneratorStubs.cs index 7aa29e337ee04..6c52e65392e08 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/GeneratorStubs.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/GeneratorStubs.cs @@ -8,7 +8,7 @@ namespace Azure.AI.OpenAI; [CodeGenModel("AzureContentFilterResultForChoiceProtectedMaterialCodeCitation")] public partial class ContentFilterProtectedMaterialCitedResult { } [CodeGenModel("AzureContentFilterResultForPromptContentFilterResults")] internal partial class InternalAzureContentFilterResultForPromptContentFilterResults { } [CodeGenModel("AzureContentFilterResultForPromptContentFilterResultsError")] internal partial class InternalAzureContentFilterResultForPromptContentFilterResultsError { } -[CodeGenModel("ContentFilterSeverityResultSeverity")] public readonly partial struct ContentFilterSeverity { } +[CodeGenModel("AzureContentFilterSeverityResultSeverity")] public readonly partial struct ContentFilterSeverity { } [CodeGenModel("AzureContentFilterSeverityResult")] public partial class ContentFilterSeverityResult { [CodeGenMember("Severity")] diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/PageableResultHelpers.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/PageableResultHelpers.cs deleted file mode 100644 index c3112acda70ce..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/PageableResultHelpers.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.ClientModel; - -#nullable enable - -namespace Azure.AI.OpenAI; - -internal class PageableResultHelpers -{ - public static PageableCollection Create(Func> firstPageFunc, Func>? nextPageFunc, int? pageSize = default) where T : notnull - { - ResultPage first(string? _, int? pageSizeHint) => firstPageFunc(pageSizeHint); - return new FuncPageable(first, nextPageFunc, pageSize); - } - - public static AsyncPageableCollection Create(Func>> firstPageFunc, Func>>? nextPageFunc, int? pageSize = default) where T : notnull - { - Task> first(string? _, int? pageSizeHint) => firstPageFunc(pageSizeHint); - return new FuncAsyncPageable(first, nextPageFunc, pageSize); - } - - private class FuncAsyncPageable : AsyncPageableCollection where T : notnull - { - private readonly Func>> _firstPageFunc; - private readonly Func>>? _nextPageFunc; - private readonly int? _defaultPageSize; - - public FuncAsyncPageable(Func>> firstPageFunc, Func>>? nextPageFunc, int? defaultPageSize = default) - { - _firstPageFunc = firstPageFunc; - _nextPageFunc = nextPageFunc; - _defaultPageSize = defaultPageSize; - } - - public override async IAsyncEnumerable> AsPages(string? continuationToken = default, int? pageSizeHint = default) - { - Func>>? pageFunc = string.IsNullOrEmpty(continuationToken) ? _firstPageFunc : _nextPageFunc; - - if (pageFunc == null) - { - yield break; - } - - int? pageSize = pageSizeHint ?? _defaultPageSize; - do - { - ResultPage page = await pageFunc(continuationToken, pageSize).ConfigureAwait(false); - SetRawResponse(page.GetRawResponse()); - yield return page; - continuationToken = page.ContinuationToken; - pageFunc = _nextPageFunc; - } - while (!string.IsNullOrEmpty(continuationToken) && pageFunc != null); - } - } - - private class FuncPageable : PageableCollection where T : notnull - { - private readonly Func> _firstPageFunc; - private readonly Func>? _nextPageFunc; - private readonly int? _defaultPageSize; - - public FuncPageable(Func> firstPageFunc, Func>? nextPageFunc, int? defaultPageSize = default) - { - _firstPageFunc = firstPageFunc; - _nextPageFunc = nextPageFunc; - _defaultPageSize = defaultPageSize; - } - - public override IEnumerable> AsPages(string? continuationToken = default, int? pageSizeHint = default) - { - Func>? pageFunc = string.IsNullOrEmpty(continuationToken) ? _firstPageFunc : _nextPageFunc; - - if (pageFunc == null) - { - yield break; - } - - int? pageSize = pageSizeHint ?? _defaultPageSize; - do - { - ResultPage page = pageFunc(continuationToken, pageSize); - SetRawResponse(page.GetRawResponse()); - yield return page; - continuationToken = page.ContinuationToken; - pageFunc = _nextPageFunc; - } - while (!string.IsNullOrEmpty(continuationToken) && pageFunc != null); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Embeddings/AzureEmbeddingClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Embeddings/AzureEmbeddingClient.cs index 3748eedb05967..7bbdf247739ae 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Embeddings/AzureEmbeddingClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Embeddings/AzureEmbeddingClient.cs @@ -18,14 +18,14 @@ internal partial class AzureEmbeddingClient : EmbeddingClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureEmbeddingClient( - ClientPipeline pipeline, - string deploymentName, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, model: deploymentName, endpoint, null) + internal AzureEmbeddingClient(ClientPipeline pipeline, string deploymentName, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, model: deploymentName, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _deploymentName = deploymentName; _endpoint = endpoint; _apiVersion = options.Version; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.Protocol.cs index 60f5fc29764fe..07b8d3ccfbdd6 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.Protocol.cs @@ -4,7 +4,6 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; -using OpenAI.Files; namespace Azure.AI.OpenAI.Files; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs index b47727038bfc1..60eb3403f0dfb 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs @@ -18,13 +18,13 @@ internal partial class AzureFileClient : FileClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureFileClient( - ClientPipeline pipeline, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, endpoint, null) + internal AzureFileClient(ClientPipeline pipeline, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _endpoint = endpoint; _apiVersion = options.Version; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/FineTuning/AzureFineTuningClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/FineTuning/AzureFineTuningClient.cs index f1bb5dd67bbf2..5c69e1bdd2962 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/FineTuning/AzureFineTuningClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/FineTuning/AzureFineTuningClient.cs @@ -17,13 +17,13 @@ internal partial class AzureFineTuningClient : FineTuningClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureFineTuningClient( - ClientPipeline pipeline, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, endpoint, null) + internal AzureFineTuningClient(ClientPipeline pipeline, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _endpoint = endpoint; _apiVersion = options.Version; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureGeneratedImage.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureGeneratedImage.cs index ea7447c1833a8..d0adc6fa0db53 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureGeneratedImage.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureGeneratedImage.cs @@ -13,7 +13,7 @@ public static class AzureGeneratedImageExtensions public static ImageContentFilterResultForPrompt GetContentFilterResultForPrompt(this GeneratedImage image) { return AdditionalPropertyHelpers.GetAdditionalProperty( - image._serializedAdditionalRawData, + image.SerializedAdditionalRawData, "prompt_filter_results"); } @@ -21,7 +21,7 @@ public static ImageContentFilterResultForPrompt GetContentFilterResultForPrompt( public static ImageContentFilterResultForResponse GetContentFilterResultForResponse(this GeneratedImage image) { return AdditionalPropertyHelpers.GetAdditionalProperty( - image._serializedAdditionalRawData, + image.SerializedAdditionalRawData, "content_filter_results"); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureImageClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureImageClient.cs index be08662285f8b..ebeda9dae8bd7 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureImageClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureImageClient.cs @@ -18,14 +18,14 @@ internal partial class AzureImageClient : ImageClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureImageClient( - ClientPipeline pipeline, - string deploymentName, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, model: deploymentName, endpoint, null) + internal AzureImageClient(ClientPipeline pipeline, string deploymentName, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, model: deploymentName, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _deploymentName = deploymentName; _endpoint = endpoint; _apiVersion = options.Version; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/GeneratorStubs.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/GeneratorStubs.cs index 902382748c8b9..ba8c821f4e1a7 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/GeneratorStubs.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/GeneratorStubs.cs @@ -3,6 +3,6 @@ namespace Azure.AI.OpenAI; -[CodeGenModel("AzureOpenAIErrorResponseAzureOpenAiChatError")] internal partial class AzureOpenAIChatErrorResponse { } +[CodeGenModel("AzureOpenAIChatErrorResponse")] internal partial class AzureOpenAIChatErrorResponse { } -[CodeGenModel("AzureOpenAIErrorResponseAzureOpenAiDalleError")] internal partial class AzureOpenAIDalleErrorResponse { } +[CodeGenModel("AzureOpenAIDalleErrorResponse")] internal partial class AzureOpenAIDalleErrorResponse { } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.Protocol.cs index f76eba0893eb0..b14c3b56e6e23 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.Protocol.cs @@ -9,16 +9,16 @@ namespace Azure.AI.OpenAI.VectorStores; internal partial class AzureVectorStoreClient : VectorStoreClient { - public override async Task GetVectorStoresAsync(int? limit, string order, string after, string before, RequestOptions options) + public override IAsyncEnumerable GetVectorStoresAsync(int? limit, string order, string after, string before, RequestOptions options) { - using PipelineMessage message = CreateGetVectorStoresRequest(limit, order, after, before, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + AzureVectorStoresPageEnumerator enumerator = new(Pipeline, _endpoint, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - public override ClientResult GetVectorStores(int? limit, string order, string after, string before, RequestOptions options) + public override IEnumerable GetVectorStores(int? limit, string order, string after, string before, RequestOptions options) { - using PipelineMessage message = CreateGetVectorStoresRequest(limit, order, after, before, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureVectorStoresPageEnumerator enumerator = new(Pipeline, _endpoint, limit, order, after, before, _apiVersion,options); + return PageCollectionHelpers.Create(enumerator); } public override async Task CreateVectorStoreAsync(BinaryContent content, RequestOptions options = null) @@ -83,18 +83,20 @@ public override ClientResult DeleteVectorStore(string vectorStoreId, RequestOpti return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); } - public override async Task GetFileAssociationsAsync(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) + public override IAsyncEnumerable GetFileAssociationsAsync(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) { - using PipelineMessage message = CreateGetVectorStoreFilesRequest(vectorStoreId, limit, order, after, before, filter, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); + + AzureVectorStoreFilesPageEnumerator enumerator = new(Pipeline, _endpoint, vectorStoreId, limit, order, after, before, filter, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - public override ClientResult GetFileAssociations(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) + public override IEnumerable GetFileAssociations(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); - using PipelineMessage message = CreateGetVectorStoreFilesRequest(vectorStoreId, limit, order, after, before, filter, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureVectorStoreFilesPageEnumerator enumerator = new(Pipeline, _endpoint, vectorStoreId, limit, order, after, before, filter, _apiVersion, options); + return PageCollectionHelpers.Create(enumerator); } public override async Task AddFileToVectorStoreAsync(string vectorStoreId, BinaryContent content, RequestOptions options = null) @@ -205,36 +207,24 @@ public override ClientResult CancelBatchFileJob(string vectorStoreId, string bat return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); } - public override async Task GetFileAssociationsAsync(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) + public override IAsyncEnumerable GetFileAssociationsAsync(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); - using PipelineMessage message = CreateGetFilesInVectorStoreBatchesRequest(vectorStoreId, batchId, limit, order, after, before, filter, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + AzureVectorStoreFileBatchesPageEnumerator enumerator = new(Pipeline, _endpoint, vectorStoreId, batchId, limit, order, after, before, filter, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - public override ClientResult GetFileAssociations(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) + public override IEnumerable GetFileAssociations(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); - using PipelineMessage message = CreateGetFilesInVectorStoreBatchesRequest(vectorStoreId, batchId, limit, order, after, before, filter, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureVectorStoreFileBatchesPageEnumerator enumerator = new(Pipeline, _endpoint, vectorStoreId, batchId, limit, order, after, before, filter, _apiVersion, options); + return PageCollectionHelpers.Create(enumerator); } - private new PipelineMessage CreateGetVectorStoresRequest(int? limit, string order, string after, string before, RequestOptions options) - => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) - .WithMethod("GET") - .WithPath("vector_stores") - .WithOptionalQueryParameter("limit", limit) - .WithOptionalQueryParameter("order", order) - .WithOptionalQueryParameter("after", after) - .WithOptionalQueryParameter("before", before) - .WithAccept("application/json") - .WithOptions(options) - .Build(); - private new PipelineMessage CreateCreateVectorStoreRequest(BinaryContent content, RequestOptions options) => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) .WithMethod("POST") @@ -269,19 +259,6 @@ public override ClientResult GetFileAssociations(string vectorStoreId, string ba .WithOptions(options) .Build(); - private new PipelineMessage CreateGetVectorStoreFilesRequest(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) - => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) - .WithMethod("GET") - .WithPath("vector_stores", vectorStoreId, "files") - .WithOptionalQueryParameter("limit", limit) - .WithOptionalQueryParameter("order", order) - .WithOptionalQueryParameter("after", after) - .WithOptionalQueryParameter("before", before) - .WithOptionalQueryParameter("filter", filter) - .WithAccept("application/json") - .WithOptions(options) - .Build(); - private new PipelineMessage CreateCreateVectorStoreFileRequest(string vectorStoreId, BinaryContent content, RequestOptions options) => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) .WithMethod("POST") @@ -331,17 +308,4 @@ public override ClientResult GetFileAssociations(string vectorStoreId, string ba .WithAccept("application/json") .WithOptions(options) .Build(); - - private new PipelineMessage CreateGetFilesInVectorStoreBatchesRequest(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) - => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) - .WithMethod("GET") - .WithPath("vector_stores", vectorStoreId, "file_batches", batchId, "files") - .WithOptionalQueryParameter("limit", limit) - .WithOptionalQueryParameter("order", order) - .WithOptionalQueryParameter("after", after) - .WithOptionalQueryParameter("before", before) - .WithOptionalQueryParameter("filter", filter) - .WithAccept("application/json") - .WithOptions(options) - .Build(); } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.cs index 356598e139738..52b07ee81b6c6 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.cs @@ -19,13 +19,13 @@ internal partial class AzureVectorStoreClient : VectorStoreClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureVectorStoreClient( - ClientPipeline pipeline, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, endpoint, null) + internal AzureVectorStoreClient(ClientPipeline pipeline, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _endpoint = endpoint; _apiVersion = options.Version; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFileBatchesPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFileBatchesPageEnumerator.cs new file mode 100644 index 0000000000000..21ee0a3fbcf3c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFileBatchesPageEnumerator.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Azure.AI.OpenAI.VectorStores; + +internal partial class AzureVectorStoreFileBatchesPageEnumerator : VectorStoreFileBatchesPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureVectorStoreFileBatchesPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, vectorStoreId, batchId, limit, order, after, before, filter, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetFileAssociationsAsync(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); + Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); + + using PipelineMessage message = CreateGetFilesInVectorStoreBatchesRequest(vectorStoreId, batchId, limit, order, after, before, filter, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetFileAssociations(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); + Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); + + using PipelineMessage message = CreateGetFilesInVectorStoreBatchesRequest(vectorStoreId, batchId, limit, order, after, before, filter, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private new PipelineMessage CreateGetFilesInVectorStoreBatchesRequest(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithOptionalQueryParameter("filter", filter) + .WithPath("vector_stores", vectorStoreId, "file_batches", batchId, "files") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFilesPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFilesPageEnumerator.cs new file mode 100644 index 0000000000000..4152a4869afa6 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFilesPageEnumerator.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Azure.AI.OpenAI.VectorStores; + +internal partial class AzureVectorStoreFilesPageEnumerator : VectorStoreFilesPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureVectorStoreFilesPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + string vectorStoreId, + int? limit, string order, string after, string before, string filter, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, vectorStoreId, limit, order, after, before, filter, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetFileAssociationsAsync(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); + + using PipelineMessage message = CreateGetVectorStoreFilesRequest(vectorStoreId, limit, order, after, before, filter, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetFileAssociations(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); + + using PipelineMessage message = CreateGetVectorStoreFilesRequest(vectorStoreId, limit, order, after, before, filter, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private new PipelineMessage CreateGetVectorStoreFilesRequest(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithOptionalQueryParameter("filter", filter) + .WithPath("vector_stores", vectorStoreId, "files") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoresPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoresPageEnumerator.cs new file mode 100644 index 0000000000000..d8a90039f3315 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoresPageEnumerator.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Azure.AI.OpenAI.VectorStores; + +internal partial class AzureVectorStoresPageEnumerator : VectorStoresPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureVectorStoresPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + int? limit, string order, string after, string before, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, limit, order, after, before, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetVectorStoresAsync(int? limit, string order, string after, string before, RequestOptions options) + { + using PipelineMessage message = CreateGetVectorStoresRequest(limit, order, after, before, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetVectorStores(int? limit, string order, string after, string before, RequestOptions options) + { + using PipelineMessage message = CreateGetVectorStoresRequest(limit, order, after, before, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private new PipelineMessage CreateGetVectorStoresRequest(int? limit, string order, string after, string before, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithPath("vector_stores") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.Serialization.cs index 0abc4674a6689..7f9738eeaa69c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.Serialization.cs @@ -21,32 +21,39 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite } writer.WriteStartObject(); - writer.WritePropertyName("content"u8); - writer.WriteStringValue(Content); - if (Optional.IsDefined(Title)) + if (SerializedAdditionalRawData?.ContainsKey("content") != true) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + } + if (SerializedAdditionalRawData?.ContainsKey("title") != true && Optional.IsDefined(Title)) { writer.WritePropertyName("title"u8); writer.WriteStringValue(Title); } - if (Optional.IsDefined(Url)) + if (SerializedAdditionalRawData?.ContainsKey("url") != true && Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); writer.WriteStringValue(Url); } - if (Optional.IsDefined(Filepath)) + if (SerializedAdditionalRawData?.ContainsKey("filepath") != true && Optional.IsDefined(Filepath)) { writer.WritePropertyName("filepath"u8); writer.WriteStringValue(Filepath); } - if (Optional.IsDefined(ChunkId)) + if (SerializedAdditionalRawData?.ContainsKey("chunk_id") != true && Optional.IsDefined(ChunkId)) { writer.WritePropertyName("chunk_id"u8); writer.WriteStringValue(ChunkId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -117,6 +124,7 @@ internal static AzureChatCitation DeserializeAzureChatCitation(JsonElement eleme } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.cs index 4a520f0001a86..114bc7d3b7e35 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.cs @@ -40,8 +40,7 @@ public partial class AzureChatCitation /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// The content of the citation. /// is null. @@ -66,7 +65,7 @@ internal AzureChatCitation(string content, string title, string url, string file Url = url; Filepath = filepath; ChunkId = chunkId; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.Serialization.cs index 9f02fff75e5ae..76263b02bcf73 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.cs index 5f4475a29950c..01acaf5cf7c9b 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.cs @@ -47,8 +47,7 @@ public abstract partial class AzureChatDataSource /// /// /// - private protected IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . protected AzureChatDataSource() { @@ -60,7 +59,7 @@ protected AzureChatDataSource() internal AzureChatDataSource(string type, IDictionary serializedAdditionalRawData) { Type = type; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The differentiating type identifier for the data source. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.Serialization.cs index a47998cc51b94..40f6cd625219c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.Serialization.cs @@ -21,12 +21,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteStartObject(); - if (Optional.IsDefined(Intent)) + if (SerializedAdditionalRawData?.ContainsKey("intent") != true && Optional.IsDefined(Intent)) { writer.WritePropertyName("intent"u8); writer.WriteStringValue(Intent); } - if (Optional.IsCollectionDefined(Citations)) + if (SerializedAdditionalRawData?.ContainsKey("citations") != true && Optional.IsCollectionDefined(Citations)) { writer.WritePropertyName("citations"u8); writer.WriteStartArray(); @@ -36,15 +36,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteEndArray(); } - if (Optional.IsDefined(AllRetrievedDocuments)) + if (SerializedAdditionalRawData?.ContainsKey("all_retrieved_documents") != true && Optional.IsDefined(AllRetrievedDocuments)) { writer.WritePropertyName("all_retrieved_documents"u8); writer.WriteObjectValue(AllRetrievedDocuments, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -116,6 +120,7 @@ internal static AzureChatMessageContext DeserializeAzureChatMessageContext(JsonE } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.cs index f539840f9a874..dd23673682afa 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.cs @@ -43,8 +43,7 @@ public partial class AzureChatMessageContext /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal AzureChatMessageContext() { @@ -61,7 +60,7 @@ internal AzureChatMessageContext(string intent, IReadOnlyList Intent = intent; Citations = citations; AllRetrievedDocuments = allRetrievedDocuments; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The detected intent from the chat history, which is used to carry conversation context between interactions. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.Serialization.cs index bb79f75d53edf..963e4902b26c7 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.Serialization.cs @@ -21,56 +21,69 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteStartObject(); - writer.WritePropertyName("content"u8); - writer.WriteStringValue(Content); - if (Optional.IsDefined(Title)) + if (SerializedAdditionalRawData?.ContainsKey("content") != true) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + } + if (SerializedAdditionalRawData?.ContainsKey("title") != true && Optional.IsDefined(Title)) { writer.WritePropertyName("title"u8); writer.WriteStringValue(Title); } - if (Optional.IsDefined(Url)) + if (SerializedAdditionalRawData?.ContainsKey("url") != true && Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); writer.WriteStringValue(Url); } - if (Optional.IsDefined(Filepath)) + if (SerializedAdditionalRawData?.ContainsKey("filepath") != true && Optional.IsDefined(Filepath)) { writer.WritePropertyName("filepath"u8); writer.WriteStringValue(Filepath); } - if (Optional.IsDefined(ChunkId)) + if (SerializedAdditionalRawData?.ContainsKey("chunk_id") != true && Optional.IsDefined(ChunkId)) { writer.WritePropertyName("chunk_id"u8); writer.WriteStringValue(ChunkId); } - writer.WritePropertyName("search_queries"u8); - writer.WriteStartArray(); - foreach (var item in SearchQueries) + if (SerializedAdditionalRawData?.ContainsKey("search_queries") != true) { - writer.WriteStringValue(item); + writer.WritePropertyName("search_queries"u8); + writer.WriteStartArray(); + foreach (var item in SearchQueries) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } - writer.WriteEndArray(); - writer.WritePropertyName("data_source_index"u8); - writer.WriteNumberValue(DataSourceIndex); - if (Optional.IsDefined(OriginalSearchScore)) + if (SerializedAdditionalRawData?.ContainsKey("data_source_index") != true) + { + writer.WritePropertyName("data_source_index"u8); + writer.WriteNumberValue(DataSourceIndex); + } + if (SerializedAdditionalRawData?.ContainsKey("original_search_score") != true && Optional.IsDefined(OriginalSearchScore)) { writer.WritePropertyName("original_search_score"u8); writer.WriteNumberValue(OriginalSearchScore.Value); } - if (Optional.IsDefined(RerankScore)) + if (SerializedAdditionalRawData?.ContainsKey("rerank_score") != true && Optional.IsDefined(RerankScore)) { writer.WritePropertyName("rerank_score"u8); writer.WriteNumberValue(RerankScore.Value); } - if (Optional.IsDefined(FilterReason)) + if (SerializedAdditionalRawData?.ContainsKey("filter_reason") != true && Optional.IsDefined(FilterReason)) { writer.WritePropertyName("filter_reason"u8); - writer.WriteStringValue(FilterReason); + writer.WriteStringValue(FilterReason.Value.ToString()); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -114,7 +127,7 @@ internal static AzureChatRetrievedDocument DeserializeAzureChatRetrievedDocument int dataSourceIndex = default; double? originalSearchScore = default; double? rerankScore = default; - string filterReason = default; + AzureChatRetrievedDocumentFilterReason? filterReason = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -179,11 +192,16 @@ internal static AzureChatRetrievedDocument DeserializeAzureChatRetrievedDocument } if (property.NameEquals("filter_reason"u8)) { - filterReason = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + filterReason = new AzureChatRetrievedDocumentFilterReason(property.Value.GetString()); continue; } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.cs index f52465150cf9c..c0e4b0f9499fb 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.cs @@ -41,8 +41,7 @@ public partial class AzureChatRetrievedDocument /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// The content of the citation. /// The search queries executed to retrieve documents. @@ -70,7 +69,7 @@ internal AzureChatRetrievedDocument(string content, IEnumerable searchQu /// The rerank score for the retrieval. /// If applicable, an indication of why the document was filtered. /// Keeps track of any properties unknown to the library. - internal AzureChatRetrievedDocument(string content, string title, string url, string filepath, string chunkId, IReadOnlyList searchQueries, int dataSourceIndex, double? originalSearchScore, double? rerankScore, string filterReason, IDictionary serializedAdditionalRawData) + internal AzureChatRetrievedDocument(string content, string title, string url, string filepath, string chunkId, IReadOnlyList searchQueries, int dataSourceIndex, double? originalSearchScore, double? rerankScore, AzureChatRetrievedDocumentFilterReason? filterReason, IDictionary serializedAdditionalRawData) { Content = content; Title = title; @@ -82,7 +81,7 @@ internal AzureChatRetrievedDocument(string content, string title, string url, st OriginalSearchScore = originalSearchScore; RerankScore = rerankScore; FilterReason = filterReason; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. @@ -109,6 +108,6 @@ internal AzureChatRetrievedDocument() /// The rerank score for the retrieval. public double? RerankScore { get; } /// If applicable, an indication of why the document was filtered. - public string FilterReason { get; } + public AzureChatRetrievedDocumentFilterReason? FilterReason { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocumentFilterReason.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocumentFilterReason.cs index 4f967c1e54b8e..36be671328af9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocumentFilterReason.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocumentFilterReason.cs @@ -7,7 +7,7 @@ namespace Azure.AI.OpenAI.Chat { - /// Enum for filter_reason in AzureChatRetrievedDocument. + /// The AzureChatMessageContextAllRetrievedDocumentsFilterReason. public readonly partial struct AzureChatRetrievedDocumentFilterReason : IEquatable { private readonly string _value; @@ -41,7 +41,7 @@ public AzureChatRetrievedDocumentFilterReason(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.Serialization.cs index a1ae73bfad634..9b490f30b7035 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR } writer.WriteStartObject(); - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(InternalParameters, options); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static AzureCosmosDBChatDataSource DeserializeAzureCosmosDBChatDataSour } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.cs index abe8b534deac8..e33af59b87792 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.cs @@ -10,15 +10,5 @@ namespace Azure.AI.OpenAI.Chat /// Represents a data source configuration that will use an Azure CosmosDB resource. public partial class AzureCosmosDBChatDataSource : AzureChatDataSource { - /// Initializes a new instance of . - /// The parameter information to control the use of the Azure CosmosDB data source. - /// is null. - internal AzureCosmosDBChatDataSource(InternalAzureCosmosDBChatDataSourceParameters internalParameters) - { - Argument.AssertNotNull(internalParameters, nameof(internalParameters)); - - Type = "azure_cosmos_db"; - InternalParameters = internalParameters; - } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.Serialization.cs index 3b7cbcd774aaf..2384629e51846 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(InternalParameters, options); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static AzureMachineLearningIndexChatDataSource DeserializeAzureMachineL } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.cs index ca6ab72f7e238..7abef53a23bfc 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.cs @@ -10,15 +10,5 @@ namespace Azure.AI.OpenAI.Chat /// Represents a data source configuration that will use an Azure Machine Learning vector index. public partial class AzureMachineLearningIndexChatDataSource : AzureChatDataSource { - /// Initializes a new instance of . - /// The parameter information to control the use of the Azure Machine Learning Index data source. - /// is null. - internal AzureMachineLearningIndexChatDataSource(InternalAzureMachineLearningIndexChatDataSourceParameters internalParameters) - { - Argument.AssertNotNull(internalParameters, nameof(internalParameters)); - - Type = "azure_ml_index"; - InternalParameters = internalParameters; - } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs index 146842187d903..d4bda9baa41c2 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs @@ -21,35 +21,39 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteStartObject(); - if (Optional.IsDefined(Code)) + if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); writer.WriteStringValue(Code); } - if (Optional.IsDefined(Message)) + if (SerializedAdditionalRawData?.ContainsKey("message") != true && Optional.IsDefined(Message)) { writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - if (Optional.IsDefined(Param)) + if (SerializedAdditionalRawData?.ContainsKey("param") != true && Optional.IsDefined(Param)) { writer.WritePropertyName("param"u8); writer.WriteStringValue(Param); } - if (Optional.IsDefined(Type)) + if (SerializedAdditionalRawData?.ContainsKey("type") != true && Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); writer.WriteStringValue(Type); } - if (Optional.IsDefined(InnerError)) + if (SerializedAdditionalRawData?.ContainsKey("inner_error") != true && Optional.IsDefined(InnerError)) { writer.WritePropertyName("inner_error"u8); writer.WriteObjectValue(InnerError, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -124,6 +128,7 @@ internal static AzureOpenAIChatError DeserializeAzureOpenAIChatError(JsonElement } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs index 20fc58b7ddec5..b379c88ac0a8f 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs @@ -40,8 +40,7 @@ internal partial class AzureOpenAIChatError /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal AzureOpenAIChatError() { @@ -61,7 +60,7 @@ internal AzureOpenAIChatError(string code, string message, string param, string Param = param; Type = type; InnerError = innerError; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The distinct, machine-generated identifier for the error. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs index 85c9681a30026..a85c386fd313c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs @@ -21,15 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - if (Optional.IsDefined(Error)) + if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) { writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -80,6 +84,7 @@ internal static AzureOpenAIChatErrorResponse DeserializeAzureOpenAIChatErrorResp } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs index 457205815be0a..767fce2b029e4 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs @@ -40,8 +40,7 @@ internal partial class AzureOpenAIChatErrorResponse /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal AzureOpenAIChatErrorResponse() { @@ -53,7 +52,7 @@ internal AzureOpenAIChatErrorResponse() internal AzureOpenAIChatErrorResponse(AzureOpenAIChatError error, IDictionary serializedAdditionalRawData) { Error = error; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Gets the error. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs index 0ed549d7e4ff7..2498a9dac44b5 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs @@ -21,35 +21,39 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW } writer.WriteStartObject(); - if (Optional.IsDefined(Code)) + if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); writer.WriteStringValue(Code); } - if (Optional.IsDefined(Message)) + if (SerializedAdditionalRawData?.ContainsKey("message") != true && Optional.IsDefined(Message)) { writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - if (Optional.IsDefined(Param)) + if (SerializedAdditionalRawData?.ContainsKey("param") != true && Optional.IsDefined(Param)) { writer.WritePropertyName("param"u8); writer.WriteStringValue(Param); } - if (Optional.IsDefined(Type)) + if (SerializedAdditionalRawData?.ContainsKey("type") != true && Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); writer.WriteStringValue(Type); } - if (Optional.IsDefined(InnerError)) + if (SerializedAdditionalRawData?.ContainsKey("inner_error") != true && Optional.IsDefined(InnerError)) { writer.WritePropertyName("inner_error"u8); writer.WriteObjectValue(InnerError, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -124,6 +128,7 @@ internal static AzureOpenAIDalleError DeserializeAzureOpenAIDalleError(JsonEleme } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs index bccad3ff8b048..7dfb2de16f662 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs @@ -40,8 +40,7 @@ internal partial class AzureOpenAIDalleError /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal AzureOpenAIDalleError() { @@ -61,7 +60,7 @@ internal AzureOpenAIDalleError(string code, string message, string param, string Param = param; Type = type; InnerError = innerError; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The distinct, machine-generated identifier for the error. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs index dcee0fd4ed112..cdcc8bc203a65 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs @@ -21,15 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteStartObject(); - if (Optional.IsDefined(Error)) + if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) { writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -80,6 +84,7 @@ internal static AzureOpenAIDalleErrorResponse DeserializeAzureOpenAIDalleErrorRe } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs index ba6845a4e9c53..6aafb0c3d308e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs @@ -40,8 +40,7 @@ internal partial class AzureOpenAIDalleErrorResponse /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal AzureOpenAIDalleErrorResponse() { @@ -53,7 +52,7 @@ internal AzureOpenAIDalleErrorResponse() internal AzureOpenAIDalleErrorResponse(AzureOpenAIDalleError error, IDictionary serializedAdditionalRawData) { Error = error; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Gets the error. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs index 4bfba4dccd2a3..a9deddec3d6a6 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea } writer.WriteStartObject(); - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(InternalParameters, options); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static AzureSearchChatDataSource DeserializeAzureSearchChatDataSource(J } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs index 9517e98a84403..9c4af92dbc558 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs @@ -10,15 +10,5 @@ namespace Azure.AI.OpenAI.Chat /// Represents a data source configuration that will use an Azure Search resource. public partial class AzureSearchChatDataSource : AzureChatDataSource { - /// Initializes a new instance of . - /// The parameter information to control the use of the Azure Search data source. - /// is null. - internal AzureSearchChatDataSource(InternalAzureSearchChatDataSourceParameters internalParameters) - { - Argument.AssertNotNull(internalParameters, nameof(internalParameters)); - - Type = "azure_search"; - InternalParameters = internalParameters; - } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs index d05b34073d88e..a2f4dd0e63c47 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs @@ -21,9 +21,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - if (Optional.IsCollectionDefined(InternalDetails)) + if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + { + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + } + if (SerializedAdditionalRawData?.ContainsKey("details") != true && Optional.IsCollectionDefined(InternalDetails)) { writer.WritePropertyName("details"u8); writer.WriteStartArray(); @@ -33,10 +36,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -98,6 +105,7 @@ internal static ContentFilterBlocklistResult DeserializeContentFilterBlocklistRe } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs index 1ee18a931da81..d033e0e34b573 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs @@ -40,8 +40,7 @@ public partial class ContentFilterBlocklistResult /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// A value indicating whether any of the detailed blocklists resulted in a filtering action. internal ContentFilterBlocklistResult(bool filtered) @@ -58,7 +57,7 @@ internal ContentFilterBlocklistResult(bool filtered, IReadOnlyList Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs index bcfb766a30377..9c520fede22f7 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - writer.WritePropertyName("detected"u8); - writer.WriteBooleanValue(Detected); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + } + if (SerializedAdditionalRawData?.ContainsKey("detected") != true) + { + writer.WritePropertyName("detected"u8); + writer.WriteBooleanValue(Detected); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static ContentFilterDetectionResult DeserializeContentFilterDetectionRe } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs index 4656d749734c4..34aab24008fd9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs @@ -43,8 +43,7 @@ public partial class ContentFilterDetectionResult /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// Whether the content detection resulted in a content filtering action. /// Whether the labeled content category was detected in the content. @@ -62,7 +61,7 @@ internal ContentFilterDetectionResult(bool filtered, bool detected, IDictionary< { Filtered = filtered; Detected = detected; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.Serialization.cs index b96c25cf33a47..2e46d199231dd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.Serialization.cs @@ -21,20 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter } writer.WriteStartObject(); - if (Optional.IsDefined(License)) + if (SerializedAdditionalRawData?.ContainsKey("license") != true && Optional.IsDefined(License)) { writer.WritePropertyName("license"u8); writer.WriteStringValue(License); } - if (Optional.IsDefined(URL)) + if (SerializedAdditionalRawData?.ContainsKey("URL") != true && Optional.IsDefined(URL)) { writer.WritePropertyName("URL"u8); writer.WriteStringValue(URL.AbsoluteUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -91,6 +95,7 @@ internal static ContentFilterProtectedMaterialCitedResult DeserializeContentFilt } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.cs index 4cdc76468962a..0d83915066cfa 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.cs @@ -40,8 +40,7 @@ public partial class ContentFilterProtectedMaterialCitedResult /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal ContentFilterProtectedMaterialCitedResult() { @@ -55,7 +54,7 @@ internal ContentFilterProtectedMaterialCitedResult(string license, Uri url, IDic { License = license; URL = url; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The name or identifier of the license associated with the detection. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs index e03c9d9801880..1cf232dd83f8e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs @@ -21,19 +21,29 @@ void IJsonModel.Write(Utf8JsonWriter write } writer.WriteStartObject(); - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - writer.WritePropertyName("detected"u8); - writer.WriteBooleanValue(Detected); - if (Optional.IsDefined(Citation)) + if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + { + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + } + if (SerializedAdditionalRawData?.ContainsKey("detected") != true) + { + writer.WritePropertyName("detected"u8); + writer.WriteBooleanValue(Detected); + } + if (SerializedAdditionalRawData?.ContainsKey("citation") != true && Optional.IsDefined(Citation)) { writer.WritePropertyName("citation"u8); writer.WriteObjectValue(Citation, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -96,6 +106,7 @@ internal static ContentFilterProtectedMaterialResult DeserializeContentFilterPro } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs index ffa1be9b5f6cb..83551b0f313b9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs @@ -40,8 +40,7 @@ public partial class ContentFilterProtectedMaterialResult /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// Whether the content detection resulted in a content filtering action. /// Whether the labeled content category was detected in the content. @@ -61,7 +60,7 @@ internal ContentFilterProtectedMaterialResult(bool filtered, bool detected, Cont Filtered = filtered; Detected = detected; Citation = citation; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.Serialization.cs index 5f5daf4d721cf..552f85dfa9774 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.Serialization.cs @@ -20,20 +20,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - if (Optional.IsDefined(PromptIndex)) + if (SerializedAdditionalRawData?.ContainsKey("prompt_index") != true && Optional.IsDefined(PromptIndex)) { writer.WritePropertyName("prompt_index"u8); writer.WriteNumberValue(PromptIndex.Value); } - if (Optional.IsDefined(InternalResults)) + if (SerializedAdditionalRawData?.ContainsKey("content_filter_results") != true && Optional.IsDefined(InternalResults)) { writer.WritePropertyName("content_filter_results"u8); writer.WriteObjectValue(InternalResults, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.cs index 4be46282bb2d2..46aa27b09f487 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.cs @@ -40,8 +40,7 @@ public partial class ContentFilterResultForPrompt /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal ContentFilterResultForPrompt() { @@ -55,7 +54,7 @@ internal ContentFilterResultForPrompt(int? promptIndex, InternalAzureContentFilt { PromptIndex = promptIndex; InternalResults = internalResults; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.Serialization.cs index c698418fd18b0..5b2644c9cdc57 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.Serialization.cs @@ -21,55 +21,59 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod } writer.WriteStartObject(); - if (Optional.IsDefined(Sexual)) + if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (Optional.IsDefined(Hate)) + if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) { writer.WritePropertyName("hate"u8); writer.WriteObjectValue(Hate, options); } - if (Optional.IsDefined(Violence)) + if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (Optional.IsDefined(SelfHarm)) + if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (Optional.IsDefined(Profanity)) + if (SerializedAdditionalRawData?.ContainsKey("profanity") != true && Optional.IsDefined(Profanity)) { writer.WritePropertyName("profanity"u8); writer.WriteObjectValue(Profanity, options); } - if (Optional.IsDefined(CustomBlocklists)) + if (SerializedAdditionalRawData?.ContainsKey("custom_blocklists") != true && Optional.IsDefined(CustomBlocklists)) { writer.WritePropertyName("custom_blocklists"u8); writer.WriteObjectValue(CustomBlocklists, options); } - if (Optional.IsDefined(Error)) + if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) { writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); } - if (Optional.IsDefined(ProtectedMaterialText)) + if (SerializedAdditionalRawData?.ContainsKey("protected_material_text") != true && Optional.IsDefined(ProtectedMaterialText)) { writer.WritePropertyName("protected_material_text"u8); writer.WriteObjectValue(ProtectedMaterialText, options); } - if (Optional.IsDefined(ProtectedMaterialCode)) + if (SerializedAdditionalRawData?.ContainsKey("protected_material_code") != true && Optional.IsDefined(ProtectedMaterialCode)) { writer.WritePropertyName("protected_material_code"u8); writer.WriteObjectValue(ProtectedMaterialCode, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -200,6 +204,7 @@ internal static ContentFilterResultForResponse DeserializeContentFilterResultFor } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.cs index 9f246a878c7b2..5228ea56a732f 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.cs @@ -40,8 +40,7 @@ public partial class ContentFilterResultForResponse /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal ContentFilterResultForResponse() { @@ -88,7 +87,7 @@ internal ContentFilterResultForResponse(ContentFilterSeverityResult sexual, Cont Error = error; ProtectedMaterialText = protectedMaterialText; ProtectedMaterialCode = protectedMaterialCode; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs index 0797d4e213131..91a9f01a85283 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs @@ -7,7 +7,7 @@ namespace Azure.AI.OpenAI { - /// Enum for severity in ContentFilterSeverityResult. + /// The AzureContentFilterSeverityResultSeverity. public readonly partial struct ContentFilterSeverity : IEquatable { private readonly string _value; @@ -47,7 +47,7 @@ public ContentFilterSeverity(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs index 3152960f6c774..6f7da3ac8cab9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR } writer.WriteStartObject(); - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - writer.WritePropertyName("severity"u8); - writer.WriteStringValue(Severity.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + } + if (SerializedAdditionalRawData?.ContainsKey("severity") != true) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity.ToString()); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static ContentFilterSeverityResult DeserializeContentFilterSeverityResu } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs index 4e8f4c5bf4a75..95f0fa1bca5a2 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs @@ -43,8 +43,7 @@ public partial class ContentFilterSeverityResult /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// Whether the content severity resulted in a content filtering action. /// The labeled severity of the content. @@ -62,7 +61,7 @@ internal ContentFilterSeverityResult(bool filtered, ContentFilterSeverity severi { Filtered = filtered; Severity = severity; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs index 8fae7998c28a4..88ed804d94785 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs index 8ddcc9194e1b8..60914d91a96cd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs @@ -43,23 +43,22 @@ public abstract partial class DataSourceAuthentication /// /// /// - private protected IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . protected DataSourceAuthentication() { } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. internal DataSourceAuthentication(string type, IDictionary serializedAdditionalRawData) { Type = type; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets or sets the type. + /// Discriminator. internal string Type { get; set; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs index dcb933edfa5a4..7afbad202de1c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs @@ -21,22 +21,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteStartObject(); - if (Optional.IsDefined(TitleFieldName)) + if (SerializedAdditionalRawData?.ContainsKey("title_field") != true && Optional.IsDefined(TitleFieldName)) { writer.WritePropertyName("title_field"u8); writer.WriteStringValue(TitleFieldName); } - if (Optional.IsDefined(UrlFieldName)) + if (SerializedAdditionalRawData?.ContainsKey("url_field") != true && Optional.IsDefined(UrlFieldName)) { writer.WritePropertyName("url_field"u8); writer.WriteStringValue(UrlFieldName); } - if (Optional.IsDefined(FilepathFieldName)) + if (SerializedAdditionalRawData?.ContainsKey("filepath_field") != true && Optional.IsDefined(FilepathFieldName)) { writer.WritePropertyName("filepath_field"u8); writer.WriteStringValue(FilepathFieldName); } - if (Optional.IsCollectionDefined(ContentFieldNames)) + if (SerializedAdditionalRawData?.ContainsKey("content_fields") != true && Optional.IsCollectionDefined(ContentFieldNames)) { writer.WritePropertyName("content_fields"u8); writer.WriteStartArray(); @@ -46,12 +46,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteEndArray(); } - if (Optional.IsDefined(ContentFieldSeparator)) + if (SerializedAdditionalRawData?.ContainsKey("content_fields_separator") != true && Optional.IsDefined(ContentFieldSeparator)) { writer.WritePropertyName("content_fields_separator"u8); writer.WriteStringValue(ContentFieldSeparator); } - if (Optional.IsCollectionDefined(VectorFieldNames)) + if (SerializedAdditionalRawData?.ContainsKey("vector_fields") != true && Optional.IsCollectionDefined(VectorFieldNames)) { writer.WritePropertyName("vector_fields"u8); writer.WriteStartArray(); @@ -61,7 +61,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteEndArray(); } - if (Optional.IsCollectionDefined(ImageVectorFieldNames)) + if (SerializedAdditionalRawData?.ContainsKey("image_vector_fields") != true && Optional.IsCollectionDefined(ImageVectorFieldNames)) { writer.WritePropertyName("image_vector_fields"u8); writer.WriteStartArray(); @@ -71,10 +71,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -184,6 +188,7 @@ internal static DataSourceFieldMappings DeserializeDataSourceFieldMappings(JsonE } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs index c7e23aa399ae9..9933608ce0f91 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs @@ -40,7 +40,7 @@ public partial class DataSourceFieldMappings /// /// /// - private IDictionary _serializedAdditionalRawData; + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// The name of the index field to use as a title. @@ -60,7 +60,7 @@ internal DataSourceFieldMappings(string titleFieldName, string urlFieldName, str ContentFieldSeparator = contentFieldSeparator; VectorFieldNames = vectorFieldNames; ImageVectorFieldNames = imageVectorFieldNames; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs index 49396fc27ed4b..1f05c54d6d191 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs @@ -7,7 +7,7 @@ namespace Azure.AI.OpenAI.Chat { - /// Enum for query_type in InternalAzureSearchChatDataSourceParameters. + /// The AzureSearchChatDataSourceParametersQueryType. public readonly partial struct DataSourceQueryType : IEquatable { private readonly string _value; @@ -50,7 +50,7 @@ public DataSourceQueryType(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs index 5b5751331e99a..15db67fa01e66 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs index 25816e4cbf7ee..474c2459025bd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs @@ -43,8 +43,7 @@ public abstract partial class DataSourceVectorizer /// /// /// - private protected IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . protected DataSourceVectorizer() { @@ -56,7 +55,7 @@ protected DataSourceVectorizer() internal DataSourceVectorizer(string type, IDictionary serializedAdditionalRawData) { Type = type; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The differentiating identifier for the concrete vectorization source. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs index 0e9e4d77eb6cc..5265a931500b2 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR } writer.WriteStartObject(); - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(InternalParameters, options); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static ElasticsearchChatDataSource DeserializeElasticsearchChatDataSour } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs index 4150f7fd0bfaa..db281d1d672ef 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs @@ -10,15 +10,5 @@ namespace Azure.AI.OpenAI.Chat /// The ElasticsearchChatDataSource. public partial class ElasticsearchChatDataSource : AzureChatDataSource { - /// Initializes a new instance of . - /// The parameter information to control the use of the Elasticsearch data source. - /// is null. - internal ElasticsearchChatDataSource(InternalElasticsearchChatDataSourceParameters internalParameters) - { - Argument.AssertNotNull(internalParameters, nameof(internalParameters)); - - Type = "elasticsearch"; - InternalParameters = internalParameters; - } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForPrompt.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForPrompt.Serialization.cs index 519faf63fb414..1ecef8716b973 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForPrompt.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForPrompt.Serialization.cs @@ -21,42 +21,49 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - if (Optional.IsDefined(Profanity)) + if (SerializedAdditionalRawData?.ContainsKey("profanity") != true && Optional.IsDefined(Profanity)) { writer.WritePropertyName("profanity"u8); writer.WriteObjectValue(Profanity, options); } - if (Optional.IsDefined(CustomBlocklists)) + if (SerializedAdditionalRawData?.ContainsKey("custom_blocklists") != true && Optional.IsDefined(CustomBlocklists)) { writer.WritePropertyName("custom_blocklists"u8); writer.WriteObjectValue(CustomBlocklists, options); } - writer.WritePropertyName("jailbreak"u8); - writer.WriteObjectValue(Jailbreak, options); - if (Optional.IsDefined(Sexual)) + if (SerializedAdditionalRawData?.ContainsKey("jailbreak") != true) + { + writer.WritePropertyName("jailbreak"u8); + writer.WriteObjectValue(Jailbreak, options); + } + if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (Optional.IsDefined(Violence)) + if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (Optional.IsDefined(Hate)) + if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) { writer.WritePropertyName("hate"u8); writer.WriteObjectValue(Hate, options); } - if (Optional.IsDefined(SelfHarm)) + if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -163,6 +170,7 @@ internal static ImageContentFilterResultForPrompt DeserializeImageContentFilterR } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.Serialization.cs index 1bd39f772c613..d666cf634494b 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.Serialization.cs @@ -21,30 +21,34 @@ void IJsonModel.Write(Utf8JsonWriter writer } writer.WriteStartObject(); - if (Optional.IsDefined(Sexual)) + if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (Optional.IsDefined(Violence)) + if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (Optional.IsDefined(Hate)) + if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) { writer.WritePropertyName("hate"u8); writer.WriteObjectValue(Hate, options); } - if (Optional.IsDefined(SelfHarm)) + if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -125,6 +129,7 @@ internal static ImageContentFilterResultForResponse DeserializeImageContentFilte } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.cs index 360a6ed42196b..ed4b17e85436e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.cs @@ -40,8 +40,7 @@ public partial class ImageContentFilterResultForResponse /// /// /// - private protected IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal ImageContentFilterResultForResponse() { @@ -75,7 +74,7 @@ internal ImageContentFilterResultForResponse(ContentFilterSeverityResult sexual, Violence = violence; Hate = hate; SelfHarm = selfHarm; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs index 72d5f73e9f0a2..e6f35c5179043 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs @@ -52,6 +52,20 @@ public static BinaryContent FromEnumerable(IEnumerable enumerable) return content; } + public static BinaryContent FromEnumerable(ReadOnlySpan span) + where T : notnull + { + Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); + 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 BinaryContent FromDictionary(IDictionary dictionary) where TValue : notnull { diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs index 41970547ca198..aa2ae4da331ee 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs @@ -105,11 +105,7 @@ public void AppendQuery(string name, string value, bool escape) Argument.AssertNotNullOrWhiteSpace(name, nameof(name)); Argument.AssertNotNullOrWhiteSpace(value, nameof(value)); - if (QueryBuilder.Length == 0) - { - QueryBuilder.Append('?'); - } - else + if (QueryBuilder.Length > 0) { QueryBuilder.Append('&'); } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs index 66ba2975f7ca4..f4286bb0eeca4 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs @@ -15,6 +15,7 @@ namespace Azure.AI.OpenAI internal static class ModelSerializationExtensions { internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + internal static readonly BinaryData SentinelValue = BinaryData.FromObjectAsJson("__EMPTY__"); public static object GetObject(this JsonElement element) { @@ -249,6 +250,13 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, object value, Mo 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"; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs index 202b6d75f1610..344aed0274a71 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Wri } writer.WriteStartObject(); - writer.WritePropertyName("access_token"u8); - writer.WriteStringValue(AccessToken); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("access_token") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("access_token"u8); + writer.WriteStringValue(AccessToken); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static InternalAzureChatDataSourceAccessTokenAuthenticationOptions Dese } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs index 100d59d944eb5..2fbc3dc9f61e1 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs @@ -22,7 +22,7 @@ internal InternalAzureChatDataSourceAccessTokenAuthenticationOptions(string acce } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. /// internal InternalAzureChatDataSourceAccessTokenAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string accessToken) : base(type, serializedAdditionalRawData) diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs index a2f4a0765859f..4d448e27cf9e7 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Ut } writer.WriteStartObject(); - writer.WritePropertyName("key"u8); - writer.WriteStringValue(Key); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("key") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static InternalAzureChatDataSourceApiKeyAuthenticationOptions Deseriali } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs index 1fc56bc391dae..91325ee4cdf37 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs @@ -22,7 +22,7 @@ internal InternalAzureChatDataSourceApiKeyAuthenticationOptions(string key) } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. /// internal InternalAzureChatDataSourceApiKeyAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string key) : base(type, serializedAdditionalRawData) diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs index d19ee5f890d31..87563d7c14b9e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs index c3009f3da071b..aec71571077fd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs @@ -22,7 +22,7 @@ internal InternalAzureChatDataSourceConnectionStringAuthenticationOptions(string } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. /// internal InternalAzureChatDataSourceConnectionStringAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string connectionString) : base(type, serializedAdditionalRawData) diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs index 85066d58f3115..a322da00a07b4 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs @@ -21,19 +21,29 @@ void IJsonModel.Wr } writer.WriteStartObject(); - writer.WritePropertyName("deployment_name"u8); - writer.WriteStringValue(DeploymentName); - if (Optional.IsDefined(Dimensions)) + if (SerializedAdditionalRawData?.ContainsKey("deployment_name") != true) + { + writer.WritePropertyName("deployment_name"u8); + writer.WriteStringValue(DeploymentName); + } + if (SerializedAdditionalRawData?.ContainsKey("dimensions") != true && Optional.IsDefined(Dimensions)) { writer.WritePropertyName("dimensions"u8); writer.WriteNumberValue(Dimensions.Value); } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -96,6 +106,7 @@ internal static InternalAzureChatDataSourceDeploymentNameVectorizationSource Des } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs index 15e017f3abbc5..b24dfb4f4137e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.W } writer.WriteStartObject(); - writer.WritePropertyName("encoded_api_key"u8); - writer.WriteStringValue(EncodedApiKey); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("encoded_api_key") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("encoded_api_key"u8); + writer.WriteStringValue(EncodedApiKey); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions De } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs index 30ce92e8bad4e..bb4089d7c2a98 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs @@ -22,7 +22,7 @@ internal InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(string en } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. /// internal InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string encodedApiKey) : base(type, serializedAdditionalRawData) diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs index 595c4a1beb624..e984e66bca8a0 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs @@ -21,21 +21,34 @@ void IJsonModel.Write(Ut } writer.WriteStartObject(); - writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint.AbsoluteUri); - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - if (Optional.IsDefined(Dimensions)) + if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) + { + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint.AbsoluteUri); + } + if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (SerializedAdditionalRawData?.ContainsKey("dimensions") != true && Optional.IsDefined(Dimensions)) { writer.WritePropertyName("dimensions"u8); writer.WriteNumberValue(Dimensions.Value); } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -104,6 +117,7 @@ internal static InternalAzureChatDataSourceEndpointVectorizationSource Deseriali } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs index f40e3c402006c..3d1b11f308cc9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs @@ -21,16 +21,29 @@ void IJsonModel.Wri } writer.WriteStartObject(); - writer.WritePropertyName("key"u8); - writer.WriteStringValue(Key); - writer.WritePropertyName("key_id"u8); - writer.WriteStringValue(KeyId); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("key") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + if (SerializedAdditionalRawData?.ContainsKey("key_id") != true) + { + writer.WritePropertyName("key_id"u8); + writer.WriteStringValue(KeyId); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -89,6 +102,7 @@ internal static InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions Dese } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs index b9926635e9acd..9f6c3b3472225 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs @@ -25,7 +25,7 @@ internal InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(string key, } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. /// /// diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs index eb3ffa5240e8c..cbbae8276b91a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf } writer.WriteStartObject(); - writer.WritePropertyName("model_id"u8); - writer.WriteStringValue(ModelId); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("model_id") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("model_id"u8); + writer.WriteStringValue(ModelId); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static InternalAzureChatDataSourceModelIdVectorizationSource Deserializ } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs index 22482d4bbae19..3d97453fcfd27 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs index 82e24f04136ec..c08da9869e9e9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs @@ -17,7 +17,7 @@ internal InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationO } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. internal InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) { diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs index 79dfbf9ac919c..92a62ed8c6bb3 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs index 7520c37cb3536..20e6e6b2f8a09 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs @@ -22,7 +22,7 @@ internal InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOpt } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. /// internal InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string managedIdentityResourceId) : base(type, serializedAdditionalRawData) diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs index d98b952ed21f1..e00fc19ccf89d 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWrite } writer.WriteStartObject(); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("id") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + { + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static InternalAzureContentFilterBlocklistIdResult DeserializeInternalA } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs index be97bb59ac449..1950182689c49 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs @@ -43,8 +43,7 @@ internal partial class InternalAzureContentFilterBlocklistIdResult /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// The ID of the custom blocklist associated with the filtered status. /// Whether the associated blocklist resulted in the content being filtered. @@ -65,7 +64,7 @@ internal InternalAzureContentFilterBlocklistIdResult(string id, bool filtered, I { Id = id; Filtered = filtered; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs index b672c2bd27ef6..02ac4d99cbe97 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonW } writer.WriteStartObject(); - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + } + if (SerializedAdditionalRawData?.ContainsKey("id") != true) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static InternalAzureContentFilterBlocklistResultDetail DeserializeInter } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs index 10ca117585864..d0726035c32b4 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureContentFilterBlocklistResultDetail /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// A value indicating whether the blocklist produced a filtering action. /// The ID of the custom blocklist evaluated. @@ -62,7 +61,7 @@ internal InternalAzureContentFilterBlocklistResultDetail(bool filtered, string i { Filtered = filtered; Id = id; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs index 0891a044249ec..c2378dd522165 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs @@ -21,49 +21,59 @@ void IJsonModel.W } writer.WriteStartObject(); - if (Optional.IsDefined(Sexual)) + if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (Optional.IsDefined(Hate)) + if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) { writer.WritePropertyName("hate"u8); writer.WriteObjectValue(Hate, options); } - if (Optional.IsDefined(Violence)) + if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (Optional.IsDefined(SelfHarm)) + if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (Optional.IsDefined(Profanity)) + if (SerializedAdditionalRawData?.ContainsKey("profanity") != true && Optional.IsDefined(Profanity)) { writer.WritePropertyName("profanity"u8); writer.WriteObjectValue(Profanity, options); } - if (Optional.IsDefined(CustomBlocklists)) + if (SerializedAdditionalRawData?.ContainsKey("custom_blocklists") != true && Optional.IsDefined(CustomBlocklists)) { writer.WritePropertyName("custom_blocklists"u8); writer.WriteObjectValue(CustomBlocklists, options); } - if (Optional.IsDefined(Error)) + if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) { writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); } - writer.WritePropertyName("jailbreak"u8); - writer.WriteObjectValue(Jailbreak, options); - writer.WritePropertyName("indirect_attack"u8); - writer.WriteObjectValue(IndirectAttack, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("jailbreak") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("jailbreak"u8); + writer.WriteObjectValue(Jailbreak, options); + } + if (SerializedAdditionalRawData?.ContainsKey("indirect_attack") != true) + { + writer.WritePropertyName("indirect_attack"u8); + writer.WriteObjectValue(IndirectAttack, options); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -186,6 +196,7 @@ internal static InternalAzureContentFilterResultForPromptContentFilterResults De } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs index fb94ccc03cc4b..8c654f48774d8 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureContentFilterResultForPromptContentFilterRes /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit @@ -112,7 +111,7 @@ internal InternalAzureContentFilterResultForPromptContentFilterResults(ContentFi Error = error; Jailbreak = jailbreak; IndirectAttack = indirectAttack; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs index 2aca05ca5f639..24d22365ed03c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs index e312f31681979..af8b8a13fe2ac 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureContentFilterResultForPromptContentFilterRes /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// A distinct, machine-readable code associated with the error. /// A human-readable message associated with the error. @@ -62,7 +61,7 @@ internal InternalAzureContentFilterResultForPromptContentFilterResultsError(int { Code = code; Message = message; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs index 535e005b65efb..105a22779e076 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs @@ -21,37 +21,37 @@ void IJsonModel.Write(Utf8JsonWri } writer.WriteStartObject(); - if (Optional.IsDefined(TopNDocuments)) + if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (Optional.IsDefined(InScope)) + if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (Optional.IsDefined(Strictness)) + if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (Optional.IsDefined(RoleInformation)) + if (SerializedAdditionalRawData?.ContainsKey("role_information") != true && Optional.IsDefined(RoleInformation)) { writer.WritePropertyName("role_information"u8); writer.WriteStringValue(RoleInformation); } - if (Optional.IsDefined(MaxSearchQueries)) + if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (Optional.IsDefined(AllowPartialResult)) + if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (Optional.IsCollectionDefined(_internalIncludeContexts)) + if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); @@ -61,22 +61,44 @@ void IJsonModel.Write(Utf8JsonWri } writer.WriteEndArray(); } - writer.WritePropertyName("container_name"u8); - writer.WriteStringValue(ContainerName); - writer.WritePropertyName("database_name"u8); - writer.WriteStringValue(DatabaseName); - writer.WritePropertyName("embedding_dependency"u8); - writer.WriteObjectValue(VectorizationSource, options); - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - writer.WritePropertyName("fields_mapping"u8); - writer.WriteObjectValue(FieldMappings, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("container_name") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("container_name"u8); + writer.WriteStringValue(ContainerName); + } + if (SerializedAdditionalRawData?.ContainsKey("database_name") != true) + { + writer.WritePropertyName("database_name"u8); + writer.WriteStringValue(DatabaseName); + } + if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true) + { + writer.WritePropertyName("embedding_dependency"u8); + writer.WriteObjectValue(VectorizationSource, options); + } + if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + { + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + } + if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true) + { + writer.WritePropertyName("fields_mapping"u8); + writer.WriteObjectValue(FieldMappings, options); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -224,6 +246,7 @@ internal static InternalAzureCosmosDBChatDataSourceParameters DeserializeInterna } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs index fbd5a1f6d3606..69fcfdfdfb517 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureCosmosDBChatDataSourceParameters /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// /// @@ -122,7 +121,7 @@ internal InternalAzureCosmosDBChatDataSourceParameters(int? topNDocuments, bool? IndexName = indexName; Authentication = authentication; FieldMappings = fieldMappings; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.Serialization.cs index 18883335cf1f3..d5071162c444c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.Serialization.cs @@ -21,37 +21,37 @@ void IJsonModel.Write } writer.WriteStartObject(); - if (Optional.IsDefined(TopNDocuments)) + if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (Optional.IsDefined(InScope)) + if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (Optional.IsDefined(Strictness)) + if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (Optional.IsDefined(RoleInformation)) + if (SerializedAdditionalRawData?.ContainsKey("role_information") != true && Optional.IsDefined(RoleInformation)) { writer.WritePropertyName("role_information"u8); writer.WriteStringValue(RoleInformation); } - if (Optional.IsDefined(MaxSearchQueries)) + if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (Optional.IsDefined(AllowPartialResult)) + if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (Optional.IsCollectionDefined(_internalIncludeContexts)) + if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); @@ -61,23 +61,39 @@ void IJsonModel.Write } writer.WriteEndArray(); } - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - writer.WritePropertyName("project_resource_id"u8); - writer.WriteStringValue(ProjectResourceId); - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - writer.WritePropertyName("version"u8); - writer.WriteStringValue(Version); - if (Optional.IsDefined(Filter)) + if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (SerializedAdditionalRawData?.ContainsKey("project_resource_id") != true) + { + writer.WritePropertyName("project_resource_id"u8); + writer.WriteStringValue(ProjectResourceId); + } + if (SerializedAdditionalRawData?.ContainsKey("name") != true) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (SerializedAdditionalRawData?.ContainsKey("version") != true) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (SerializedAdditionalRawData?.ContainsKey("filter") != true && Optional.IsDefined(Filter)) { writer.WritePropertyName("filter"u8); writer.WriteStringValue(Filter); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -219,6 +235,7 @@ internal static InternalAzureMachineLearningIndexChatDataSourceParameters Deseri } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.cs index bdcbd127b7fde..571ad60a248b5 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureMachineLearningIndexChatDataSourceParameters /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// /// 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.. @@ -110,7 +109,7 @@ internal InternalAzureMachineLearningIndexChatDataSourceParameters(int? topNDocu Name = name; Version = version; Filter = filter; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs index 30b60e277e21e..6949337710749 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs @@ -21,25 +21,29 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - if (Optional.IsDefined(Code)) + if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); + writer.WriteStringValue(Code.Value.ToString()); } - if (Optional.IsDefined(RevisedPrompt)) + if (SerializedAdditionalRawData?.ContainsKey("revised_prompt") != true && Optional.IsDefined(RevisedPrompt)) { writer.WritePropertyName("revised_prompt"u8); writer.WriteStringValue(RevisedPrompt); } - if (Optional.IsDefined(ContentFilterResults)) + if (SerializedAdditionalRawData?.ContainsKey("content_filter_results") != true && Optional.IsDefined(ContentFilterResults)) { writer.WritePropertyName("content_filter_results"u8); writer.WriteObjectValue(ContentFilterResults, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -74,7 +78,7 @@ internal static InternalAzureOpenAIChatErrorInnerError DeserializeInternalAzureO { return null; } - string code = default; + InternalAzureOpenAIChatErrorInnerErrorCode? code = default; string revisedPrompt = default; ContentFilterResultForPrompt contentFilterResults = default; IDictionary serializedAdditionalRawData = default; @@ -83,7 +87,11 @@ internal static InternalAzureOpenAIChatErrorInnerError DeserializeInternalAzureO { if (property.NameEquals("code"u8)) { - code = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = new InternalAzureOpenAIChatErrorInnerErrorCode(property.Value.GetString()); continue; } if (property.NameEquals("revised_prompt"u8)) @@ -102,6 +110,7 @@ internal static InternalAzureOpenAIChatErrorInnerError DeserializeInternalAzureO } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs index 2f277d3512aa0..0912cd0164925 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureOpenAIChatErrorInnerError /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal InternalAzureOpenAIChatErrorInnerError() { @@ -52,16 +51,16 @@ internal InternalAzureOpenAIChatErrorInnerError() /// If applicable, the modified prompt used for generation. /// The content filter result details associated with the inner error. /// Keeps track of any properties unknown to the library. - internal InternalAzureOpenAIChatErrorInnerError(string code, string revisedPrompt, ContentFilterResultForPrompt contentFilterResults, IDictionary serializedAdditionalRawData) + internal InternalAzureOpenAIChatErrorInnerError(InternalAzureOpenAIChatErrorInnerErrorCode? code, string revisedPrompt, ContentFilterResultForPrompt contentFilterResults, IDictionary serializedAdditionalRawData) { Code = code; RevisedPrompt = revisedPrompt; ContentFilterResults = contentFilterResults; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The code associated with the inner error. - internal string Code { get; set; } + internal InternalAzureOpenAIChatErrorInnerErrorCode? Code { get; set; } /// If applicable, the modified prompt used for generation. internal string RevisedPrompt { get; set; } /// The content filter result details associated with the inner error. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs index 0935e739652a6..1e1ab2f0c3527 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs @@ -38,7 +38,7 @@ public InternalAzureOpenAIChatErrorInnerErrorCode(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs index c0bee377d52e0..328bdf127b74a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs @@ -21,25 +21,29 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); - if (Optional.IsDefined(Code)) + if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); + writer.WriteStringValue(Code.Value.ToString()); } - if (Optional.IsDefined(RevisedPrompt)) + if (SerializedAdditionalRawData?.ContainsKey("revised_prompt") != true && Optional.IsDefined(RevisedPrompt)) { writer.WritePropertyName("revised_prompt"u8); writer.WriteStringValue(RevisedPrompt); } - if (Optional.IsDefined(ContentFilterResults)) + if (SerializedAdditionalRawData?.ContainsKey("content_filter_results") != true && Optional.IsDefined(ContentFilterResults)) { writer.WritePropertyName("content_filter_results"u8); writer.WriteObjectValue(ContentFilterResults, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -74,7 +78,7 @@ internal static InternalAzureOpenAIDalleErrorInnerError DeserializeInternalAzure { return null; } - string code = default; + InternalAzureOpenAIDalleErrorInnerErrorCode? code = default; string revisedPrompt = default; ImageContentFilterResultForPrompt contentFilterResults = default; IDictionary serializedAdditionalRawData = default; @@ -83,7 +87,11 @@ internal static InternalAzureOpenAIDalleErrorInnerError DeserializeInternalAzure { if (property.NameEquals("code"u8)) { - code = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = new InternalAzureOpenAIDalleErrorInnerErrorCode(property.Value.GetString()); continue; } if (property.NameEquals("revised_prompt"u8)) @@ -102,6 +110,7 @@ internal static InternalAzureOpenAIDalleErrorInnerError DeserializeInternalAzure } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs index 48c9b31127f5b..d4b590f531cfe 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureOpenAIDalleErrorInnerError /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal InternalAzureOpenAIDalleErrorInnerError() { @@ -52,16 +51,16 @@ internal InternalAzureOpenAIDalleErrorInnerError() /// If applicable, the modified prompt used for generation. /// The content filter result details associated with the inner error. /// Keeps track of any properties unknown to the library. - internal InternalAzureOpenAIDalleErrorInnerError(string code, string revisedPrompt, ImageContentFilterResultForPrompt contentFilterResults, IDictionary serializedAdditionalRawData) + internal InternalAzureOpenAIDalleErrorInnerError(InternalAzureOpenAIDalleErrorInnerErrorCode? code, string revisedPrompt, ImageContentFilterResultForPrompt contentFilterResults, IDictionary serializedAdditionalRawData) { Code = code; RevisedPrompt = revisedPrompt; ContentFilterResults = contentFilterResults; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The code associated with the inner error. - internal string Code { get; set; } + internal InternalAzureOpenAIDalleErrorInnerErrorCode? Code { get; set; } /// If applicable, the modified prompt used for generation. internal string RevisedPrompt { get; set; } /// The content filter result details associated with the inner error. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs index 580f2ad8b4881..35cf2d97866f8 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs @@ -38,7 +38,7 @@ public InternalAzureOpenAIDalleErrorInnerErrorCode(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs index f4632f8ef02bc..d855a3a0c0237 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs @@ -21,37 +21,37 @@ void IJsonModel.Write(Utf8JsonWrite } writer.WriteStartObject(); - if (Optional.IsDefined(TopNDocuments)) + if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (Optional.IsDefined(InScope)) + if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (Optional.IsDefined(Strictness)) + if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (Optional.IsDefined(RoleInformation)) + if (SerializedAdditionalRawData?.ContainsKey("role_information") != true && Optional.IsDefined(RoleInformation)) { writer.WritePropertyName("role_information"u8); writer.WriteStringValue(RoleInformation); } - if (Optional.IsDefined(MaxSearchQueries)) + if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (Optional.IsDefined(AllowPartialResult)) + if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (Optional.IsCollectionDefined(_internalIncludeContexts)) + if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); @@ -61,41 +61,54 @@ void IJsonModel.Write(Utf8JsonWrite } writer.WriteEndArray(); } - writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint.AbsoluteUri); - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - if (Optional.IsDefined(FieldMappings)) + if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) + { + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint.AbsoluteUri); + } + if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + { + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + } + if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true && Optional.IsDefined(FieldMappings)) { writer.WritePropertyName("fields_mapping"u8); writer.WriteObjectValue(FieldMappings, options); } - if (Optional.IsDefined(QueryType)) + if (SerializedAdditionalRawData?.ContainsKey("query_type") != true && Optional.IsDefined(QueryType)) { writer.WritePropertyName("query_type"u8); writer.WriteStringValue(QueryType.Value.ToString()); } - if (Optional.IsDefined(SemanticConfiguration)) + if (SerializedAdditionalRawData?.ContainsKey("semantic_configuration") != true && Optional.IsDefined(SemanticConfiguration)) { writer.WritePropertyName("semantic_configuration"u8); writer.WriteStringValue(SemanticConfiguration); } - if (Optional.IsDefined(Filter)) + if (SerializedAdditionalRawData?.ContainsKey("filter") != true && Optional.IsDefined(Filter)) { writer.WritePropertyName("filter"u8); writer.WriteStringValue(Filter); } - if (Optional.IsDefined(VectorizationSource)) + if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true && Optional.IsDefined(VectorizationSource)) { writer.WritePropertyName("embedding_dependency"u8); writer.WriteObjectValue(VectorizationSource, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -267,6 +280,7 @@ internal static InternalAzureSearchChatDataSourceParameters DeserializeInternalA } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs index 709ec0b3586b5..470fb9c45c7e0 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureSearchChatDataSourceParameters /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// The absolute endpoint path for the Azure Search resource to use. /// The name of the index to use, as specified in the Azure Search resource. @@ -119,7 +118,7 @@ internal InternalAzureSearchChatDataSourceParameters(int? topNDocuments, bool? i SemanticConfiguration = semanticConfiguration; Filter = filter; VectorizationSource = vectorizationSource; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs new file mode 100644 index 0000000000000..90e6d867660da --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs @@ -0,0 +1,52 @@ +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI.Chat +{ + /// The AzureSearchChatDataSourceParametersIncludeContext. + internal readonly partial struct InternalAzureSearchChatDataSourceParametersIncludeContext : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public InternalAzureSearchChatDataSourceParametersIncludeContext(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CitationsValue = "citations"; + private const string IntentValue = "intent"; + private const string AllRetrievedDocumentsValue = "all_retrieved_documents"; + + /// citations. + internal static InternalAzureSearchChatDataSourceParametersIncludeContext Citations { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(CitationsValue); + /// intent. + internal static InternalAzureSearchChatDataSourceParametersIncludeContext Intent { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(IntentValue); + /// all_retrieved_documents. + internal static InternalAzureSearchChatDataSourceParametersIncludeContext AllRetrievedDocuments { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(AllRetrievedDocumentsValue); + /// Determines if two values are the same. + public static bool operator ==(InternalAzureSearchChatDataSourceParametersIncludeContext left, InternalAzureSearchChatDataSourceParametersIncludeContext right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(InternalAzureSearchChatDataSourceParametersIncludeContext left, InternalAzureSearchChatDataSourceParametersIncludeContext right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator InternalAzureSearchChatDataSourceParametersIncludeContext(string value) => new InternalAzureSearchChatDataSourceParametersIncludeContext(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is InternalAzureSearchChatDataSourceParametersIncludeContext other && Equals(other); + /// + public bool Equals(InternalAzureSearchChatDataSourceParametersIncludeContext 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/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs index 2151d8821137b..488442d4b557d 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs @@ -21,37 +21,37 @@ void IJsonModel.Write(Utf8JsonWri } writer.WriteStartObject(); - if (Optional.IsDefined(TopNDocuments)) + if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (Optional.IsDefined(InScope)) + if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (Optional.IsDefined(Strictness)) + if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (Optional.IsDefined(RoleInformation)) + if (SerializedAdditionalRawData?.ContainsKey("role_information") != true && Optional.IsDefined(RoleInformation)) { writer.WritePropertyName("role_information"u8); writer.WriteStringValue(RoleInformation); } - if (Optional.IsDefined(MaxSearchQueries)) + if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (Optional.IsDefined(AllowPartialResult)) + if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (Optional.IsCollectionDefined(_internalIncludeContexts)) + if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); @@ -61,31 +61,44 @@ void IJsonModel.Write(Utf8JsonWri } writer.WriteEndArray(); } - writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint.AbsoluteUri); - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - if (Optional.IsDefined(FieldMappings)) + if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) + { + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint.AbsoluteUri); + } + if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + { + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + } + if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true && Optional.IsDefined(FieldMappings)) { writer.WritePropertyName("fields_mapping"u8); writer.WriteObjectValue(FieldMappings, options); } - if (Optional.IsDefined(QueryType)) + if (SerializedAdditionalRawData?.ContainsKey("query_type") != true && Optional.IsDefined(QueryType)) { writer.WritePropertyName("query_type"u8); writer.WriteStringValue(QueryType.Value.ToString()); } - if (Optional.IsDefined(VectorizationSource)) + if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true && Optional.IsDefined(VectorizationSource)) { writer.WritePropertyName("embedding_dependency"u8); writer.WriteObjectValue(VectorizationSource, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -245,6 +258,7 @@ internal static InternalElasticsearchChatDataSourceParameters DeserializeInterna } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs index d65b16744c55b..fdfc831ab8a10 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs @@ -40,8 +40,7 @@ internal partial class InternalElasticsearchChatDataSourceParameters /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// /// @@ -111,7 +110,7 @@ internal InternalElasticsearchChatDataSourceParameters(int? topNDocuments, bool? FieldMappings = fieldMappings; QueryType = queryType; VectorizationSource = vectorizationSource; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs index 491fa1e282c95..e7acec9ad698d 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs @@ -21,37 +21,37 @@ void IJsonModel.Write(Utf8JsonWriter w } writer.WriteStartObject(); - if (Optional.IsDefined(TopNDocuments)) + if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (Optional.IsDefined(InScope)) + if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (Optional.IsDefined(Strictness)) + if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (Optional.IsDefined(RoleInformation)) + if (SerializedAdditionalRawData?.ContainsKey("role_information") != true && Optional.IsDefined(RoleInformation)) { writer.WritePropertyName("role_information"u8); writer.WriteStringValue(RoleInformation); } - if (Optional.IsDefined(MaxSearchQueries)) + if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (Optional.IsDefined(AllowPartialResult)) + if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (Optional.IsCollectionDefined(_internalIncludeContexts)) + if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); @@ -61,20 +61,39 @@ void IJsonModel.Write(Utf8JsonWriter w } writer.WriteEndArray(); } - writer.WritePropertyName("environment"u8); - writer.WriteStringValue(Environment); - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - writer.WritePropertyName("embedding_dependency"u8); - writer.WriteObjectValue(VectorizationSource, options); - writer.WritePropertyName("fields_mapping"u8); - writer.WriteObjectValue(FieldMappings, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("environment") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(Environment); + } + if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + { + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + } + if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true) + { + writer.WritePropertyName("embedding_dependency"u8); + writer.WriteObjectValue(VectorizationSource, options); + } + if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true) + { + writer.WritePropertyName("fields_mapping"u8); + writer.WriteObjectValue(FieldMappings, options); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -216,6 +235,7 @@ internal static InternalPineconeChatDataSourceParameters DeserializeInternalPine } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs index 1a3f983ce9538..2e19d59b5e7e4 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs @@ -40,8 +40,7 @@ internal partial class InternalPineconeChatDataSourceParameters /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// The environment name to use with Pinecone. /// The name of the Pinecone database index to use. @@ -131,7 +130,7 @@ internal InternalPineconeChatDataSourceParameters(int? topNDocuments, bool? inSc Authentication = authentication; VectorizationSource = vectorizationSource; FieldMappings = fieldMappings; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs index ce26fdefca2ac..140d7777d516c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -73,6 +80,7 @@ internal static InternalUnknownAzureChatDataSource DeserializeInternalUnknownAzu } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs index d25e6387b8c81..a852533c4a82e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -73,6 +80,7 @@ internal static InternalUnknownAzureChatDataSourceAuthenticationOptions Deserial } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs index 6d23a2b2f9a36..1833688883e8b 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs @@ -11,7 +11,7 @@ namespace Azure.AI.OpenAI.Chat internal partial class InternalUnknownAzureChatDataSourceAuthenticationOptions : DataSourceAuthentication { /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. internal InternalUnknownAzureChatDataSourceAuthenticationOptions(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) { diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs index 4d4ce41376101..ed6bccf0c5ad2 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -73,6 +80,7 @@ internal static InternalUnknownAzureChatDataSourceVectorizationSource Deserializ } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs index 1e480d6deb428..ca7bb2911d1cb 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader } writer.WriteStartObject(); - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(InternalParameters, options); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static PineconeChatDataSource DeserializePineconeChatDataSource(JsonEle } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs index e7f28473f9747..273aaca38f5c4 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs @@ -10,15 +10,5 @@ namespace Azure.AI.OpenAI.Chat /// The PineconeChatDataSource. public partial class PineconeChatDataSource : AzureChatDataSource { - /// Initializes a new instance of . - /// The parameter information to control the use of the Pinecone data source. - /// is null. - internal PineconeChatDataSource(InternalPineconeChatDataSourceParameters internalParameters) - { - Argument.AssertNotNull(internalParameters, nameof(internalParameters)); - - Type = "pinecone"; - InternalParameters = internalParameters; - } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Utility/AzureOpenAIPipelineMessageBuilder.cs b/sdk/openai/Azure.AI.OpenAI/src/Utility/AzureOpenAIPipelineMessageBuilder.cs index 58d1605661c61..07d5d37115dfc 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Utility/AzureOpenAIPipelineMessageBuilder.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Utility/AzureOpenAIPipelineMessageBuilder.cs @@ -57,6 +57,12 @@ public AzureOpenAIPipelineMessageBuilder WithOptionalQueryParameter(string na where T : struct, IConvertible => WithOptionalQueryParameter(name, value.HasValue ? Convert.ChangeType(value.Value, typeof(string)).ToString() : null); + public AzureOpenAIPipelineMessageBuilder WithCommonListParameters(int? limit, string order, string after, string before) + => WithOptionalQueryParameter("limit", limit) + .WithOptionalQueryParameter("order", order) + .WithOptionalQueryParameter("after", after) + .WithOptionalQueryParameter("before", before); + public AzureOpenAIPipelineMessageBuilder WithMethod(string requestMethod) { _method = requestMethod; @@ -76,6 +82,12 @@ public AzureOpenAIPipelineMessageBuilder WithHeader(string name, string value) return this; } + public AzureOpenAIPipelineMessageBuilder WithAssistantsHeader() + { + _headers[s_OpenAIBetaFeatureHeader] = s_OpenAIBetaAssistantsV2HeaderValue; + return this; + } + public AzureOpenAIPipelineMessageBuilder WithAccept(string acceptHeaderValue) => WithHeader("Accept", acceptHeaderValue); @@ -149,4 +161,7 @@ private void SetUri(PipelineRequest request) request.Uri = uriBuilder.ToUri(); } + + private static readonly string s_OpenAIBetaFeatureHeader = "OpenAI-Beta"; + private static readonly string s_OpenAIBetaAssistantsV2HeaderValue = "assistants=v2"; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Utility/CustomSerializationHelpers.cs b/sdk/openai/Azure.AI.OpenAI/src/Utility/CustomSerializationHelpers.cs new file mode 100644 index 0000000000000..23fc567fa2030 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Utility/CustomSerializationHelpers.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable enable + +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.AI.OpenAI; + +internal static partial class CustomSerializationHelpers +{ + internal static TOutput DeserializeNewInstance( + UInstanceInput existingInstance, + Func deserializationFunc, + ref Utf8JsonReader reader, + ModelReaderWriterOptions options) + where UInstanceInput : IJsonModel + { + options ??= new("W"); + var format = options.Format == "W" ? ((IJsonModel)existingInstance).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UInstanceInput)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return deserializationFunc.Invoke(document.RootElement, options); + } + + internal static TOutput DeserializeNewInstance( + UInstanceInput existingInstance, + Func deserializationFunc, + BinaryData data, + ModelReaderWriterOptions options) + where UInstanceInput : IPersistableModel + { + options ??= new("W"); + var format = options.Format == "W" ? ((IPersistableModel)existingInstance).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return deserializationFunc.Invoke(document.RootElement, options)!; + } + default: + throw new FormatException($"The model {nameof(UInstanceInput)} does not support '{format}' format."); + } + } + + internal static void SerializeInstance( + UInstanceInput instance, + Action serializationFunc, + Utf8JsonWriter writer, + ModelReaderWriterOptions options) + where UInstanceInput : IJsonModel + { + options ??= new ModelReaderWriterOptions("W"); + AssertSupportedJsonWriteFormat(instance, options); + serializationFunc.Invoke(instance, writer, options); + } + + internal static void SerializeInstance( + T instance, + Action serializationFunc, + Utf8JsonWriter writer, + ModelReaderWriterOptions options) + where T : IJsonModel + => SerializeInstance(instance, serializationFunc, writer, options); + + internal static BinaryData SerializeInstance( + UInstanceInput instance, + ModelReaderWriterOptions options) + where UInstanceInput : IPersistableModel + { + options ??= new("W"); + AssertSupportedPersistableWriteFormat(instance, options); + return ModelReaderWriter.Write(instance, options); + } + + internal static BinaryData SerializeInstance(T instance, ModelReaderWriterOptions options) + where T : IPersistableModel + => SerializeInstance(instance, options); + + internal static void AssertSupportedJsonWriteFormat(T instance, ModelReaderWriterOptions options) + where T : IJsonModel + => AssertSupportedJsonWriteFormat(instance, options); + + internal static void AssertSupportedJsonWriteFormat(UInstanceInput instance, ModelReaderWriterOptions options) + where UInstanceInput : IJsonModel + { + var format = options.Format == "W" ? ((IJsonModel)instance).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UInstanceInput)} does not support '{format}' format."); + } + } + + internal static void AssertSupportedPersistableWriteFormat(T instance, ModelReaderWriterOptions options) + where T : IPersistableModel + => AssertSupportedPersistableWriteFormat(instance, options); + + internal static void AssertSupportedPersistableWriteFormat(UInstanceInput instance, ModelReaderWriterOptions options) + where UInstanceInput : IPersistableModel + { + var format = options.Format == "W" ? ((IPersistableModel)instance).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UInstanceInput)} does not support '{format}' format."); + } + } + + internal static void WriteSerializedAdditionalRawData(this Utf8JsonWriter writer, IDictionary dictionary, ModelReaderWriterOptions options) + { + if (true && dictionary != null) + { + foreach (var item in dictionary) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using JsonDocument document = JsonDocument.Parse(item.Value); + JsonSerializer.Serialize(writer, document.RootElement); +#endif + } + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Utility/GenericActionPipelinePolicy.cs b/sdk/openai/Azure.AI.OpenAI/src/Utility/GenericActionPipelinePolicy.cs index a2b78d825c593..79e5ccc30bfbb 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Utility/GenericActionPipelinePolicy.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Utility/GenericActionPipelinePolicy.cs @@ -7,22 +7,26 @@ namespace Azure.AI.OpenAI; internal partial class GenericActionPipelinePolicy : PipelinePolicy { - private Action _processMessageAction; + private Action _requestAction; + private Action _responseAction; - public GenericActionPipelinePolicy(Action processMessageAction) + public GenericActionPipelinePolicy(Action requestAction = null, Action responseAction = null) { - _processMessageAction = processMessageAction; + _requestAction = requestAction; + _responseAction = responseAction; } public override void Process(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) { - _processMessageAction(message); + _requestAction?.Invoke(message.Request); ProcessNext(message, pipeline, currentIndex); + _responseAction?.Invoke(message.Response); } - public override ValueTask ProcessAsync(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) + public override async ValueTask ProcessAsync(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) { - _processMessageAction(message); - return ProcessNextAsync(message, pipeline, currentIndex); + _requestAction?.Invoke(message.Request); + await ProcessNextAsync(message, pipeline, currentIndex).ConfigureAwait(false); + _responseAction?.Invoke(message.Response); } } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs index 63d77bd85bd2f..409d311c9dbd4 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs @@ -9,7 +9,6 @@ using System.Diagnostics; using System.Linq; using System.Text; -using System.Threading; using System.Threading.Tasks; using Azure.AI.OpenAI.Tests.Utils.Config; using Azure.Core.TestFramework; @@ -80,10 +79,10 @@ public async Task BasicAssistantOperationsWork() }, }); Assert.That(modifiedAssistant.Id, Is.EqualTo(assistant.Id)); - AsyncPageableCollection recentAssistants = SyncOrAsync( + AsyncPageCollection recentAssistants = SyncOrAsync( client, c => c.GetAssistants(), c => c.GetAssistantsAsync()); Assistant recentAssistant = null; - await foreach (Assistant asyncAssistant in recentAssistants) + await foreach (Assistant asyncAssistant in recentAssistants.GetAllValuesAsync()) { recentAssistant = asyncAssistant; break; @@ -158,7 +157,7 @@ public async Task StreamingToolCall() { AssistantClient client = GetTestClient(); string modelName = client.DeploymentOrThrow(); - FunctionToolDefinition getWeatherTool = new("get_current_weather", "Gets the user's current weather"); + FunctionToolDefinition getWeatherTool = new("get_current_weather") { Description = "Gets the user's current weather" }; Assistant assistant = await client.CreateAssistantAsync(modelName, new() { Tools = { getWeatherTool } @@ -174,7 +173,7 @@ public async Task StreamingToolCall() { InitialMessages = { new(MessageRole.User, ["What should I wear outside right now?"]), }, }; - AsyncResultCollection asyncResults = SyncOrAsync(client, + AsyncCollectionResult asyncResults = SyncOrAsync(client, c => c.CreateThreadAndRunStreaming(assistant, thrdOpt), c => c.CreateThreadAndRunStreamingAsync(assistant, thrdOpt)); @@ -280,17 +279,16 @@ public async Task BasicMessageOperationsWork() [RecordedTest] public async Task ThreadWithInitialMessagesWorks() { + const string userGreeting = "Hello, world!"; + const string userQuestion = "Can you describe why stop signs are the shape and color that they are?"; + AssistantClient client = GetTestClient(); ThreadCreationOptions options = new() { InitialMessages = { - new ThreadInitializationMessage(MessageRole.User, ["Hello, world!"]), - new ThreadInitializationMessage(MessageRole.User, - [ - "Can you describe this image for me?", - MessageContent.FromImageUrl(new Uri("https://test.openai.com/image.png")) - ]) + new ThreadInitializationMessage(MessageRole.User, [userGreeting]), + new ThreadInitializationMessage(MessageRole.User, [ userQuestion ]) { Metadata = { @@ -299,20 +297,17 @@ public async Task ThreadWithInitialMessagesWorks() }, }, }; - AssistantThread thread = await client.CreateThreadAsync (options); + AssistantThread thread = await client.CreateThreadAsync(options); Validate(thread); List messageList = await SyncOrAsyncList(client, - c => c.GetMessages(thread, resultOrder: ListOrder.OldestFirst), - c => c.GetMessagesAsync(thread, resultOrder: ListOrder.OldestFirst)); + c => c.GetMessages(thread, new() { Order = ListOrder.OldestFirst }), + c => c.GetMessagesAsync(thread, new() { Order = ListOrder.OldestFirst })); Assert.That(messageList.Count, Is.EqualTo(2)); Assert.That(messageList[0].Role, Is.EqualTo(MessageRole.User)); Assert.That(messageList[0].Content?.Count, Is.EqualTo(1)); - Assert.That(messageList[0].Content[0].Text, Is.EqualTo("Hello, world!")); - Assert.That(messageList[1].Content?.Count, Is.EqualTo(2)); + Assert.That(messageList[0].Content[0].Text, Is.EqualTo(userGreeting)); Assert.That(messageList[1].Content[0], Is.Not.Null); - Assert.That(messageList[1].Content[0].Text, Is.EqualTo("Can you describe this image for me?")); - Assert.That(messageList[1].Content[1], Is.Not.Null); - Assert.That(messageList[1].Content[1].ImageUrl.AbsoluteUri, Is.EqualTo("https://test.openai.com/image.png")); + Assert.That(messageList[1].Content[0].Text, Is.EqualTo(userQuestion)); } [RecordedTest] @@ -498,8 +493,8 @@ public async Task FunctionToolsWork() Assert.That(run.Status, Is.EqualTo(RunStatus.Completed)); List messages = await SyncOrAsyncList(client, - c => c.GetMessages(run.ThreadId, resultOrder: ListOrder.NewestFirst), - c => c.GetMessagesAsync(run.ThreadId, resultOrder: ListOrder.NewestFirst)); + c => c.GetMessages(run.ThreadId, new() { Order = ListOrder.NewestFirst }), + c => c.GetMessagesAsync(run.ThreadId, new() { Order = ListOrder.NewestFirst })); Assert.That(messages.Count, Is.GreaterThan(1)); Assert.That(messages.ElementAt(0).Role, Is.EqualTo(MessageRole.Assistant)); Assert.That(messages.ElementAt(0).Content?[0], Is.Not.Null); @@ -602,12 +597,12 @@ This file describes the favorite foods of several people. r => r.Status.IsTerminal); Assert.That(run.Status, Is.EqualTo(RunStatus.Completed)); - AsyncPageableCollection messages = SyncOrAsync(client, - c => c.GetMessages(thread, resultOrder: ListOrder.NewestFirst), - c => c.GetMessagesAsync(thread, resultOrder: ListOrder.NewestFirst)); + AsyncPageCollection messages = SyncOrAsync(client, + c => c.GetMessages(thread, new() { Order = ListOrder.NewestFirst }), + c => c.GetMessagesAsync(thread, new() { Order = ListOrder.NewestFirst })); bool hasAtLeastOne = false; bool hasCake = false; - await foreach (ThreadMessage message in messages) + await foreach (ThreadMessage message in messages.GetAllValuesAsync()) { hasAtLeastOne = true; foreach (MessageContent content in message.Content) @@ -638,7 +633,7 @@ public async Task StreamingRunWorks() }); Validate(thread); - AsyncResultCollection streamingResult = SyncOrAsync(client, + AsyncCollectionResult streamingResult = SyncOrAsync(client, c => c.CreateRunStreaming(thread.Id, assistant.Id), c => c.CreateRunStreamingAsync(thread.Id, assistant.Id)); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj b/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj index 81d68704d1738..ca24c8445771d 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj +++ b/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj @@ -23,6 +23,15 @@ + + + + + diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Functions.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Functions.cs index d4a3437cf7024..acbc2223a879b 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Functions.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Functions.cs @@ -219,7 +219,7 @@ public async Task SimpleFunctionCallWorksStreaming(FunctionCallTestType function } }; - AsyncResultCollection response = SyncOrAsync(client, + AsyncCollectionResult response = SyncOrAsync(client, c => c.CompleteChatStreaming(messages, requestOptions), c => c.CompleteChatStreamingAsync(messages, requestOptions)); Assert.That(response, Is.Not.Null); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs index 52ef26ac41989..3f6e9617df035 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs @@ -251,7 +251,7 @@ public async Task SimpleToolWorksStreaming(ToolChoiceTestType toolChoice) } }; - AsyncResultCollection response = SyncOrAsync(client, + AsyncCollectionResult response = SyncOrAsync(client, c => c.CompleteChatStreaming(messages, requestOptions), c => c.CompleteChatStreamingAsync(messages, requestOptions)); Assert.That(response, Is.Not.Null); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Vision.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Vision.cs index 650db12f64fd9..6042122ea8370 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Vision.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Vision.cs @@ -114,7 +114,7 @@ public async Task ChatWithImagesStreaming(bool useUri) MaxTokens = 2048, }; - AsyncResultCollection response = SyncOrAsync(client, + AsyncCollectionResult response = SyncOrAsync(client, c => c.CompleteChatStreaming(messages, options), c => c.CompleteChatStreamingAsync(messages, options)); Assert.That(response, Is.Not.Null); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs index 43ba9180cd560..7fd32ef440d0e 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs @@ -393,7 +393,7 @@ public async Task ChatCompletionBadKeyGivesHelpfulErrorStreaming() ChatClient chatClient = GetTestClient(keyCredential: new ApiKeyCredential(mockKey)); var messages = new[] { new UserChatMessage("oops, this won't work with that key!") }; - AsyncResultCollection result = SyncOrAsync(chatClient, + AsyncCollectionResult result = SyncOrAsync(chatClient, c => c.CompleteChatStreaming(messages), c => c.CompleteChatStreamingAsync(messages)); @@ -433,7 +433,7 @@ public async Task ChatCompletionStreaming() TopLogProbabilityCount = 1, }; - AsyncResultCollection streamingResults = SyncOrAsync(chatClient, + AsyncCollectionResult streamingResults = SyncOrAsync(chatClient, c => c.CompleteChatStreaming(messages, options), c => c.CompleteChatStreamingAsync(messages, options)); Assert.That(streamingResults, Is.Not.Null); @@ -477,7 +477,7 @@ public async Task SearchExtensionWorksStreaming() ChatClient client = GetTestClient(); - AsyncResultCollection chatUpdates = SyncOrAsync(client, + AsyncCollectionResult chatUpdates = SyncOrAsync(client, c => c.CompleteChatStreaming(messages, options), c => c.CompleteChatStreamingAsync(messages, options)); Assert.IsNotNull(chatUpdates); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs index 00883f195a9d5..f1783bfe6db03 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs @@ -28,7 +28,7 @@ public async Task CanUploadAndDeleteFiles() "test_file_delete_me.txt", FileUploadPurpose.Assistants); Validate(file); - bool deleted = await client.DeleteFileAsync(file); + bool deleted = await client.DeleteFileAsync(file.Id); Assert.IsTrue(deleted); } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs index a5e185a556c99..e07912bef5910 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs @@ -52,7 +52,7 @@ public async Task CanCreateSimpleImage() { Quality = GeneratedImageQuality.Standard, Size = GeneratedImageSize.W1024xH1024, - User = "test_user", + EndUserId = "test_user", ResponseFormat = GeneratedImageFormat.Bytes, }); Assert.That(image, Is.Not.Null); @@ -67,7 +67,7 @@ public async Task CanGetContentFilterResults() { Quality = GeneratedImageQuality.Standard, Size = GeneratedImageSize.W1024xH1024, - User = "test_user", + EndUserId = "test_user", ResponseFormat = GeneratedImageFormat.Uri, }); GeneratedImage image = imageResult.Value; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs b/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs index 6bb3a27872fa4..ca8fbb03bbc8f 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs @@ -51,7 +51,7 @@ public void StreamingChat() new DefaultAzureCredential()); ChatClient chatClient = azureClient.GetChatClient("my-gpt-35-turbo-deployment"); - ResultCollection completionUpdates = chatClient.CompleteChatStreaming( + CollectionResult completionUpdates = chatClient.CompleteChatStreaming( [ new SystemChatMessage("You are a helpful assistant that talks like a pirate."), new UserChatMessage("Hi, can you help me?"), diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs index 6dcbb9a1d5c1b..5fb0440c0e572 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs @@ -38,6 +38,7 @@ namespace Azure.AI.OpenAI.Tests; public class AoaiTestBase : RecordedTestBase { private const string AZURE_URI_SANITIZER_PATTERN = @"(?<=/(subscriptions|resourceGroups|accounts)/)([^/]+?)(?=(/|$))"; + private const string SMALL_1x1_PNG = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiQAABYkAZsVxhQAAAAMSURBVBhXY2BgYAAAAAQAAVzN/2kAAAAASUVORK5CYII="; public static readonly DateTimeOffset START_2024 = new DateTimeOffset(2024, 01, 01, 00, 00, 00, TimeSpan.Zero); public static readonly DateTimeOffset UNIX_EPOCH = @@ -101,6 +102,18 @@ protected AoaiTestBase(bool isAsync, RecordedTestMode? mode = null) RecordingDisabler.DisableBodyRecordingFor(nameof(FileClient.UploadFileAsync)); IgnoredHeaders.Add("x-ms-client-request-id"); + + // Data URIs trimmed to prevent the recording from being too large + BodyKeySanitizers.Add(new BodyKeySanitizer("$..url") + { + Regex = @"(?<=data:image/png;base64,)(.+)", + Value = SMALL_1x1_PNG + }); + // Base64 encoded images in the response are replaced with a 1x1 black pixel PNG image to ensure valid data + BodyKeySanitizers.Add(new BodyKeySanitizer($"..b64_json") + { + Value = SMALL_1x1_PNG + }); } /// @@ -666,7 +679,7 @@ protected virtual TModel ValidateAndParse(ClientResult result, JsonSeria return model!; } - protected AsyncResultCollection SyncOrAsync(TClient client, Func> sync, Func> async) + protected AsyncCollectionResult SyncOrAsync(TClient client, Func> sync, Func> async) { // TODO FIXME HACK Since the test framework doesn't currently support async result collection, this methods provides // a simplified way to make explicit calls to the right methods in tests @@ -678,12 +691,12 @@ protected AsyncResultCollection SyncOrAsync(TClient client, Func syncCollection = sync(rawClient); - return new SyncToAsyncResultCollection(syncCollection); + CollectionResult syncCollection = sync(rawClient); + return new SyncToAsyncCollectionResult(syncCollection); } } - protected AsyncPageableCollection SyncOrAsync(TClient client, Func> sync, Func> async) + protected AsyncPageCollection SyncOrAsync(TClient client, Func> sync, Func> async) { // TODO FIXME HACK Since the test framework doesn't currently support async result collection, this methods provides // a simplified way to make explicit calls to the right methods in tests @@ -695,12 +708,12 @@ protected AsyncPageableCollection SyncOrAsync(TClient client, Func syncCollection = sync(rawClient); - return new SyncToAsyncPageableCollection(syncCollection); + PageCollection syncCollection = sync(rawClient); + return new SyncToAsyncPageCollection(syncCollection); } } - protected Task> SyncOrAsyncList(TClient client, Func> sync, Func> async) + protected Task> SyncOrAsyncList(TClient client, Func> sync, Func> async) { // TODO FIXME HACK Since the test framework doesn't currently support async result collection, this methods provides // a simplified way to make explicit calls to the right methods in tests @@ -708,11 +721,11 @@ protected Task> SyncOrAsyncList(TClient client, Func certificate?.Issuer == certIssuer, - UseCookies = Core.AppContextSwitchHelper.GetConfigValue( - "Azure.Core.Pipeline.HttpClientTransport.EnableCookies", - "AZURE_CORE_HTTPCLIENT_ENABLE_COOKIES"), + UseCookies = false, AllowAutoRedirect = false }; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncCollectionResult.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncCollectionResult.cs new file mode 100644 index 0000000000000..3b0d4c799deb7 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncCollectionResult.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable enable + +using System; +using System.ClientModel; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; +using System.Threading; + +namespace Azure.AI.OpenAI.Tests.Utils; + +/// +/// An adapter to make a look and work like a . This +/// simplifies writing test cases +/// +/// The type of the items the enumerator returns +public class SyncToAsyncCollectionResult : AsyncCollectionResult +{ + private bool _responseSet; + private CollectionResult? _syncCollection; + private Exception? _ex; + + /// + /// Creates a new instance + /// + /// The synchronous collection to wrap + /// If the collection was null + public SyncToAsyncCollectionResult(CollectionResult syncCollection) + { + _syncCollection = syncCollection ?? throw new ArgumentNullException(nameof(syncCollection)); + TrySetRawResponse(); + } + + /// + /// Creates a new instance. + /// + /// The exception to throw. + /// If the exception was null. + public SyncToAsyncCollectionResult(Exception ex) + { + _ex = ex ?? throw new ArgumentNullException(nameof(ex)); + _syncCollection = null; + } + + /// + public override IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return InnerEnumerable(cancellationToken).GetAsyncEnumerator(); + } + + private async IAsyncEnumerable InnerEnumerable([EnumeratorCancellation] CancellationToken cancellationToken = default) + { + if (_ex != null) + { + ExceptionDispatchInfo.Capture(_ex).Throw(); + } + + var asyncWrapper = new SyncToAsyncEnumerator(_syncCollection?.GetEnumerator()!, cancellationToken); + while (await asyncWrapper.MoveNextAsync().ConfigureAwait(false)) + { + TrySetRawResponse(); + yield return asyncWrapper.Current; + } + } + + private void TrySetRawResponse() + { + if (_responseSet) + { + return; + } + + // Client result doesn't provide virtual methods so we have to manually set it ourselves here + try + { + var raw = _syncCollection?.GetRawResponse(); + if (raw != null) + { + SetRawResponse(raw); + _responseSet = true; + } + } + catch (Exception) { /* dont' care */ } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageCollection.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageCollection.cs new file mode 100644 index 0000000000000..9f73b587f267e --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageCollection.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable enable + +using System; +using System.ClientModel; +using System.Collections.Generic; +using System.Runtime.ExceptionServices; +using System.Threading.Tasks; +using System.Threading; + +namespace Azure.AI.OpenAI.Tests.Utils; + +/// +/// An adapter to make a look and work like a . This +/// simplifies writing test cases. +/// +/// The type of the items the enumerator returns. +public class SyncToAsyncPageCollection : AsyncPageCollection +{ + private PageCollection? _syncCollection; + private Exception? _ex; + + /// + /// Creates a new instance. + /// + /// The synchronous collection to wrap. + /// If the collection was null. + public SyncToAsyncPageCollection(PageCollection syncCollection) + { + _syncCollection = syncCollection ?? throw new ArgumentNullException(nameof(syncCollection)); + } + + /// + /// Creates a new instance. + /// + /// The exception to throw. + /// If the exception was null. + public SyncToAsyncPageCollection(Exception ex) + { + _ex = ex ?? throw new ArgumentNullException(nameof(ex)); + _syncCollection = null; + } + + /// + protected override Task> GetCurrentPageAsyncCore() + { + if (_ex != null) + { + return Task.FromException>(_ex); + } + else + { + return Task.FromResult(_syncCollection!.GetCurrentPage()); + } + } + + /// + protected override async IAsyncEnumerator> GetAsyncEnumeratorCore(CancellationToken cancellationToken = default) + { + if (_ex != null) + { + ExceptionDispatchInfo.Capture(_ex).Throw(); + } + + foreach (PageResult page in _syncCollection!) + { + await Task.Delay(0).ConfigureAwait(false); + yield return page; + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageableCollection.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageableCollection.cs deleted file mode 100644 index 4c86f840cacc7..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageableCollection.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.ClientModel; -using System.Collections.Generic; -using System.Runtime.ExceptionServices; - -namespace Azure.AI.OpenAI.Tests.Utils -{ - /// - /// An adapter to make a look and work like a . This - /// simplifies writing test cases. - /// - /// The type of the items the enumerator returns. - public class SyncToAsyncPageableCollection : AsyncPageableCollection - { - private PageableCollection _syncCollection; - private Exception? _ex; - - /// - /// Creates a new instance. - /// - /// The synchronous collection to wrap. - /// If the collection was null. - public SyncToAsyncPageableCollection(PageableCollection syncCollection) - { - _syncCollection = syncCollection ?? throw new ArgumentNullException(nameof(syncCollection)); - } - - /// - /// Creates a new instance. - /// - /// The exception to throw. - /// If the exception was null. - public SyncToAsyncPageableCollection(Exception ex) - { - _ex = ex ?? throw new ArgumentNullException(nameof(ex)); - _syncCollection = null!; - } - - /// - public override async IAsyncEnumerable> AsPages(string? continuationToken = null, int? pageSizeHint = null) - { - if (_ex != null) - { - ExceptionDispatchInfo.Capture(_ex).Throw(); - } - - IEnumerable> syncEnumerable = _syncCollection.AsPages(continuationToken, pageSizeHint); - var asyncWrapper = new SyncToAsyncEnumerator>(syncEnumerable.GetEnumerator()); - while (await asyncWrapper.MoveNextAsync().ConfigureAwait(false)) - { - TrySetRawResponse(); - yield return asyncWrapper.Current; - } - } - - private void TrySetRawResponse() - { - // Client result doesn't provide virtual methods so we have to manually set it ourselves here - try - { - var raw = _syncCollection.GetRawResponse(); - if (raw != null) - { - SetRawResponse(raw); - } - } - catch (Exception) { /* dont' care */ } - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncResultCollection.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncResultCollection.cs deleted file mode 100644 index c75a8d919d80c..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncResultCollection.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.ClientModel; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Threading; - -namespace Azure.AI.OpenAI.Tests.Utils -{ - /// - /// An adapter to make a look and work like a . This - /// simplifies writing test cases - /// - /// The type of the items the enumerator returns - public class SyncToAsyncResultCollection : AsyncResultCollection - { - private ResultCollection _syncCollection; - - /// - /// Creates a new instance - /// - /// The synchronous collection to wrap - /// If the collection was null - public SyncToAsyncResultCollection(ResultCollection syncCollection) - { - _syncCollection = syncCollection ?? throw new ArgumentNullException(nameof(syncCollection)); - } - - /// - public override IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) - { - return InnerEnumerable(cancellationToken).GetAsyncEnumerator(); - } - - private async IAsyncEnumerable InnerEnumerable([EnumeratorCancellation]CancellationToken cancellationToken = default) - { - var asyncWrapper = new SyncToAsyncEnumerator(_syncCollection.GetEnumerator(), cancellationToken); - while (await asyncWrapper.MoveNextAsync().ConfigureAwait(false)) - { - TrySetRawResponse(); - yield return asyncWrapper.Current; - } - } - - private void TrySetRawResponse() - { - // Client result doesn't provide virtual methods so we have to manually set it ourselves here - try - { - var raw = _syncCollection.GetRawResponse(); - if (raw != null) - { - SetRawResponse(raw); - } - } - catch (Exception) { /* dont' care */ } - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestConfig.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestConfig.cs index 577b76e865cca..fd90099744d2a 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestConfig.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestConfig.cs @@ -57,8 +57,8 @@ public TestConfig(RecordedTestMode? mode) { AssetsJson, Path.Combine(AssetsSubFolder, AssetsJson), - Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".Azure", AssetsSubFolder, AssetsJson), - Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), ".Azure", AssetsSubFolder, AssetsJson), + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".azure", AssetsSubFolder, AssetsJson), + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), ".azure", AssetsSubFolder, AssetsJson), } .Select(f => ReadJsonConfig(f)) .FirstOrDefault(c => c != null) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs index a2ff076301853..770a1cd253997 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs @@ -112,14 +112,14 @@ public async Task CanEnumerateVectorStores() } - AsyncPageableCollection response = SyncOrAsync(client, - c => c.GetVectorStores(ListOrder.NewestFirst), - c => c.GetVectorStoresAsync(ListOrder.NewestFirst)); + AsyncPageCollection response = SyncOrAsync(client, + c => c.GetVectorStores(new VectorStoreCollectionOptions() { Order = ListOrder.NewestFirst }), + c => c.GetVectorStoresAsync(new VectorStoreCollectionOptions() { Order = ListOrder.NewestFirst })); Assert.That(response, Is.Not.Null); int lastIdSeen = int.MaxValue; int count = 0; - await foreach (VectorStore vectorStore in response) + await foreach (VectorStore vectorStore in response.GetAllValuesAsync()) { Assert.That(vectorStore.Id, Is.Not.Null); if (vectorStore.Name?.StartsWith("Test Vector Store ") == true) @@ -169,10 +169,10 @@ public async Task CanAssociateFiles() Thread.Sleep(1000); int count = 0; - AsyncPageableCollection response = SyncOrAsync(client, + AsyncPageCollection response = SyncOrAsync(client, c => c.GetFileAssociations(vectorStore), c => c.GetFileAssociationsAsync(vectorStore)); - await foreach (VectorStoreFileAssociation association in response) + await foreach (VectorStoreFileAssociation association in response.GetAllValuesAsync()) { count++; Assert.That(association.FileId, Is.Not.EqualTo(files[0].Id)); @@ -205,10 +205,10 @@ public async Task CanUseBatchIngestion() b => b.Status != VectorStoreBatchFileJobStatus.InProgress); Assert.That(batchJob.Status, Is.EqualTo(VectorStoreBatchFileJobStatus.Completed)); - AsyncPageableCollection response = SyncOrAsync(client, + AsyncPageCollection response = SyncOrAsync(client, c => c.GetFileAssociations(batchJob), c => c.GetFileAssociationsAsync(batchJob)); - await foreach (VectorStoreFileAssociation association in response) + await foreach (VectorStoreFileAssociation association in response.GetAllValuesAsync()) { Assert.Multiple(() => { From aa2a6e735e98a61b8b5085a816e4af81998ea50c Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Sat, 24 Aug 2024 07:20:06 -0700 Subject: [PATCH 23/71] Increment package version after release of Azure.AI.OpenAI (#45666) --- sdk/openai/Azure.AI.OpenAI/CHANGELOG.md | 10 ++++++++++ sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md b/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md index 972422632d617..09686f6a739e6 100644 --- a/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md +++ b/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 2.0.0-beta.4 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 2.0.0-beta.3 (2024-08-23) This change updates the library for compatibility with the latest `2.0.0-beta.9` of the `OpenAI` package and the `2024-07-01-preview` Azure OpenAI service API version label, as published on 8/5. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj b/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj index 00d702ca8473c..6bff57bff887f 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj +++ b/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj @@ -1,11 +1,11 @@ - + Azure OpenAI's official extension package for using OpenAI's .NET library with the Azure OpenAI Service. Azure.AI.OpenAI Client Library - 2.0.0-beta.3 + 2.0.0-beta.4 Microsoft Azure OpenAI true $(RequiredTargetFrameworks) From d91fe79172e74b1a6418d049c242ec9f4fc8fcb6 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Sun, 25 Aug 2024 11:36:18 -0700 Subject: [PATCH 24/71] Sync eng/common directory with azure-sdk-tools for PR 8865 (#45627) * bump proxy version * bump proxy version * restore most of the old performance, only fall back to json matching when something goes wrong * use newest version with protection from invalid json * update target proxy version --------- Co-authored-by: Scott Beddall --- eng/Packages.Data.props | 2 +- eng/common/testproxy/target_version.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index c6c97a76c82bc..0261171b2f476 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -388,7 +388,7 @@ - 1.0.0-dev.20240806.1 + 1.0.0-dev.20240823.1 diff --git a/eng/common/testproxy/target_version.txt b/eng/common/testproxy/target_version.txt index 26b6c79cf6f38..cefa0fb9592d8 100644 --- a/eng/common/testproxy/target_version.txt +++ b/eng/common/testproxy/target_version.txt @@ -1 +1 @@ -1.0.0-dev.20240806.1 +1.0.0-dev.20240823.1 From f0b71c0cb509b45fcd74e9a6b3f8f307db2b36cb Mon Sep 17 00:00:00 2001 From: Chenyang Liu Date: Mon, 26 Aug 2024 13:53:12 +0800 Subject: [PATCH 25/71] Prepare release for 1.0.0-beta.1 (#45670) --- .../CHANGELOG.md | 2 +- ...crosoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md index 777a719a7b0bd..78e9ced548c5e 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md @@ -1,5 +1,5 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-09-01) ### Features Added - The initial beta release of Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj index 39bb0dc41b2ae..ca95d63f26d1e 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj @@ -1,4 +1,4 @@ - + $(RequiredTargetFrameworks) From f730453675a6f75f7b5459d0eb346882efcb245e Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 26 Aug 2024 08:19:27 -0700 Subject: [PATCH 26/71] Increment package version after release of Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO (#45671) --- .../CHANGELOG.md | 10 ++++++++++ ...zure.WebJobs.Extensions.WebPubSubForSocketIO.csproj | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md index 78e9ced548c5e..1aee1b6ee9c2d 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-09-01) ### Features Added - The initial beta release of Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj index ca95d63f26d1e..c3764b01d4e76 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj @@ -5,7 +5,7 @@ Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO Azure, WebPubSub Azure Functions extension for the WebPubSub for Socket.IO - 1.0.0-beta.1 + 1.0.0-beta.2 $(NoWarn);AZC0001;CS8632;CA1056;CA2227 true true From 478c0f126eefc9046fe02ed0fff0c34b77f1ca70 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:25:54 -0700 Subject: [PATCH 27/71] Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#45674) --- eng/pipelines/templates/stages/1es-redirect.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/stages/1es-redirect.yml b/eng/pipelines/templates/stages/1es-redirect.yml index 09ca2440ebcd6..b21c58f8f814f 100644 --- a/eng/pipelines/templates/stages/1es-redirect.yml +++ b/eng/pipelines/templates/stages/1es-redirect.yml @@ -11,7 +11,7 @@ resources: - repository: azure-sdk-build-tools type: git name: internal/azure-sdk-build-tools - ref: refs/tags/azure-sdk-build-tools_20240711.1 + ref: refs/tags/azure-sdk-build-tools_20240826.1 parameters: - name: stages From bbed3b43f3d36202461cb1bf0d1c994f58645c0d Mon Sep 17 00:00:00 2001 From: Juan Ospina <70209456+jeo02@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:57:03 -0700 Subject: [PATCH 28/71] Spelling/grammer fix (#45657) Co-authored-by: JUAN OSPINA --- .../samples/Sample10_SecretReference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample10_SecretReference.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample10_SecretReference.md index c159b3a0cf580..7d3882f978dc2 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample10_SecretReference.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample10_SecretReference.md @@ -6,7 +6,7 @@ When App Configuration creates such keys, it stores the URIs of Key Vault values Your application is responsible for authenticating properly to both App Configuration and Key Vault and resolving values. The two services don't communicate directly. -You can use the [configuration provider](https://github.com/Azure/AppConfiguration-DotnetProvider) to do resolve Secret references automatically; +You can use the [configuration provider](https://github.com/Azure/AppConfiguration-DotnetProvider) to resolve Secret references automatically. Secret references are settings that follow specific JSON schema for the `Value`, and the `application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8` content type. The `Azure.Data.AppConfiguration` library provides a strongly-typed way of managing Secret references. From 699c7de7d021ff66327434ed53a357d95804547e Mon Sep 17 00:00:00 2001 From: Nisha Bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:49:22 -0700 Subject: [PATCH 29/71] [KeyVault] Add support for service version 7.6-preview.1 (#43811) * wip * wip * Update Azure.Security.KeyVault.Secrets.netstandard2.0.cs * update generation * Update Azure.Security.KeyVault.Administration.netstandard2.0.cs * Update CONTRIBUTING.md * Add new version in ClientOptions and tests for Administration * Export API * Remove server-side fix from changelog * Update sdk/keyvault/Azure.Security.KeyVault.Certificates/CHANGELOG.md * Add new endpoints definitions to readme * Add new Pre-backup methods * Documentation for PreBackup methods * Update method names in KeyVaultBackupClient for clarity * Add pre-restore methods * Export API * Use a flag to handle different headers in RestoreOperation * Update Administration Changelog * Add tests for Administration * Update preBackup and preRestore tests * Missing new version in CertificatesClientOptions * Re-record CertificateClientLiveTests * Remove unninteded line in Keys Changelog * Improve admin changelod message and clean samples in readme * nit changes * Format Changelog md files * Add null argument checks in KeyVaultBackupClient methods and document exceptions * Introducing the KeyVaultPreBackupOperation and KeyVaultPreRestoreOperation classes. * Ignore tests for preview version * Revert changes in KeyVaultRestoreOperation * Include possible exceptions to pre-operation classes * Record Secrets * Record Keys tests * Record admin * Re-record failing tests for Secrets * Update test-resources json to output the Tenant ID too * Export API and remove unused snippets --------- Co-authored-by: Jonathan Cardenas --- .../CHANGELOG.md | 9 +- .../README.md | 6 + ....KeyVault.Administration.netstandard2.0.cs | 49 ++++- .../assets.json | 2 +- ...VaultAdministrationPreFullBackupHeaders.cs | 24 +++ ...istrationPreFullRestoreOperationHeaders.cs | 24 +++ .../src/Generated/BackupRestoreRestClient.cs | 140 +++++++++++++- ...BackupOperationParameters.Serialization.cs | 44 +++++ .../Models/PreBackupOperationParameters.cs | 36 ++++ ...estoreOperationParameters.Serialization.cs | 39 ++++ .../Models/PreRestoreOperationParameters.cs | 32 ++++ .../Generated/RoleAssignmentsRestClient.cs | 2 +- .../Generated/RoleDefinitionsRestClient.cs | 2 +- .../src/Generated/SettingsRestClient.cs | 2 +- .../KeyVaultAdministrationClientOptions.cs | 8 +- .../src/KeyVaultBackupClient.cs | 157 +++++++++++++++ .../src/KeyVaultPreBackupOperation.cs | 179 ++++++++++++++++++ .../src/KeyVaultPreRestoreOperation.cs | 107 +++++++++++ .../src/OperationHeadersExtensions.cs | 18 ++ .../src/PreRestoreOperationParameters.cs | 9 + .../src/RestoreOperationInternal.cs | 5 + .../src/autorest.md | 6 +- .../tests/AdministrationTestBase.cs | 1 + .../tests/FullBackupClientLiveTests.cs | 30 +++ .../tests/samples/Sample1_BackupHelloWorld.cs | 55 ++++++ .../CHANGELOG.md | 10 +- ...ty.KeyVault.Certificates.netstandard2.0.cs | 3 +- .../assets.json | 2 +- .../src/CertificateClientOptions.cs | 8 +- .../tests/CertificatesTestBase.cs | 1 + .../Azure.Security.KeyVault.Keys/CHANGELOG.md | 8 +- ...e.Security.KeyVault.Keys.netstandard2.0.cs | 6 +- .../Azure.Security.KeyVault.Keys/assets.json | 2 +- .../Cryptography/CryptographyClientOptions.cs | 8 +- .../src/KeyClientOptions.cs | 8 +- .../src/KeyRotationLifetimeAction.cs | 1 + .../tests/KeysTestBase.cs | 1 + .../CHANGELOG.md | 19 +- ...ecurity.KeyVault.Secrets.netstandard2.0.cs | 3 +- .../assets.json | 2 +- .../src/SecretClientOptions.cs | 8 +- .../tests/SecretsTestBase.cs | 1 + sdk/keyvault/test-resources.json | 74 ++++---- 43 files changed, 1079 insertions(+), 72 deletions(-) create mode 100644 sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullBackupHeaders.cs create mode 100644 sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders.cs create mode 100644 sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.Serialization.cs create mode 100644 sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.cs create mode 100644 sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.Serialization.cs create mode 100644 sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.cs create mode 100644 sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreBackupOperation.cs create mode 100644 sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreRestoreOperation.cs create mode 100644 sdk/keyvault/Azure.Security.KeyVault.Administration/src/PreRestoreOperationParameters.cs diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/CHANGELOG.md b/sdk/keyvault/Azure.Security.KeyVault.Administration/CHANGELOG.md index 265085526e798..4b08ca6035e40 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/CHANGELOG.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/CHANGELOG.md @@ -4,12 +4,17 @@ ### Features Added +- Added support for service API version `7.6-preview.1`. +- Added new methods `StartPreRestoreAsync`, `StartPreRestore`, `StartPreBackupAsync`, and `StartPreBackupAsync` to the `KeyVaultBackupClient`. + ### Breaking Changes ### Bugs Fixed ### Other Changes +- The default service version is now "V7_6_Preview_1". + ## 4.4.0 (2024-02-14) Changes from both the last release and the last beta include: @@ -83,8 +88,8 @@ The following changes are only breaking from the previous beta. They are not bre ### Breaking Changes - Verify the challenge resource matches the vault domain. - This should affect few customers who can set `KeyVaultAdministrationClientOptions.DisableChallengeResourceVerification` to `true` to disable. - See https://aka.ms/azsdk/blog/vault-uri for more information. + This should affect few customers who can set `KeyVaultAdministrationClientOptions.DisableChallengeResourceVerification` to `true` to disable. + See for more information. ## 4.1.0 (2022-03-24) diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/README.md b/sdk/keyvault/Azure.Security.KeyVault.Administration/README.md index c05c0ad094bde..dc452003b702a 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/README.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/README.md @@ -141,10 +141,16 @@ A `KeyVaultAccessControlClient` provides both synchronous and asynchronous opera A `KeyVaultBackupClient` provides both synchronous and asynchronous operations for performing full key backups, full key restores, and selective key restores. +### PreBackupOperation +A `PreBackupOperation` represents a long-running operation that checks if it is possible to perform a full key backup. + ### BackupOperation A `BackupOperation` represents a long running operation for a full key backup. +### PreRestoreOperation +A `PreRestoreOperation` represents a long-running operation that checks if it is possible to perform a full key restore from a backup. + ### RestoreOperation A `RestoreOperation` represents a long running operation for both a full key and selective key restore. diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/api/Azure.Security.KeyVault.Administration.netstandard2.0.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/api/Azure.Security.KeyVault.Administration.netstandard2.0.cs index 32a5847b1b3e6..0c1a09a9ad6f5 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/api/Azure.Security.KeyVault.Administration.netstandard2.0.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/api/Azure.Security.KeyVault.Administration.netstandard2.0.cs @@ -43,7 +43,7 @@ public KeyVaultAccessControlClient(System.Uri vaultUri, Azure.Core.TokenCredenti } public partial class KeyVaultAdministrationClientOptions : Azure.Core.ClientOptions { - public KeyVaultAdministrationClientOptions(Azure.Security.KeyVault.Administration.KeyVaultAdministrationClientOptions.ServiceVersion version = Azure.Security.KeyVault.Administration.KeyVaultAdministrationClientOptions.ServiceVersion.V7_5) { } + public KeyVaultAdministrationClientOptions(Azure.Security.KeyVault.Administration.KeyVaultAdministrationClientOptions.ServiceVersion version = Azure.Security.KeyVault.Administration.KeyVaultAdministrationClientOptions.ServiceVersion.V7_6_Preview_1) { } public bool DisableChallengeResourceVerification { get { throw null; } set { } } public Azure.Security.KeyVault.Administration.KeyVaultAdministrationClientOptions.ServiceVersion Version { get { throw null; } } public enum ServiceVersion @@ -52,6 +52,7 @@ public enum ServiceVersion V7_3 = 2, V7_4 = 3, V7_5 = 4, + V7_6_Preview_1 = 5, } } public static partial class KeyVaultAdministrationModelFactory @@ -79,6 +80,10 @@ public KeyVaultBackupClient(System.Uri vaultUri, Azure.Core.TokenCredential cred public virtual System.Uri VaultUri { get { throw null; } } public virtual Azure.Security.KeyVault.Administration.KeyVaultBackupOperation StartBackup(System.Uri blobStorageUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StartBackupAsync(System.Uri blobStorageUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Security.KeyVault.Administration.KeyVaultPreBackupOperation StartPreBackup(System.Uri blobStorageUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StartPreBackupAsync(System.Uri blobStorageUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Security.KeyVault.Administration.KeyVaultPreRestoreOperation StartPreRestore(System.Uri folderUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StartPreRestoreAsync(System.Uri folderUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Security.KeyVault.Administration.KeyVaultRestoreOperation StartRestore(System.Uri folderUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StartRestoreAsync(System.Uri folderUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Security.KeyVault.Administration.KeyVaultSelectiveKeyRestoreOperation StartSelectiveKeyRestore(string keyName, System.Uri folderUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -165,6 +170,38 @@ public KeyVaultPermission() { } public System.Collections.Generic.IList NotActions { get { throw null; } } public System.Collections.Generic.IList NotDataActions { get { throw null; } } } + public partial class KeyVaultPreBackupOperation : Azure.Operation + { + protected KeyVaultPreBackupOperation() { } + public KeyVaultPreBackupOperation(Azure.Security.KeyVault.Administration.KeyVaultBackupClient client, string id) { } + public System.DateTimeOffset? EndTime { get { throw null; } } + public override bool HasCompleted { get { throw null; } } + public override bool HasValue { get { throw null; } } + public override string Id { get { throw null; } } + public System.DateTimeOffset? StartTime { get { throw null; } } + public override Azure.Security.KeyVault.Administration.KeyVaultBackupResult Value { get { throw null; } } + public override Azure.Response GetRawResponse() { throw null; } + public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken) { throw null; } + } + public partial class KeyVaultPreRestoreOperation : Azure.Operation + { + protected KeyVaultPreRestoreOperation() { } + public KeyVaultPreRestoreOperation(Azure.Security.KeyVault.Administration.KeyVaultBackupClient client, string id) { } + public System.DateTimeOffset? EndTime { get { throw null; } } + public override bool HasCompleted { get { throw null; } } + public override bool HasValue { get { throw null; } } + public override string Id { get { throw null; } } + public System.DateTimeOffset? StartTime { get { throw null; } } + public override Azure.Security.KeyVault.Administration.KeyVaultRestoreResult Value { get { throw null; } } + public override Azure.Response GetRawResponse() { throw null; } + public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken) { throw null; } + } public partial class KeyVaultRestoreOperation : Azure.Operation { protected KeyVaultRestoreOperation() { } @@ -337,3 +374,13 @@ public readonly partial struct KeyVaultSettingValue public override string ToString() { throw null; } } } +namespace Azure.Security.KeyVault.Administration.Models +{ + public partial class PreBackupOperationParameters + { + public PreBackupOperationParameters() { } + public string StorageResourceUri { get { throw null; } set { } } + public string Token { get { throw null; } set { } } + public bool? UseManagedIdentity { get { throw null; } set { } } + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/assets.json b/sdk/keyvault/Azure.Security.KeyVault.Administration/assets.json index 3072779aaa8ae..28336ec072ed2 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/assets.json +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/keyvault/Azure.Security.KeyVault.Administration", - "Tag": "net/keyvault/Azure.Security.KeyVault.Administration_4951f6b8e1" + "Tag": "net/keyvault/Azure.Security.KeyVault.Administration_2b51d5440c" } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullBackupHeaders.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullBackupHeaders.cs new file mode 100644 index 0000000000000..e98c641e04228 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullBackupHeaders.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.Security.KeyVault.Administration +{ + internal partial class AzureSecurityKeyVaultAdministrationPreFullBackupHeaders + { + private readonly Response _response; + public AzureSecurityKeyVaultAdministrationPreFullBackupHeaders(Response response) + { + _response = response; + } + /// The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. + public long? RetryAfter => _response.Headers.TryGetValue("Retry-After", out long? value) ? value : null; + /// The URI to poll for completion status. + public string AzureAsyncOperation => _response.Headers.TryGetValue("Azure-AsyncOperation", out string value) ? value : null; + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders.cs new file mode 100644 index 0000000000000..f706130099577 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.Security.KeyVault.Administration +{ + internal partial class AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders + { + private readonly Response _response; + public AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders(Response response) + { + _response = response; + } + /// The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. + public long? RetryAfter => _response.Headers.TryGetValue("Retry-After", out long? value) ? value : null; + /// The URI to poll for completion status. + public string AzureAsyncOperation => _response.Headers.TryGetValue("Azure-AsyncOperation", out string value) ? value : null; + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/BackupRestoreRestClient.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/BackupRestoreRestClient.cs index b30181ba2e982..794f0d4189865 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/BackupRestoreRestClient.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/BackupRestoreRestClient.cs @@ -28,7 +28,7 @@ internal partial class BackupRestoreRestClient /// The HTTP pipeline for sending and receiving REST requests and responses. /// Api Version. /// , or is null. - public BackupRestoreRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.5") + public BackupRestoreRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.6-preview.1") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); @@ -104,6 +104,75 @@ public ResponseWithHeaders } } + internal HttpMessage CreatePreFullBackupRequest(string vaultBaseUrl, PreBackupOperationParameters preBackupOperationParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(vaultBaseUrl, false); + uri.AppendPath("/prebackup", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (preBackupOperationParameters != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(preBackupOperationParameters); + request.Content = content; + } + return message; + } + + /// Pre-backup operation for checking whether the customer can perform a full backup operation. + /// The vault name, for example https://myvault.vault.azure.net. + /// Optional parameters to validate prior to performing a full backup operation. + /// The cancellation token to use. + /// is null. + public async Task> PreFullBackupAsync(string vaultBaseUrl, PreBackupOperationParameters preBackupOperationParameters = null, CancellationToken cancellationToken = default) + { + if (vaultBaseUrl == null) + { + throw new ArgumentNullException(nameof(vaultBaseUrl)); + } + + using var message = CreatePreFullBackupRequest(vaultBaseUrl, preBackupOperationParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new AzureSecurityKeyVaultAdministrationPreFullBackupHeaders(message.Response); + switch (message.Response.Status) + { + case 202: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Pre-backup operation for checking whether the customer can perform a full backup operation. + /// The vault name, for example https://myvault.vault.azure.net. + /// Optional parameters to validate prior to performing a full backup operation. + /// The cancellation token to use. + /// is null. + public ResponseWithHeaders PreFullBackup(string vaultBaseUrl, PreBackupOperationParameters preBackupOperationParameters = null, CancellationToken cancellationToken = default) + { + if (vaultBaseUrl == null) + { + throw new ArgumentNullException(nameof(vaultBaseUrl)); + } + + using var message = CreatePreFullBackupRequest(vaultBaseUrl, preBackupOperationParameters); + _pipeline.Send(message, cancellationToken); + var headers = new AzureSecurityKeyVaultAdministrationPreFullBackupHeaders(message.Response); + switch (message.Response.Status) + { + case 202: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateFullBackupStatusRequest(string vaultBaseUrl, string jobId) { var message = _pipeline.CreateMessage(); @@ -184,6 +253,75 @@ public Response FullBackupStatus(string vaultBaseUrl, } } + internal HttpMessage CreatePreFullRestoreOperationRequest(string vaultBaseUrl, PreRestoreOperationParameters preRestoreOperationParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(vaultBaseUrl, false); + uri.AppendPath("/prerestore", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (preRestoreOperationParameters != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(preRestoreOperationParameters); + request.Content = content; + } + return message; + } + + /// Pre-restore operation for checking whether the customer can perform a full restore operation. + /// The vault name, for example https://myvault.vault.azure.net. + /// Optional pre restore parameters to validate prior to performing a full restore operation. + /// The cancellation token to use. + /// is null. + public async Task> PreFullRestoreOperationAsync(string vaultBaseUrl, PreRestoreOperationParameters preRestoreOperationParameters = null, CancellationToken cancellationToken = default) + { + if (vaultBaseUrl == null) + { + throw new ArgumentNullException(nameof(vaultBaseUrl)); + } + + using var message = CreatePreFullRestoreOperationRequest(vaultBaseUrl, preRestoreOperationParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders(message.Response); + switch (message.Response.Status) + { + case 202: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Pre-restore operation for checking whether the customer can perform a full restore operation. + /// The vault name, for example https://myvault.vault.azure.net. + /// Optional pre restore parameters to validate prior to performing a full restore operation. + /// The cancellation token to use. + /// is null. + public ResponseWithHeaders PreFullRestoreOperation(string vaultBaseUrl, PreRestoreOperationParameters preRestoreOperationParameters = null, CancellationToken cancellationToken = default) + { + if (vaultBaseUrl == null) + { + throw new ArgumentNullException(nameof(vaultBaseUrl)); + } + + using var message = CreatePreFullRestoreOperationRequest(vaultBaseUrl, preRestoreOperationParameters); + _pipeline.Send(message, cancellationToken); + var headers = new AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders(message.Response); + switch (message.Response.Status) + { + case 202: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateFullRestoreOperationRequest(string vaultBaseUrl, RestoreOperationParameters restoreBlobDetails) { var message = _pipeline.CreateMessage(); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.Serialization.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.Serialization.cs new file mode 100644 index 0000000000000..e1ce1dc319935 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.Serialization.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Security.KeyVault.Administration.Models +{ + public partial class PreBackupOperationParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(StorageResourceUri)) + { + writer.WritePropertyName("storageResourceUri"u8); + writer.WriteStringValue(StorageResourceUri); + } + if (Optional.IsDefined(Token)) + { + writer.WritePropertyName("token"u8); + writer.WriteStringValue(Token); + } + if (Optional.IsDefined(UseManagedIdentity)) + { + writer.WritePropertyName("useManagedIdentity"u8); + writer.WriteBooleanValue(UseManagedIdentity.Value); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.cs new file mode 100644 index 0000000000000..c12e9e3d32652 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Security.KeyVault.Administration.Models +{ + /// The PreBackupOperationParameters. + public partial class PreBackupOperationParameters + { + /// Initializes a new instance of . + public PreBackupOperationParameters() + { + } + + /// Initializes a new instance of . + /// Azure Blob storage container Uri. + /// The SAS token pointing to an Azure Blob storage container. + /// Indicates which authentication method should be used. If set to true, Managed HSM will use the configured user-assigned managed identity to authenticate with Azure Storage. Otherwise, a SAS token has to be specified. + internal PreBackupOperationParameters(string storageResourceUri, string token, bool? useManagedIdentity) + { + StorageResourceUri = storageResourceUri; + Token = token; + UseManagedIdentity = useManagedIdentity; + } + + /// Azure Blob storage container Uri. + public string StorageResourceUri { get; set; } + /// The SAS token pointing to an Azure Blob storage container. + public string Token { get; set; } + /// Indicates which authentication method should be used. If set to true, Managed HSM will use the configured user-assigned managed identity to authenticate with Azure Storage. Otherwise, a SAS token has to be specified. + public bool? UseManagedIdentity { get; set; } + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.Serialization.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.Serialization.cs new file mode 100644 index 0000000000000..45d6d2d44270a --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Security.KeyVault.Administration.Models +{ + internal partial class PreRestoreOperationParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(SasTokenParameters)) + { + writer.WritePropertyName("sasTokenParameters"u8); + writer.WriteObjectValue(SasTokenParameters); + } + if (Optional.IsDefined(FolderToRestore)) + { + writer.WritePropertyName("folderToRestore"u8); + writer.WriteStringValue(FolderToRestore); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.cs new file mode 100644 index 0000000000000..f2985849bc639 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Security.KeyVault.Administration.Models +{ + /// The PreRestoreOperationParameters. + internal partial class PreRestoreOperationParameters + { + /// Initializes a new instance of . + public PreRestoreOperationParameters() + { + } + + /// Initializes a new instance of . + /// + /// The Folder name of the blob where the previous successful full backup was stored. + internal PreRestoreOperationParameters(SASTokenParameter sasTokenParameters, string folderToRestore) + { + SasTokenParameters = sasTokenParameters; + FolderToRestore = folderToRestore; + } + + /// Gets or sets the sas token parameters. + public SASTokenParameter SasTokenParameters { get; set; } + /// The Folder name of the blob where the previous successful full backup was stored. + public string FolderToRestore { get; set; } + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleAssignmentsRestClient.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleAssignmentsRestClient.cs index 8cdf96815723c..60475edd03da5 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleAssignmentsRestClient.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleAssignmentsRestClient.cs @@ -28,7 +28,7 @@ internal partial class RoleAssignmentsRestClient /// The HTTP pipeline for sending and receiving REST requests and responses. /// Api Version. /// , or is null. - public RoleAssignmentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.5") + public RoleAssignmentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.6-preview.1") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleDefinitionsRestClient.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleDefinitionsRestClient.cs index 6221ad1e783cb..9b47b644ea830 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleDefinitionsRestClient.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleDefinitionsRestClient.cs @@ -28,7 +28,7 @@ internal partial class RoleDefinitionsRestClient /// The HTTP pipeline for sending and receiving REST requests and responses. /// Api Version. /// , or is null. - public RoleDefinitionsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.5") + public RoleDefinitionsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.6-preview.1") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/SettingsRestClient.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/SettingsRestClient.cs index 7a898bfb4b4b5..924e65f68b0fa 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/SettingsRestClient.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/SettingsRestClient.cs @@ -28,7 +28,7 @@ internal partial class SettingsRestClient /// The HTTP pipeline for sending and receiving REST requests and responses. /// Api Version. /// , or is null. - public SettingsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.5") + public SettingsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.6-preview.1") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultAdministrationClientOptions.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultAdministrationClientOptions.cs index baf00abf0c86e..8e2144f9ac424 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultAdministrationClientOptions.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultAdministrationClientOptions.cs @@ -18,7 +18,7 @@ public class KeyVaultAdministrationClientOptions : ClientOptions /// For more information, see /// Key Vault versions. /// - internal const ServiceVersion LatestVersion = ServiceVersion.V7_5; + internal const ServiceVersion LatestVersion = ServiceVersion.V7_6_Preview_1; /// /// The versions of Azure Key Vault supported by this client @@ -46,6 +46,11 @@ public enum ServiceVersion /// The Key Vault API version 7.5. /// V7_5 = 4, + + /// + /// The Key Vault API version 7.6-preview.1. + /// + V7_6_Preview_1 = 5, #pragma warning restore CA1707 // Identifiers should not contain underscores } @@ -83,6 +88,7 @@ internal string GetVersionString() ServiceVersion.V7_3 => "7.3", ServiceVersion.V7_4 => "7.4", ServiceVersion.V7_5 => "7.5", + ServiceVersion.V7_6_Preview_1 => "7.6-preview.1", _ => throw new ArgumentException(Version.ToString()), }; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultBackupClient.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultBackupClient.cs index 36a06b4f3bec3..9c3ea0d922c13 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultBackupClient.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultBackupClient.cs @@ -123,6 +123,80 @@ public virtual KeyVaultBackupOperation StartBackup(Uri blobStorageUri, string sa } } + /// + /// Initiates a pre-backup check on the Key Vault. This operation checks if it is possible to back up the entire collection of keys from a Key Vault. + /// + /// The for the blob storage resource. + /// Optional Shared Access Signature (SAS) token to authorize access to the blob. If null, Managed Identity will be used to authenticate instead. + /// A controlling the request lifetime. + /// or is null. + /// The server returned an error. See for details returned from the server. + /// A representing the result of the asynchronous operation. + public virtual async Task StartPreBackupAsync(Uri blobStorageUri, string sasToken = default, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(blobStorageUri, nameof(blobStorageUri)); + Argument.AssertNotNull(sasToken, nameof(sasToken)); + + using DiagnosticScope scope = _diagnostics.CreateScope($"{nameof(KeyVaultBackupClient)}.{nameof(StartPreBackupAsync)}"); + scope.Start(); + try + { + var response = await _restClient.PreFullBackupAsync( + VaultUri.AbsoluteUri, + new PreBackupOperationParameters( + blobStorageUri.AbsoluteUri, + sasToken, + useManagedIdentity: sasToken == null + ), + cancellationToken).ConfigureAwait(false); + + // Should this return a KeyVaultBackupOperation? + return new KeyVaultPreBackupOperation(this, response); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// Initiates a pre-backup check on the Key Vault. This operation checks if it is possible to back up the entire collection of keys from a Key Vault. + /// + /// The for the blob storage resource. + /// Optional Shared Access Signature (SAS) token to authorize access to the blob. If null, Managed Identity will be used to authenticate instead. + /// A controlling the request lifetime. + /// or is null. + /// The server returned an error. See for details returned from the server. + /// A representing the result of the operation. + public virtual KeyVaultPreBackupOperation StartPreBackup(Uri blobStorageUri, string sasToken = default, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(blobStorageUri, nameof(blobStorageUri)); + Argument.AssertNotNull(sasToken, nameof(sasToken)); + + using DiagnosticScope scope = _diagnostics.CreateScope($"{nameof(KeyVaultBackupClient)}.{nameof(StartPreBackup)}"); + scope.Start(); + try + { + var response = _restClient.PreFullBackup( + VaultUri.AbsoluteUri, + new PreBackupOperationParameters( + blobStorageUri.AbsoluteUri, + sasToken, + useManagedIdentity: sasToken == null + ), + cancellationToken); + + // Should this return a KeyVaultBackupOperation? + return new KeyVaultPreBackupOperation(this, response); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + /// /// Initiates a full key restore of the Key Vault. /// @@ -163,6 +237,89 @@ public virtual async Task StartRestoreAsync(Uri folder } } + /// + /// Initiate a pre-restore check on a Key Vault. This operation checks if it is possible to restore the entire collection of keys from a Key Vault. + /// + /// + /// The for the blob storage resource, including the path to the blob container where the backup resides. + /// This would be the exact value that is returned as the result of a . + /// An example Uri may look like the following: https://contoso.blob.core.windows.net/backup/mhsm-contoso-2020090117323313. + /// + /// Optional Shared Access Signature (SAS) token to authorize access to the blob. If null, Managed Identity will be used to authenticate instead. + /// A controlling the request lifetime. + /// or is null. + /// The server returned an error. See for details returned from the server. + /// A representing the result of the asynchronous operation. + public virtual async Task StartPreRestoreAsync(Uri folderUri, string sasToken = default, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(folderUri, nameof(folderUri)); + Argument.AssertNotNull(sasToken, nameof(sasToken)); + + using DiagnosticScope scope = _diagnostics.CreateScope($"{nameof(KeyVaultBackupClient)}.{nameof(StartRestore)}"); + scope.Start(); + try + { + // Get the folder name from the backupBlobUri returned from a previous BackupOperation + ParseFolderName(folderUri, out string containerUriString, out string folderName); + + var response = await _restClient.PreFullRestoreOperationAsync( + VaultUri.AbsoluteUri, + new PreRestoreOperationParameters( + new SASTokenParameter(containerUriString, sasToken), + folderUri.AbsoluteUri + ), + cancellationToken).ConfigureAwait(false); + + return new KeyVaultPreRestoreOperation(this, response); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// Initiate a pre-restore check on a Key Vault. This operation checks if it is possible to restore the entire collection of keys from a Key Vault. + /// + /// + /// The for the blob storage resource, including the path to the blob container where the backup resides. + /// This would be the exact value that is returned as the result of a . + /// An example Uri path may look like the following: https://contoso.blob.core.windows.net/backup/mhsm-contoso-2020090117323313. + /// + /// Optional Shared Access Signature (SAS) token to authorize access to the blob. If null, Managed Identity will be used to authenticate instead. + /// A controlling the request lifetime. + /// or is null. + /// The server returned an error. See for details returned from the server. + /// A to wait on this long-running operation. + public virtual KeyVaultPreRestoreOperation StartPreRestore(Uri folderUri, string sasToken = default, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(folderUri, nameof(folderUri)); + Argument.AssertNotNull(sasToken, nameof(sasToken)); + + using DiagnosticScope scope = _diagnostics.CreateScope($"{nameof(KeyVaultBackupClient)}.{nameof(StartRestore)}"); + scope.Start(); + try + { + // Get the folder name from the backupBlobUri returned from a previous BackupOperation + ParseFolderName(folderUri, out string containerUriString, out string folderName); + + var response = _restClient.PreFullRestoreOperation( + VaultUri.AbsoluteUri, + new PreRestoreOperationParameters( + new SASTokenParameter(containerUriString, sasToken), + folderUri.AbsoluteUri + ), + cancellationToken); + return new KeyVaultPreRestoreOperation(this, response); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + /// /// Initiates a full key restore of the Key Vault. /// diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreBackupOperation.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreBackupOperation.cs new file mode 100644 index 0000000000000..92ed12ee8f5ae --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreBackupOperation.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core; +using Azure.Security.KeyVault.Administration.Models; +using System.Threading.Tasks; +using System.Threading; +using Azure.Core.Pipeline; + +namespace Azure.Security.KeyVault.Administration +{ + /// + /// A long-running operation for or . + /// + public class KeyVaultPreBackupOperation : Operation + { + /// + /// The number of seconds recommended by the service to delay before checking on completion status. + /// + internal long? _retryAfterSeconds; + private readonly KeyVaultBackupClient _client; + private Response _response; + private FullBackupDetailsInternal _value; + private readonly string _id; + private RequestFailedException _requestFailedException; + + /// + /// Creates an instance of a KeyVaultPreBackupOperation from a previously started operation. , , + /// , or must be called + /// to re-populate the details of this operation. + /// + /// An instance of . + /// The from a previous . + /// or is null. + /// is empty. + public KeyVaultPreBackupOperation(KeyVaultBackupClient client, string id) + { + Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNull(client, nameof(client)); + + _client = client; + _id = id; + } + + /// + /// Initializes a new instance of a KeyVaultPreBackupOperation. + /// + /// An instance of . + /// The returned from or . + /// The server operation does not contains an Id + internal KeyVaultPreBackupOperation(KeyVaultBackupClient client, ResponseWithHeaders response) + { + _client = client; + _response = response; + _retryAfterSeconds = response.Headers.RetryAfter; + _id = response.Headers.JobId() ?? throw new InvalidOperationException("The response does not contain an Id"); + } + + /// + /// Initializes a new instance of a KeyVaultPreBackupOperation for mocking purposes. + /// + /// The that will be returned from . + /// The that will be returned from . + /// An instance of . + /// , , or is null. + internal KeyVaultPreBackupOperation(FullBackupDetailsInternal value, Response response, KeyVaultBackupClient client) + { + Argument.AssertNotNull(value, nameof(value)); + Argument.AssertNotNull(response, nameof(response)); + Argument.AssertNotNull(client, nameof(client)); + + _response = response; + _value = value; + _id = value.JobId; + _client = client; + } + + /// Initializes a new instance of for mocking. + protected KeyVaultPreBackupOperation() { } + + /// + /// The start time of the backup operation. + /// + public DateTimeOffset? StartTime => _value?.StartTime; + + /// + /// The end time of the backup operation. + /// + public DateTimeOffset? EndTime => _value?.EndTime; + + /// + public override string Id => _id; + + /// + /// Gets the of the backup operation. + /// You should await before attempting to use a key in this pending state. + /// + public override KeyVaultBackupResult Value + { + get + { +#pragma warning disable CA1065 // Do not raise exceptions in unexpected locations + if (!HasCompleted) + { + throw new InvalidOperationException("The operation is not complete."); + } + if (_requestFailedException != null) + { + throw _requestFailedException; + } +#pragma warning restore CA1065 // Do not raise exceptions in unexpected locations + return new KeyVaultBackupResult(new Uri(_value.AzureStorageBlobContainerUri), _value.StartTime.Value, _value.EndTime.Value); + } + } + + /// + public override bool HasCompleted => _value?.EndTime.HasValue ?? false; + + /// + public override bool HasValue => _response != null && _value?.Error == null && HasCompleted; + + /// + public override Response GetRawResponse() => _response; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => + UpdateStatusAsync(false, cancellationToken).EnsureCompleted(); + + /// + public override async ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => + await UpdateStatusAsync(true, cancellationToken).ConfigureAwait(false); + + private async ValueTask UpdateStatusAsync(bool async, CancellationToken cancellationToken = default) + { + if (!HasCompleted) + { + try + { + Response response = async ? + await _client.GetBackupDetailsAsync(Id, cancellationToken).ConfigureAwait(false) + : _client.GetBackupDetails(Id, cancellationToken); + + _value = response.Value; + _response = response.GetRawResponse(); + } + catch (RequestFailedException ex) + { + _requestFailedException = ex; + throw; + } + catch (Exception ex) + { + _requestFailedException = new RequestFailedException("Unexpected failure", ex); + throw _requestFailedException; + } + + if (_value != null && _value.EndTime.HasValue && _value.Error != null) + { + _requestFailedException = _response != null ? + new RequestFailedException(_response) + : new RequestFailedException($"{_value.Error.Message}\nInnerError: {_value.Error.InnerError}\nCode: {_value.Error.Code}"); + throw _requestFailedException; + } + } + + return GetRawResponse(); + } + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => + _retryAfterSeconds.HasValue ? this.DefaultWaitForCompletionAsync(TimeSpan.FromSeconds(_retryAfterSeconds.Value), cancellationToken) : + this.DefaultWaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken) => + this.DefaultWaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreRestoreOperation.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreRestoreOperation.cs new file mode 100644 index 0000000000000..f0e236b47af77 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreRestoreOperation.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Security.KeyVault.Administration.Models; + +namespace Azure.Security.KeyVault.Administration +{ + /// + /// A long-running operation for or . + /// + public class KeyVaultPreRestoreOperation : Operation + { + internal readonly RestoreOperationInternal _operationInternal; + + /// + /// Creates an instance of a KeyVaultPreRestoreOperation from a previously started operation. , , + /// , or must be called + /// to re-populate the details of this operation. + /// + /// An instance of . + /// The from a previous . + /// or is null. + /// is empty. + public KeyVaultPreRestoreOperation(KeyVaultBackupClient client, string id) + { + Argument.AssertNotNull(client, nameof(client)); + Argument.AssertNotNullOrEmpty(id, nameof(id)); + + _operationInternal = new RestoreOperationInternal(client, id); + } + + /// + /// Initializes a new instance of the class. + /// + /// An instance of . + /// The returned from or . + /// or is null. + internal KeyVaultPreRestoreOperation(KeyVaultBackupClient client, ResponseWithHeaders response) + { + Argument.AssertNotNull(client, nameof(client)); + Argument.AssertNotNull(response, nameof(response)); + + _operationInternal = new RestoreOperationInternal(client, response); + } + + /// + /// Initializes a new instance of a KeyVaultPreRestoreOperation for mocking purposes. + /// + /// The that will be used to populate various properties. + /// The that will be returned from . + /// An instance of . + /// or or is null. + internal KeyVaultPreRestoreOperation(RestoreDetailsInternal value, Response response, KeyVaultBackupClient client) + { + Argument.AssertNotNull(value, nameof(value)); + Argument.AssertNotNull(response, nameof(response)); + Argument.AssertNotNull(client, nameof(client)); + + _operationInternal = new RestoreOperationInternal(value, response, client); + } + + /// Initializes a new instance of for mocking. + protected KeyVaultPreRestoreOperation() {} + + /// + /// The start time of the restore operation. + /// + public DateTimeOffset? StartTime => _operationInternal.StartTime; + + /// + /// The end time of the restore operation. + /// + public DateTimeOffset? EndTime => _operationInternal.EndTime; + + /// + public override string Id => _operationInternal.Id; + /// + public override KeyVaultRestoreResult Value => _operationInternal.Value; + + /// + public override bool HasCompleted => _operationInternal.HasCompleted; + + /// + public override bool HasValue => _operationInternal.HasValue; + + /// + public override Response GetRawResponse() => _operationInternal.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operationInternal.UpdateStatus(cancellationToken); + + /// + public override async ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => await _operationInternal.UpdateStatusAsync(cancellationToken).ConfigureAwait(false); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => + _operationInternal.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken) => + _operationInternal.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/OperationHeadersExtensions.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/OperationHeadersExtensions.cs index aa3687c4c5f46..dba73a3eb4438 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/OperationHeadersExtensions.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/OperationHeadersExtensions.cs @@ -16,6 +16,24 @@ public static string JobId(this AzureSecurityKeyVaultAdministrationFullBackupHea return GetJobIdFromAzureAsyncOperation(header.AzureAsyncOperation); } + /// + /// Extracts the operation JobId from the AzureAsyncOperation. + /// + /// The operation JobId. + public static string JobId(this AzureSecurityKeyVaultAdministrationPreFullBackupHeaders header) + { + return GetJobIdFromAzureAsyncOperation(header.AzureAsyncOperation); + } + + /// + /// Extracts the operation JobId from the AzureAsyncOperation. + /// + /// The operation JobId. + public static string JobId(this AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders header) + { + return GetJobIdFromAzureAsyncOperation(header.AzureAsyncOperation); + } + /// /// Extracts the operation JobId from the AzureAsyncOperation. /// diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/PreRestoreOperationParameters.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/PreRestoreOperationParameters.cs new file mode 100644 index 0000000000000..aac8dd35968d8 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/PreRestoreOperationParameters.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Security.KeyVault.Administration.Models +{ + // Transform the PreBackupOperationParameters model to an internal class. + internal partial class PreRestoreOperationParameters + { } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/RestoreOperationInternal.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/RestoreOperationInternal.cs index dfff9a1866469..bfb7d460b44bd 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/RestoreOperationInternal.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/RestoreOperationInternal.cs @@ -65,6 +65,11 @@ internal RestoreOperationInternal(KeyVaultBackupClient client, ResponseWithHeade _id = selectiveRestoreHeaders.Headers.JobId() ?? throw new InvalidOperationException("The response does not contain an Id"); _retryAfterSeconds = selectiveRestoreHeaders.Headers.RetryAfter; } + else if (response is ResponseWithHeaders preRestoreHeaders) + { + _id = preRestoreHeaders.Headers.JobId() ?? throw new InvalidOperationException("The response does not contain an Id"); + _retryAfterSeconds = (int)preRestoreHeaders.Headers.RetryAfter; + } else { throw new ArgumentException("Invalid header type", nameof(response)); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/autorest.md b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/autorest.md index 4135789b16a20..58678e5a06528 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/autorest.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/autorest.md @@ -9,9 +9,9 @@ Run `dotnet build /t:GenerateCode` in src directory to re-generate. ``` yaml title: Azure.Security.KeyVault.Administration input-file: -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7452e1cc7db72fbc6cd9539b390d8b8e5c2a1864/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.5/rbac.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7452e1cc7db72fbc6cd9539b390d8b8e5c2a1864/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.5/backuprestore.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7452e1cc7db72fbc6cd9539b390d8b8e5c2a1864/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.5/settings.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/rbac.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/backuprestore.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/settings.json namespace: Azure.Security.KeyVault.Administration generation1-convenience-client: true include-csproj: disable diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/AdministrationTestBase.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/AdministrationTestBase.cs index 9cd66922f4728..57860b6ff99bb 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/AdministrationTestBase.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/AdministrationTestBase.cs @@ -16,6 +16,7 @@ namespace Azure.Security.KeyVault.Administration.Tests /// Base class for recorded Administration tests. /// [ClientTestFixture( + KeyVaultAdministrationClientOptions.ServiceVersion.V7_6_Preview_1, KeyVaultAdministrationClientOptions.ServiceVersion.V7_5, KeyVaultAdministrationClientOptions.ServiceVersion.V7_4, KeyVaultAdministrationClientOptions.ServiceVersion.V7_3, diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/FullBackupClientLiveTests.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/FullBackupClientLiveTests.cs index 17087ce4e5519..bc4e404c519cc 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/FullBackupClientLiveTests.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/FullBackupClientLiveTests.cs @@ -50,6 +50,36 @@ public async Task BackupAndRestore() Assert.That(restoreOperation.HasValue, Is.True); } + [RecordedTest] + [Ignore("Service preview is not available yet.")] + public async Task PreBackupAndPreRestore() + { + var source = new CancellationTokenSource(Timeout); + + UriBuilder builder = new UriBuilder(TestEnvironment.StorageUri); + builder.Path = BlobContainerName; + + // Start the pre-backup operation. + KeyVaultPreBackupOperation preBackupOperation = await Client.StartPreBackupAsync(builder.Uri, "?" + SasToken, source.Token); + + KeyVaultBackupResult preBackupResult = await preBackupOperation.WaitForCompletionAsync(source.Token); + + await WaitForOperationAsync(); + + Assert.That(source.IsCancellationRequested, Is.False); + Assert.That(preBackupResult, Is.Not.Null); + Assert.That(preBackupOperation.HasValue, Is.True); + + // Start the pre-restore operation. + KeyVaultPreRestoreOperation preRestoreOperation = await Client.StartPreRestoreAsync(preBackupResult.FolderUri, "?" + SasToken, source.Token); + KeyVaultRestoreResult preRestoreResult = await preRestoreOperation.WaitForCompletionAsync(source.Token); + await WaitForOperationAsync(); + + Assert.That(source.IsCancellationRequested, Is.False); + Assert.That(preRestoreResult, Is.Not.Null); + Assert.That(preRestoreOperation.HasValue, Is.True); + } + [RecordedTest] [LiveOnly] [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35614")] diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample1_BackupHelloWorld.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample1_BackupHelloWorld.cs index 139819a4b0991..b070f3048b934 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample1_BackupHelloWorld.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample1_BackupHelloWorld.cs @@ -71,6 +71,61 @@ public async Task BackupAndRestoreSampleAsync() await WaitForOperationAsync(); } + [RecordedTest] + [AsyncOnly] + [Ignore("Service preview is not available yet")] + public async Task PreBackupAndPreRestoreSampleAsync() + { + var blobStorageUrl = TestEnvironment.StorageUri; + var blobContainerName = BlobContainerName; + var sasToken = "?" + SasToken; + + // Create a Uri with the storage container + UriBuilder builder = new UriBuilder(blobStorageUrl) + { + Path = blobContainerName, + }; + + // Check for backup readiness. + KeyVaultPreBackupOperation backupOperation = await Client.StartPreBackupAsync(builder.Uri, sasToken); + + // Wait for completion of the PreBackupOperation. + Response backupResult = await backupOperation.WaitForCompletionAsync(); + + // Check if the PreBackupOperation has completed successfully. + Uri folderUri = backupOperation.HasValue ? backupResult.Value.FolderUri : null; + + if (folderUri is null) + { + Console.WriteLine($"Backup operation failed. Status: {backupOperation.GetRawResponse().Status}, Reason: {backupOperation.GetRawResponse().ReasonPhrase}"); + } + + Assert.That(folderUri, Is.Not.Null); + Assert.That(backupOperation.HasValue, Is.True); + + await WaitForOperationAsync(); + + // Check for restore readiness using the backupBlobUri returned from a previous BackupOperation. + KeyVaultPreRestoreOperation preRestoreOperation = await Client.StartPreRestoreAsync(folderUri, sasToken); + + // Wait for completion of the PreRestoreOperation. + Response preRestoreResult = await preRestoreOperation.WaitForCompletionAsync(); + + // Check if the PreRestoreOperation has completed successfully. + if (preRestoreOperation.HasValue) + { + Console.WriteLine($"Pre-restore operation completed successfully. Status: {preRestoreOperation.GetRawResponse().Status}"); + } + else + { + Console.WriteLine($"Pre-restore operation failed. Status: {preRestoreOperation.GetRawResponse().Status}, Reason: {preRestoreOperation.GetRawResponse().ReasonPhrase}"); + } + + Assert.That(preRestoreOperation.HasValue, Is.True); + Assert.That(preRestoreResult.Value.StartTime, Is.Not.EqualTo(default)); + Assert.That(preRestoreResult.Value.EndTime, Is.Not.EqualTo(default)); + } + [RecordedTest] [SyncOnly] public async Task BackupAndRestoreSampleSync() diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/CHANGELOG.md b/sdk/keyvault/Azure.Security.KeyVault.Certificates/CHANGELOG.md index e040932d1035a..917ca4d22e1da 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/CHANGELOG.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/CHANGELOG.md @@ -10,6 +10,8 @@ ### Other Changes +- The default service version is now "V7_6_Preview_1". + ## 4.6.0 (2024-02-14) Changes from both the last release and the last beta include: @@ -17,7 +19,7 @@ Changes from both the last release and the last beta include: ### Features Added - Added `CertificateProperties.X509ThumbprintString` to return the hexadecimal string representation of the SHA-1 hash of the certificate. - `CertificateProperties.X509Thumbprint` has been hidden but is still available. + `CertificateProperties.X509Thumbprint` has been hidden but is still available. ### Breaking Changes @@ -46,7 +48,7 @@ Changes from both the last release and the last beta include: ### Features Added - Added `CertificateProperties.X509ThumbprintString` to return the hexadecimal string representation of the SHA-1 hash of the certificate. - `CertificateProperties.X509Thumbprint` has been hidden but is still available. + `CertificateProperties.X509Thumbprint` has been hidden but is still available. ### Breaking Changes @@ -94,8 +96,8 @@ Changes from both the last release and the last beta include: ### Breaking Changes - Verify the challenge resource matches the vault domain. - This should affect few customers who can set `CertificateClientOptions.DisableChallengeResourceVerification` to `true` to disable. - See https://aka.ms/azsdk/blog/vault-uri for more information. + This should affect few customers who can set `CertificateClientOptions.DisableChallengeResourceVerification` to `true` to disable. + See for more information. ## 4.3.0 (2022-03-24) diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/api/Azure.Security.KeyVault.Certificates.netstandard2.0.cs b/sdk/keyvault/Azure.Security.KeyVault.Certificates/api/Azure.Security.KeyVault.Certificates.netstandard2.0.cs index 8ba696e10ee1a..f24667ced66e8 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/api/Azure.Security.KeyVault.Certificates.netstandard2.0.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/api/Azure.Security.KeyVault.Certificates.netstandard2.0.cs @@ -73,7 +73,7 @@ public CertificateClient(System.Uri vaultUri, Azure.Core.TokenCredential credent } public partial class CertificateClientOptions : Azure.Core.ClientOptions { - public CertificateClientOptions(Azure.Security.KeyVault.Certificates.CertificateClientOptions.ServiceVersion version = Azure.Security.KeyVault.Certificates.CertificateClientOptions.ServiceVersion.V7_5) { } + public CertificateClientOptions(Azure.Security.KeyVault.Certificates.CertificateClientOptions.ServiceVersion version = Azure.Security.KeyVault.Certificates.CertificateClientOptions.ServiceVersion.V7_6_Preview_1) { } public bool DisableChallengeResourceVerification { get { throw null; } set { } } public Azure.Security.KeyVault.Certificates.CertificateClientOptions.ServiceVersion Version { get { throw null; } } public enum ServiceVersion @@ -84,6 +84,7 @@ public enum ServiceVersion V7_3 = 3, V7_4 = 4, V7_5 = 5, + V7_6_Preview_1 = 6, } } public partial class CertificateContact diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/assets.json b/sdk/keyvault/Azure.Security.KeyVault.Certificates/assets.json index 3d555e91ec263..ceae51646e6a2 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/assets.json +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/keyvault/Azure.Security.KeyVault.Certificates", - "Tag": "net/keyvault/Azure.Security.KeyVault.Certificates_320abaee9a" + "Tag": "net/keyvault/Azure.Security.KeyVault.Certificates_11a73707a2" } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateClientOptions.cs b/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateClientOptions.cs index b63f82c4cf569..d90bf176b648c 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateClientOptions.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateClientOptions.cs @@ -16,7 +16,7 @@ public class CertificateClientOptions : ClientOptions /// For more information, see /// Key Vault versions. /// - internal const ServiceVersion LatestVersion = ServiceVersion.V7_5; + internal const ServiceVersion LatestVersion = ServiceVersion.V7_6_Preview_1; /// /// The versions of Azure Key Vault supported by this client @@ -54,6 +54,11 @@ public enum ServiceVersion /// The Key Vault API version 7.5. /// V7_5 = 5, + + /// + /// The Key Vault API version V7_6_Preview_1. + /// + V7_6_Preview_1 = 6, #pragma warning restore CA1707 // Identifiers should not contain underscores } @@ -94,6 +99,7 @@ internal string GetVersionString() ServiceVersion.V7_3 => "7.3", ServiceVersion.V7_4 => "7.4", ServiceVersion.V7_5 => "7.5", + ServiceVersion.V7_6_Preview_1 => "7.6-preview.1", _ => throw new ArgumentException(Version.ToString()), }; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificatesTestBase.cs b/sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificatesTestBase.cs index b38b255f8363b..6620b70d41c54 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificatesTestBase.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificatesTestBase.cs @@ -13,6 +13,7 @@ namespace Azure.Security.KeyVault.Certificates.Tests { [ClientTestFixture( + CertificateClientOptions.ServiceVersion.V7_6_Preview_1, CertificateClientOptions.ServiceVersion.V7_5, CertificateClientOptions.ServiceVersion.V7_4, CertificateClientOptions.ServiceVersion.V7_3, diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/CHANGELOG.md b/sdk/keyvault/Azure.Security.KeyVault.Keys/CHANGELOG.md index 00f3e43cec7e9..1734a9546135d 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/CHANGELOG.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/CHANGELOG.md @@ -10,6 +10,8 @@ ### Other Changes +- The default service version is now "V7_6_Preview_1". + ## 4.6.0 (2024-02-14) Changes from both the last release and the last beta include: @@ -106,7 +108,7 @@ The following changes are only breaking from the previous beta. They are not bre - Verify the challenge resource matches the vault domain. This should affect few customers who can set `KeyClientOptions.DisableChallengeResourceVerification` or `CryptographyClientOptions.DisableChallengeResourceVerification` to `true` to disable. - See https://aka.ms/azsdk/blog/vault-uri for more information. + See for more information. ## 4.3.0 (2022-03-24) @@ -397,7 +399,7 @@ Changes from both the last release and the last beta include: Version 4.0.0-preview.1 is the first preview of our efforts to create a user-friendly client library for Azure Key Vault. For more information about preview releases of other Azure SDK libraries, please visit -https://aka.ms/azure-sdk-preview1-net. +. This library is not a direct replacement for `Microsoft.Azure.KeyVault`. Applications using that library would require code changes to use `Azure.Security.KeyVault.Keys`. @@ -422,7 +424,7 @@ only). [Azure Identity documentation](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity) for more information -### `Microsoft.Azure.KeyVault` features not implemented in this release: +### `Microsoft.Azure.KeyVault` features not implemented in this release - Certificate management APIs - Cryptographic operations, e.g. sign, un/wrap, verify, en- and diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/api/Azure.Security.KeyVault.Keys.netstandard2.0.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/api/Azure.Security.KeyVault.Keys.netstandard2.0.cs index c33c46631e8aa..77b3469313e9c 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/api/Azure.Security.KeyVault.Keys.netstandard2.0.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/api/Azure.Security.KeyVault.Keys.netstandard2.0.cs @@ -159,7 +159,7 @@ public KeyClient(System.Uri vaultUri, Azure.Core.TokenCredential credential, Azu } public partial class KeyClientOptions : Azure.Core.ClientOptions { - public KeyClientOptions(Azure.Security.KeyVault.Keys.KeyClientOptions.ServiceVersion version = Azure.Security.KeyVault.Keys.KeyClientOptions.ServiceVersion.V7_5) { } + public KeyClientOptions(Azure.Security.KeyVault.Keys.KeyClientOptions.ServiceVersion version = Azure.Security.KeyVault.Keys.KeyClientOptions.ServiceVersion.V7_6_Preview_1) { } public bool DisableChallengeResourceVerification { get { throw null; } set { } } public Azure.Security.KeyVault.Keys.KeyClientOptions.ServiceVersion Version { get { throw null; } } public enum ServiceVersion @@ -170,6 +170,7 @@ public enum ServiceVersion V7_3 = 3, V7_4 = 4, V7_5 = 5, + V7_6_Preview_1 = 6, } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -429,7 +430,7 @@ public CryptographyClient(System.Uri keyId, Azure.Core.TokenCredential credentia } public partial class CryptographyClientOptions : Azure.Core.ClientOptions { - public CryptographyClientOptions(Azure.Security.KeyVault.Keys.Cryptography.CryptographyClientOptions.ServiceVersion version = Azure.Security.KeyVault.Keys.Cryptography.CryptographyClientOptions.ServiceVersion.V7_5) { } + public CryptographyClientOptions(Azure.Security.KeyVault.Keys.Cryptography.CryptographyClientOptions.ServiceVersion version = Azure.Security.KeyVault.Keys.Cryptography.CryptographyClientOptions.ServiceVersion.V7_6_Preview_1) { } public bool DisableChallengeResourceVerification { get { throw null; } set { } } public Azure.Security.KeyVault.Keys.Cryptography.CryptographyClientOptions.ServiceVersion Version { get { throw null; } } public enum ServiceVersion @@ -440,6 +441,7 @@ public enum ServiceVersion V7_3 = 3, V7_4 = 4, V7_5 = 5, + V7_6_Preview_1 = 6, } } public partial class DecryptParameters diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/assets.json b/sdk/keyvault/Azure.Security.KeyVault.Keys/assets.json index 59c5d87f82ee4..23e1dd31e6317 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/assets.json +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/keyvault/Azure.Security.KeyVault.Keys", - "Tag": "net/keyvault/Azure.Security.KeyVault.Keys_a8557a0a67" + "Tag": "net/keyvault/Azure.Security.KeyVault.Keys_5dc33e5113" } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Cryptography/CryptographyClientOptions.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Cryptography/CryptographyClientOptions.cs index ebc5f47514f5a..e4e3d9f681054 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Cryptography/CryptographyClientOptions.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Cryptography/CryptographyClientOptions.cs @@ -16,7 +16,7 @@ public class CryptographyClientOptions : ClientOptions /// For more information, see /// Key Vault versions. /// - internal const ServiceVersion LatestVersion = ServiceVersion.V7_5; + internal const ServiceVersion LatestVersion = ServiceVersion.V7_6_Preview_1; /// /// The versions of Azure Key Vault supported by this client @@ -54,6 +54,11 @@ public enum ServiceVersion /// The Key Vault API version 7.5. /// V7_5 = 5, + + /// + /// The Key Vault API version 7.6-preview.1. + /// + V7_6_Preview_1 = 6, #pragma warning restore CA1707 // Identifiers should not contain underscores } @@ -94,6 +99,7 @@ internal string GetVersionString() ServiceVersion.V7_3 => "7.3", ServiceVersion.V7_4 => "7.4", ServiceVersion.V7_5 => "7.5", + ServiceVersion.V7_6_Preview_1 => "7.6-preview.1", _ => throw new ArgumentException(Version.ToString()), }; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClientOptions.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClientOptions.cs index 0a423f9734386..53af4ace6a14d 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClientOptions.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClientOptions.cs @@ -16,7 +16,7 @@ public class KeyClientOptions : ClientOptions /// For more information, see /// Key Vault versions. /// - internal const ServiceVersion LatestVersion = ServiceVersion.V7_5; + internal const ServiceVersion LatestVersion = ServiceVersion.V7_6_Preview_1; /// /// The versions of Azure Key Vault supported by this client @@ -54,6 +54,11 @@ public enum ServiceVersion /// The Key Vault API version 7.5. /// V7_5 = 5, + + /// + /// The Key Vault API version V7_6_Preview_1. + /// + V7_6_Preview_1 = 6, #pragma warning restore CA1707 // Identifiers should not contain underscores } @@ -94,6 +99,7 @@ internal string GetVersionString() ServiceVersion.V7_3 => "7.3", ServiceVersion.V7_4 => "7.4", ServiceVersion.V7_5 => "7.5", + ServiceVersion.V7_6_Preview_1 => "7.6-preview.1", _ => throw new ArgumentException(Version.ToString()), }; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyRotationLifetimeAction.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyRotationLifetimeAction.cs index 8b6baff2d3254..34499114c71d5 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyRotationLifetimeAction.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyRotationLifetimeAction.cs @@ -37,6 +37,7 @@ internal KeyRotationLifetimeAction() /// /// Gets the that will be executed. + /// The value is compared case-insensitively by the service. /// public KeyRotationPolicyAction Action { get; private set; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/KeysTestBase.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/KeysTestBase.cs index 5de9d50e622d6..a2dd49ddea8ce 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/KeysTestBase.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/KeysTestBase.cs @@ -13,6 +13,7 @@ namespace Azure.Security.KeyVault.Keys.Tests { [ClientTestFixture( + KeyClientOptions.ServiceVersion.V7_6_Preview_1, KeyClientOptions.ServiceVersion.V7_5, KeyClientOptions.ServiceVersion.V7_4, KeyClientOptions.ServiceVersion.V7_3, diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/CHANGELOG.md b/sdk/keyvault/Azure.Security.KeyVault.Secrets/CHANGELOG.md index c5f0e76d6ea0d..6e2354363b267 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/CHANGELOG.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/CHANGELOG.md @@ -10,6 +10,8 @@ ### Other Changes +- The default service version is now "V7_6_Preview_1". + ## 4.6.0 (2024-02-14) Changes from both the last release and the last beta include: @@ -74,7 +76,7 @@ Changes from both the last release and the last beta include: - Verify the challenge resource matches the vault domain. This should affect few customers who can set `SecretClientOptions.DisableChallengeResourceVerification` to `true` to disable. - See https://aka.ms/azsdk/blog/vault-uri for more information. + See for more information. ## 4.3.0 (2022-03-24) @@ -218,14 +220,14 @@ Changes from both the last release and the last beta include: - `SecretClient.DeleteSecret` has been renamed to `SecretClient.StartDeleteSecret` and now returns a `DeleteSecretOperation` to track this long-running operation. - `SecretClient.RecoverDeletedSecret` has been renamed to `SecretClient.StartRecoverDeletedSecret` and now returns a `RecoverDeletedSecretOperation` to track this long-running operation. -### Major changes +### Major changes - Updated to work with the 1.0.0 release versions of Azure.Core and Azure.Identity. - `KeyModelFactory` added to create mocks of model types for testing. ## 4.0.0-preview.5 (2019-10-07) -### Breaking changes +### Breaking changes - `SecretBase` has been renamed to `SecretProperties`. - `Secret` and `DeletedSecret` no longer extend `SecretProperties`, but instead contain a `SecretProperties` property named `Properties`. @@ -234,9 +236,10 @@ Changes from both the last release and the last beta include: - All methods in `SecretClient` now include the word "Secret" consistent with `KeyClient` and `CertificateClient`. ## 4.0.0-preview.1 (2019-06-28) + Version 4.0.0-preview.1 is the first preview of our efforts to create a user-friendly client library for Azure Key Vault. For more information about preview releases of other Azure SDK libraries, please visit -https://aka.ms/azure-sdk-preview1-net. +. This library is not a direct replacement for `Microsoft.Azure.KeyVault`. Applications using that library would require code changes to use `Azure.Security.KeyVault.Secrets`. @@ -247,9 +250,10 @@ and demonstrate the new API. ### Major changes from `Microsoft.Azure.KeyVault` + - Packages scoped by functionality - - `Azure.Security.KeyVault.Secrets` contains a client for secret operations. - - `Azure.Security.KeyVault.Keys` contains a client for key operations. + - `Azure.Security.KeyVault.Secrets` contains a client for secret operations. + - `Azure.Security.KeyVault.Keys` contains a client for key operations. - Client instances are scoped to vaults (an instance interacts with one vault only). - Asynchronous and synchronous APIs in the `Azure.Security.KeyVault.Secrets` package. @@ -260,7 +264,8 @@ only). [Azure Identity documentation](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity) for more information -### `Microsoft.Azure.KeyVault` features not implemented in this release: +### `Microsoft.Azure.KeyVault` features not implemented in this release + - Certificate management APIs - National cloud support. This release supports public global cloud vaults, e.g. https://{vault-name}.vault.azure.net diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/api/Azure.Security.KeyVault.Secrets.netstandard2.0.cs b/sdk/keyvault/Azure.Security.KeyVault.Secrets/api/Azure.Security.KeyVault.Secrets.netstandard2.0.cs index c231ef8a47bd2..fffa9c1137641 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/api/Azure.Security.KeyVault.Secrets.netstandard2.0.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/api/Azure.Security.KeyVault.Secrets.netstandard2.0.cs @@ -95,7 +95,7 @@ public SecretClient(System.Uri vaultUri, Azure.Core.TokenCredential credential, } public partial class SecretClientOptions : Azure.Core.ClientOptions { - public SecretClientOptions(Azure.Security.KeyVault.Secrets.SecretClientOptions.ServiceVersion version = Azure.Security.KeyVault.Secrets.SecretClientOptions.ServiceVersion.V7_5) { } + public SecretClientOptions(Azure.Security.KeyVault.Secrets.SecretClientOptions.ServiceVersion version = Azure.Security.KeyVault.Secrets.SecretClientOptions.ServiceVersion.V7_6_Preview_1) { } public bool DisableChallengeResourceVerification { get { throw null; } set { } } public Azure.Security.KeyVault.Secrets.SecretClientOptions.ServiceVersion Version { get { throw null; } } public enum ServiceVersion @@ -106,6 +106,7 @@ public enum ServiceVersion V7_3 = 3, V7_4 = 4, V7_5 = 5, + V7_6_Preview_1 = 6, } } public static partial class SecretModelFactory diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/assets.json b/sdk/keyvault/Azure.Security.KeyVault.Secrets/assets.json index 73d76b643745d..2f5fc05d04bfe 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/assets.json +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/keyvault/Azure.Security.KeyVault.Secrets", - "Tag": "net/keyvault/Azure.Security.KeyVault.Secrets_18b0beab8a" + "Tag": "net/keyvault/Azure.Security.KeyVault.Secrets_835634e403" } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClientOptions.cs b/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClientOptions.cs index 86022586ccb4f..66dc3d1b60723 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClientOptions.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClientOptions.cs @@ -16,7 +16,7 @@ public class SecretClientOptions : ClientOptions /// For more information, see /// Key Vault versions. /// - internal const ServiceVersion LatestVersion = ServiceVersion.V7_5; + internal const ServiceVersion LatestVersion = ServiceVersion.V7_6_Preview_1; /// /// The versions of Azure Key Vault supported by this client library. @@ -53,6 +53,11 @@ public enum ServiceVersion /// The Key Vault API version 7.5. /// V7_5 = 5, + + /// + /// The Key Vault API version 7.6-preview.1. + /// + V7_6_Preview_1 = 6, #pragma warning restore CA1707 // Identifiers should not contain underscores } @@ -92,6 +97,7 @@ internal string GetVersionString() ServiceVersion.V7_3 => "7.3", ServiceVersion.V7_4 => "7.4", ServiceVersion.V7_5 => "7.5", + ServiceVersion.V7_6_Preview_1 => "7.6-preview.1", _ => throw new ArgumentException(Version.ToString()), }; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/SecretsTestBase.cs b/sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/SecretsTestBase.cs index 4b3f24fe846f4..1b5f7577b81ca 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/SecretsTestBase.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/SecretsTestBase.cs @@ -14,6 +14,7 @@ namespace Azure.Security.KeyVault.Secrets.Tests { [ClientTestFixture( + SecretClientOptions.ServiceVersion.V7_6_Preview_1, SecretClientOptions.ServiceVersion.V7_5, SecretClientOptions.ServiceVersion.V7_4, SecretClientOptions.ServiceVersion.V7_3, diff --git a/sdk/keyvault/test-resources.json b/sdk/keyvault/test-resources.json index 6f70888a84511..f8d5d93e57113 100644 --- a/sdk/keyvault/test-resources.json +++ b/sdk/keyvault/test-resources.json @@ -283,40 +283,44 @@ } } ], - "outputs": { - "AZURE_KEYVAULT_URL": { - "type": "string", - "value": "[reference(variables('kvName')).vaultUri]" - }, - "AZURE_MANAGEDHSM_URL": { - "type": "string", - "condition": "[parameters('enableHsm')]", - "value": "[reference(variables('hsmName')).hsmUri]" - }, - "KEYVAULT_SKU": { - "type": "string", - "value": "[reference(parameters('baseName')).sku.name]" - }, - "CLIENT_OBJECTID": { - "type": "string", - "value": "[parameters('testApplicationOid')]" - }, - "BLOB_STORAGE_ACCOUNT_NAME": { - "type": "string", - "value": "[variables('primaryAccountName')]" - }, - "BLOB_PRIMARY_STORAGE_ACCOUNT_KEY": { - "type": "string", - "value": "[listKeys(variables('primaryAccountName'), variables('mgmtApiVersion')).keys[0].value]" - }, - "BLOB_CONTAINER_NAME" : { - "type": "string", - "value": "[variables('blobContainerName')]" - }, - "AZURE_KEYVAULT_ATTESTATION_URL": { - "type": "string", - "condition": "[parameters('enableAttestation')]", - "value": "[format('https://{0}/', reference(variables('attestationSite')).defaultHostName)]" - } + "outputs": { + "AZURE_KEYVAULT_URL": { + "type": "string", + "value": "[reference(variables('kvName')).vaultUri]" + }, + "AZURE_MANAGEDHSM_URL": { + "type": "string", + "condition": "[parameters('enableHsm')]", + "value": "[reference(variables('hsmName')).hsmUri]" + }, + "KEYVAULT_SKU": { + "type": "string", + "value": "[reference(parameters('baseName')).sku.name]" + }, + "CLIENT_OBJECTID": { + "type": "string", + "value": "[parameters('testApplicationOid')]" + }, + "BLOB_STORAGE_ACCOUNT_NAME": { + "type": "string", + "value": "[variables('primaryAccountName')]" + }, + "BLOB_PRIMARY_STORAGE_ACCOUNT_KEY": { + "type": "string", + "value": "[listKeys(variables('primaryAccountName'), variables('mgmtApiVersion')).keys[0].value]" + }, + "BLOB_CONTAINER_NAME": { + "type": "string", + "value": "[variables('blobContainerName')]" + }, + "AZURE_KEYVAULT_ATTESTATION_URL": { + "type": "string", + "condition": "[parameters('enableAttestation')]", + "value": "[format('https://{0}/', reference(variables('attestationSite')).defaultHostName)]" + }, + "KEYVAULT_TENANT_ID": { + "type": "string", + "value": "[parameters('tenantId')]" } + } } From 1c5804ebd4479cf6ebd480355d1075290fe71488 Mon Sep 17 00:00:00 2001 From: Ralph <18542438+ralph-msft@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:52:34 -0700 Subject: [PATCH 30/71] Adds a basic test framework (#45431) Distills the previous test framework that was used down to the very basics removing anything extraneous. This is in preparation for moving both OpenAI and Azure OpenAI libraries to a common test framework. Included in this test framework: - Support for automatically testing both synchronous and asynchronous method implementations in your clients with only a single asynchronous test. For this to work you need to do a couple of things: - Makes sure you extend `ClientTestBase` (or `RecordedClientTestBase`) in your test class - Make sure that your client defines both a synchronous and asynchronous version of the same method that takes the exact same arguments in the same order. The return types should differ only in being the asynchronous/synchronous versions of each other (e.g. `ClientResult` for synchronous and `Task` for asynchronous) - Make sure that both the synchronous and asynchronous methods are `virtual` - In your test code, create an instance of the type you want to test, and then call `WrapClient(...your instance...)`. This will return a special proxied version of your instance that will call either your synchronous or asynchronous methods - When writing your test cases, implement only the asynchronous version of the test - The framework will then automatically call the synchronous versions of your methods during the synchronous test run. - Support for capturing sent requests and responses and saving them to a file. You can then run future tests by playing back this captured data. This can significantly speed up testing, as well as reduce service load --- .../src/Azure.AI.OpenAI.Assistants.csproj | 1 - .../tools/TestFramework/Directory.Build.props | 18 + .../tools/TestFramework/TestFramework.sln | 31 + sdk/openai/tools/TestFramework/assets.json | 6 + .../Adapters/SyncToAsyncCollectionResult.cs | 83 +++ .../src/Adapters/SyncToAsyncEnumerable.cs | 46 ++ .../src/Adapters/SyncToAsyncEnumerator.cs | 64 ++ .../src/Adapters/SyncToAsyncPageCollection.cs | 67 ++ .../TestFramework/src/AsyncOnlyAttribute.cs | 14 + .../AutoSyncAsync/AsyncToSyncInterceptor.cs | 429 +++++++++++ .../src/AutoSyncAsync/AutoSyncAsyncMixIn.cs | 27 + .../src/AutoSyncAsync/IAutoSyncAsync.cs | 22 + .../AutoSyncAsync/TestProxyGenerationHook.cs | 45 ++ .../src/AutoSyncAsync/ThisLeakInterceptor.cs | 25 + .../src/AutoSyncAsyncTestFixtureAttribute.cs | 32 + .../tools/TestFramework/src/ClientTestBase.cs | 174 +++++ .../src/Mocks/CapturedMessage.cs | 175 +++++ .../src/Mocks/MockAsyncCollectionResult.cs | 32 + .../src/Mocks/MockAsyncPageCollection.cs | 70 ++ .../src/Mocks/MockCollectionResult.cs | 36 + .../TestFramework/src/Mocks/MockHeaders.cs | 91 +++ .../src/Mocks/MockHttpMessageHandler.cs | 124 ++++ .../src/Mocks/MockPageCollection.cs | 71 ++ .../src/Mocks/MockPipelineResponse.cs | 88 +++ .../src/Mocks/MockRequestHeaders.cs | 38 + .../src/Mocks/MockResponseHeaders.cs | 26 + .../src/Mocks/MockRestService.cs | 413 +++++++++++ .../src/Mocks/MockRestServiceClient.cs | 274 +++++++ .../src/OpenAI.TestFramework.csproj | 39 + .../src/RecordedClientTestBase.cs | 423 +++++++++++ .../src/RecordedTestAttribute.cs | 18 + .../TestFramework/src/RecordedTestMode.cs | 25 + .../TestFramework/src/Recording/Condition.cs | 16 + .../src/Recording/HeaderCondition.cs | 15 + .../src/Recording/Matchers/BaseMatcher.cs | 38 + .../src/Recording/Matchers/CustomMatcher.cs | 42 ++ .../src/Recording/Matchers/ExistingMatcher.cs | 35 + .../src/Recording/Proxy/ProxyClient.cs | 679 ++++++++++++++++++ .../src/Recording/Proxy/ProxyClientOptions.cs | 31 + .../src/Recording/Proxy/ProxyClientResult.cs | 65 ++ .../src/Recording/Proxy/ProxyService.cs | 256 +++++++ .../Recording/Proxy/ProxyServiceOptions.cs | 82 +++ .../src/Recording/Proxy/ProxyTransport.cs | 216 ++++++ .../Recording/Proxy/ProxyTransportOptions.cs | 72 ++ .../src/Recording/Proxy/RequestRecordMode.cs | 23 + .../src/Recording/Proxy/Service/PemPair.cs | 15 + .../Service/ProxyServiceRecordingOptions.cs | 25 + .../ProxyServiceTransportCustomizations.cs | 40 ++ .../Service/RecordingStartInformation.cs | 30 + .../Proxy/Service/SanitizerIdList.cs | 15 + .../Sanitizers/BaseRegexSanitizer.cs | 25 + .../src/Recording/Sanitizers/BaseSanitizer.cs | 53 ++ .../Recording/Sanitizers/BodyKeySanitizer.cs | 25 + .../Sanitizers/BodyRegexSanitizer.cs | 25 + .../Sanitizers/HeaderRegexSanitizer.cs | 25 + .../Recording/Sanitizers/UriRegexSanitizer.cs | 20 + .../TestFramework/src/Recording/TestRandom.cs | 38 + .../src/Recording/TestRecording.cs | 250 +++++++ .../TestRecordingMismatchException.cs | 44 ++ .../src/Recording/TestRecordingOptions.cs | 151 ++++ .../src/Recording/Transforms/BaseTransform.cs | 37 + .../Recording/Transforms/HeaderTransform.cs | 35 + .../TestFramework/src/SyncOnlyAttribute.cs | 14 + .../TestFramework/src/Utils/AndPreFilters.cs | 37 + .../TestFramework/src/Utils/AssemblyHelper.cs | 100 +++ .../tools/TestFramework/src/Utils/Default.cs | 108 +++ .../TestFramework/src/Utils/Extensions.cs | 396 ++++++++++ .../src/Utils/IUtf8JsonSerializable.cs | 19 + .../TestFramework/src/Utils/JsonHelpers.cs | 143 ++++ .../src/Utils/PropertyDelegate.cs | 49 ++ .../src/Utils/SyncAsyncPreFilter.cs | 41 ++ .../src/Utils/TestClientRetryPolicy.cs | 84 +++ .../src/Utils/TestPipelinePolicy.cs | 57 ++ .../Utils/TimespanToMillisecondConverter.cs | 65 ++ .../Utils/Utf8JsonSerializableConverter.cs | 55 ++ .../TestFramework/src/Utils/WindowsJob.cs | 208 ++++++ .../TestFramework/tests/AdaptersTests.cs | 107 +++ .../TestFramework/tests/AutoSyncAsyncTests.cs | 201 ++++++ .../TestFramework/tests/Helpers/MockClient.cs | 149 ++++ .../tests/Helpers/MockClientContext.cs | 9 + .../tests/MockStringServiceTests.cs | 146 ++++ .../tests/OpenAI.TestFramework.Tests.csproj | 21 + .../TestFramework/tests/ProxyServiceTests.cs | 351 +++++++++ 83 files changed, 7809 insertions(+), 1 deletion(-) create mode 100644 sdk/openai/tools/TestFramework/Directory.Build.props create mode 100644 sdk/openai/tools/TestFramework/TestFramework.sln create mode 100644 sdk/openai/tools/TestFramework/assets.json create mode 100644 sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncCollectionResult.cs create mode 100644 sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerable.cs create mode 100644 sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerator.cs create mode 100644 sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncPageCollection.cs create mode 100644 sdk/openai/tools/TestFramework/src/AsyncOnlyAttribute.cs create mode 100644 sdk/openai/tools/TestFramework/src/AutoSyncAsync/AsyncToSyncInterceptor.cs create mode 100644 sdk/openai/tools/TestFramework/src/AutoSyncAsync/AutoSyncAsyncMixIn.cs create mode 100644 sdk/openai/tools/TestFramework/src/AutoSyncAsync/IAutoSyncAsync.cs create mode 100644 sdk/openai/tools/TestFramework/src/AutoSyncAsync/TestProxyGenerationHook.cs create mode 100644 sdk/openai/tools/TestFramework/src/AutoSyncAsync/ThisLeakInterceptor.cs create mode 100644 sdk/openai/tools/TestFramework/src/AutoSyncAsyncTestFixtureAttribute.cs create mode 100644 sdk/openai/tools/TestFramework/src/ClientTestBase.cs create mode 100644 sdk/openai/tools/TestFramework/src/Mocks/CapturedMessage.cs create mode 100644 sdk/openai/tools/TestFramework/src/Mocks/MockAsyncCollectionResult.cs create mode 100644 sdk/openai/tools/TestFramework/src/Mocks/MockAsyncPageCollection.cs create mode 100644 sdk/openai/tools/TestFramework/src/Mocks/MockCollectionResult.cs create mode 100644 sdk/openai/tools/TestFramework/src/Mocks/MockHeaders.cs create mode 100644 sdk/openai/tools/TestFramework/src/Mocks/MockHttpMessageHandler.cs create mode 100644 sdk/openai/tools/TestFramework/src/Mocks/MockPageCollection.cs create mode 100644 sdk/openai/tools/TestFramework/src/Mocks/MockPipelineResponse.cs create mode 100644 sdk/openai/tools/TestFramework/src/Mocks/MockRequestHeaders.cs create mode 100644 sdk/openai/tools/TestFramework/src/Mocks/MockResponseHeaders.cs create mode 100644 sdk/openai/tools/TestFramework/src/Mocks/MockRestService.cs create mode 100644 sdk/openai/tools/TestFramework/src/Mocks/MockRestServiceClient.cs create mode 100644 sdk/openai/tools/TestFramework/src/OpenAI.TestFramework.csproj create mode 100644 sdk/openai/tools/TestFramework/src/RecordedClientTestBase.cs create mode 100644 sdk/openai/tools/TestFramework/src/RecordedTestAttribute.cs create mode 100644 sdk/openai/tools/TestFramework/src/RecordedTestMode.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Condition.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/HeaderCondition.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Matchers/BaseMatcher.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Matchers/CustomMatcher.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Matchers/ExistingMatcher.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClient.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientOptions.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientResult.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyService.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyServiceOptions.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransport.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransportOptions.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/RequestRecordMode.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/PemPair.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceRecordingOptions.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceTransportCustomizations.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/RecordingStartInformation.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/SanitizerIdList.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseRegexSanitizer.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseSanitizer.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyKeySanitizer.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyRegexSanitizer.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Sanitizers/HeaderRegexSanitizer.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Sanitizers/UriRegexSanitizer.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/TestRandom.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/TestRecording.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/TestRecordingMismatchException.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/TestRecordingOptions.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Transforms/BaseTransform.cs create mode 100644 sdk/openai/tools/TestFramework/src/Recording/Transforms/HeaderTransform.cs create mode 100644 sdk/openai/tools/TestFramework/src/SyncOnlyAttribute.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/AndPreFilters.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/AssemblyHelper.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/Default.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/Extensions.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/IUtf8JsonSerializable.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/JsonHelpers.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/PropertyDelegate.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/SyncAsyncPreFilter.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/TestClientRetryPolicy.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/TestPipelinePolicy.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/TimespanToMillisecondConverter.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/Utf8JsonSerializableConverter.cs create mode 100644 sdk/openai/tools/TestFramework/src/Utils/WindowsJob.cs create mode 100644 sdk/openai/tools/TestFramework/tests/AdaptersTests.cs create mode 100644 sdk/openai/tools/TestFramework/tests/AutoSyncAsyncTests.cs create mode 100644 sdk/openai/tools/TestFramework/tests/Helpers/MockClient.cs create mode 100644 sdk/openai/tools/TestFramework/tests/Helpers/MockClientContext.cs create mode 100644 sdk/openai/tools/TestFramework/tests/MockStringServiceTests.cs create mode 100644 sdk/openai/tools/TestFramework/tests/OpenAI.TestFramework.Tests.csproj create mode 100644 sdk/openai/tools/TestFramework/tests/ProxyServiceTests.cs diff --git a/sdk/openai/Azure.AI.OpenAI.Assistants/src/Azure.AI.OpenAI.Assistants.csproj b/sdk/openai/Azure.AI.OpenAI.Assistants/src/Azure.AI.OpenAI.Assistants.csproj index 50238e0a57e17..306eca75e078c 100644 --- a/sdk/openai/Azure.AI.OpenAI.Assistants/src/Azure.AI.OpenAI.Assistants.csproj +++ b/sdk/openai/Azure.AI.OpenAI.Assistants/src/Azure.AI.OpenAI.Assistants.csproj @@ -16,7 +16,6 @@ - diff --git a/sdk/openai/tools/TestFramework/Directory.Build.props b/sdk/openai/tools/TestFramework/Directory.Build.props new file mode 100644 index 0000000000000..f85173f268872 --- /dev/null +++ b/sdk/openai/tools/TestFramework/Directory.Build.props @@ -0,0 +1,18 @@ + + + + false + true + false + false + false + false + true + + + + + diff --git a/sdk/openai/tools/TestFramework/TestFramework.sln b/sdk/openai/tools/TestFramework/TestFramework.sln new file mode 100644 index 0000000000000..a88dc3caf53d2 --- /dev/null +++ b/sdk/openai/tools/TestFramework/TestFramework.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35013.160 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenAI.TestFramework.Tests", "tests\OpenAI.TestFramework.Tests.csproj", "{61E849EB-F8BC-47C7-B730-874DD678BEA7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenAI.TestFramework", "src\OpenAI.TestFramework.csproj", "{BE2FF759-255B-44A8-BAE7-73E287AEEB97}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {61E849EB-F8BC-47C7-B730-874DD678BEA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {61E849EB-F8BC-47C7-B730-874DD678BEA7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {61E849EB-F8BC-47C7-B730-874DD678BEA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {61E849EB-F8BC-47C7-B730-874DD678BEA7}.Release|Any CPU.Build.0 = Release|Any CPU + {BE2FF759-255B-44A8-BAE7-73E287AEEB97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE2FF759-255B-44A8-BAE7-73E287AEEB97}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE2FF759-255B-44A8-BAE7-73E287AEEB97}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE2FF759-255B-44A8-BAE7-73E287AEEB97}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F145C399-D9D8-45F9-87DC-4BFFF983FA91} + EndGlobalSection +EndGlobal diff --git a/sdk/openai/tools/TestFramework/assets.json b/sdk/openai/tools/TestFramework/assets.json new file mode 100644 index 0000000000000..d33e24017e08e --- /dev/null +++ b/sdk/openai/tools/TestFramework/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/openai/OpenAI.TestFramework", + "Tag": "net/openai/OpenAI.TestFramework_f41330e3ac" +} diff --git a/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncCollectionResult.cs b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncCollectionResult.cs new file mode 100644 index 0000000000000..64096eb4af542 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncCollectionResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; + +namespace OpenAI.TestFramework.Adapters; + +/// +/// An adapter to make a look and work like a . This +/// simplifies writing test cases +/// +/// The type of the items the enumerator returns +public class SyncToAsyncCollectionResult : AsyncCollectionResult +{ + private bool _responseSet; + private CollectionResult? _syncCollection; + private Exception? _ex; + + /// + /// Creates a new instance + /// + /// The synchronous collection to wrap + /// If the collection was null + public SyncToAsyncCollectionResult(CollectionResult syncCollection) + { + _syncCollection = syncCollection ?? throw new ArgumentNullException(nameof(syncCollection)); + TrySetRawResponse(); + } + + /// + /// Creates a new instance. + /// + /// The exception to throw. + /// If the exception was null. + public SyncToAsyncCollectionResult(Exception ex) + { + _ex = ex ?? throw new ArgumentNullException(nameof(ex)); + _syncCollection = null; + } + + /// + public override IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return InnerEnumerable(cancellationToken).GetAsyncEnumerator(); + } + + private async IAsyncEnumerable InnerEnumerable([EnumeratorCancellation] CancellationToken cancellationToken = default) + { + if (_ex != null) + { + ExceptionDispatchInfo.Capture(_ex).Throw(); + } + + var asyncWrapper = new SyncToAsyncEnumerator(_syncCollection?.GetEnumerator()!, cancellationToken); + while (await asyncWrapper.MoveNextAsync().ConfigureAwait(false)) + { + TrySetRawResponse(); + yield return asyncWrapper.Current; + } + } + + private void TrySetRawResponse() + { + if (_responseSet) + { + return; + } + + // Client result doesn't provide virtual methods so we have to manually set it ourselves here + try + { + var raw = _syncCollection?.GetRawResponse(); + if (raw != null) + { + SetRawResponse(raw); + _responseSet = true; + } + } + catch (Exception) { /* dont' care */ } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerable.cs b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerable.cs new file mode 100644 index 0000000000000..c71c1a0e1d57c --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerable.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Adapters; + +/// +/// Wraps an as an +/// +/// The type of items being enumerated. +public class SyncToAsyncEnumerable : IAsyncEnumerable +{ + private IEnumerable _enumerable; + Exception? _ex; + + /// + /// Creates a new instance. + /// + /// The synchronous enumerable to wrap. + public SyncToAsyncEnumerable(IEnumerable enumerable) + { + _enumerable = enumerable; + } + + /// + /// Creates a new instance. + /// + /// The synchronous enumerable to wrap. + public SyncToAsyncEnumerable(Exception ex) + { + _ex = ex; + _enumerable = Array.Empty(); + } + + /// + public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + if (_ex != null) + { + return new SyncToAsyncEnumerator(_ex); + } + else + { + return new SyncToAsyncEnumerator(_enumerable.GetEnumerator(), cancellationToken); + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerator.cs b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerator.cs new file mode 100644 index 0000000000000..fa0ce81b02b0d --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerator.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.ExceptionServices; + +namespace OpenAI.TestFramework.Adapters; + +/// +/// Wraps an as an +/// +/// The type of items being enumerated. +public class SyncToAsyncEnumerator : IAsyncEnumerator +{ + private IEnumerator _sync; + private CancellationToken _token; + private Exception? _ex; + + /// + /// Creates a new instance. + /// + /// The synchronous enumerator to wrap. + /// (Optional) The cancellation token to use. + /// If the enumerator was null. + public SyncToAsyncEnumerator(IEnumerator sync, CancellationToken token = default) + { + _sync = sync ?? throw new ArgumentNullException(nameof(sync)); + _token = token; + } + + /// + /// Creates a new instance. + /// + /// The exception to throw. + /// If the exception was null. + public SyncToAsyncEnumerator(Exception ex) + { + _sync = Enumerable.Empty().GetEnumerator(); + _token = default; + _ex = ex ?? throw new ArgumentNullException(nameof(ex)); + } + + /// + public T Current => _sync.Current; + + /// + public ValueTask DisposeAsync() + { + _sync.Dispose(); + return default; + } + + /// + public ValueTask MoveNextAsync() + { + if (_ex != null) + { + ExceptionDispatchInfo.Capture(_ex).Throw(); + } + + _token.ThrowIfCancellationRequested(); + bool ret = _sync.MoveNext(); + return new ValueTask(ret); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncPageCollection.cs b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncPageCollection.cs new file mode 100644 index 0000000000000..89b9631376135 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncPageCollection.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.Runtime.ExceptionServices; + +namespace OpenAI.TestFramework.Adapters; + +/// +/// An adapter to make a look and work like a . This +/// simplifies writing test cases. +/// +/// The type of the items the enumerator returns. +public class SyncToAsyncPageCollection : AsyncPageCollection +{ + private PageCollection? _syncCollection; + private Exception? _ex; + + /// + /// Creates a new instance. + /// + /// The synchronous collection to wrap. + /// If the collection was null. + public SyncToAsyncPageCollection(PageCollection syncCollection) + { + _syncCollection = syncCollection ?? throw new ArgumentNullException(nameof(syncCollection)); + } + + /// + /// Creates a new instance. + /// + /// The exception to throw. + /// If the exception was null. + public SyncToAsyncPageCollection(Exception ex) + { + _ex = ex ?? throw new ArgumentNullException(nameof(ex)); + _syncCollection = null; + } + + /// + protected override Task> GetCurrentPageAsyncCore() + { + if (_ex != null) + { + return Task.FromException>(_ex); + } + else + { + return Task.FromResult(_syncCollection!.GetCurrentPage()); + } + } + + /// + protected override async IAsyncEnumerator> GetAsyncEnumeratorCore(CancellationToken cancellationToken = default) + { + if (_ex != null) + { + ExceptionDispatchInfo.Capture(_ex).Throw(); + } + + foreach (PageResult page in _syncCollection!) + { + await Task.Delay(0).ConfigureAwait(false); + yield return page; + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/AsyncOnlyAttribute.cs b/sdk/openai/tools/TestFramework/src/AsyncOnlyAttribute.cs new file mode 100644 index 0000000000000..3fbfc191f3e32 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AsyncOnlyAttribute.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; + +namespace OpenAI.TestFramework; + +/// +/// Attribute that can be applied to a test to indicate it only runs in asynchronous mode. +/// +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] +public class AsyncOnlyAttribute() : NUnitAttribute +{ +} diff --git a/sdk/openai/tools/TestFramework/src/AutoSyncAsync/AsyncToSyncInterceptor.cs b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/AsyncToSyncInterceptor.cs new file mode 100644 index 0000000000000..08fe268ec8c27 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/AsyncToSyncInterceptor.cs @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.Collections.Concurrent; +using System.Diagnostics; +using System.Reflection; +using Castle.DynamicProxy; +using OpenAI.TestFramework.Adapters; +using Ext = OpenAI.TestFramework.Utils.TypeExtensions; + +namespace OpenAI.TestFramework.AutoSyncAsync; + +/// +/// An interceptor for Castle dynamic proxies that allows you to call the synchronous version of a method when the asynchronous one +/// is called on the proxy. This is useful for testing where you can write the async version of a test, and then automatically test +/// both async and sync methods with the same test code. +/// +[DebuggerStepThrough] +public class AsyncToSyncInterceptor : IInterceptor +{ + private const string AsyncSuffix = "Async"; + + private static readonly TypeArrayEquality s_typeArrayEquality = new(); + private static readonly ConcurrentDictionary> s_syncAsyncPairs = new(); + private static readonly MethodInfo s_taskFromResult = typeof(Task).GetMethod(nameof(Task.FromResult), BindingFlags.Public | BindingFlags.Static)!; + private static readonly MethodInfo s_taskFromException = typeof(Task) + .GetMethods(BindingFlags.Static | BindingFlags.Public) + .Where(m => m.Name == nameof(Task.FromException) && m.IsGenericMethodDefinition) + .First(); + + private readonly BindingFlags _flags; + + /// + /// Creates a new instance. + /// + /// True if you want to use async methods, false otherwise. + /// The binding flags to use when searching for methods. Default is public instance methods. + public AsyncToSyncInterceptor(bool useAsync, BindingFlags flags = BindingFlags.Public | BindingFlags.Instance) + { + UseAsync = useAsync; + _flags = flags; + } + + /// + /// Gets the shared use sync methods instance. + /// + public static AsyncToSyncInterceptor UseSyncMethods { get; } = new(false); + + /// + /// Gets the shared use async methods instance. + /// + public static AsyncToSyncInterceptor UseAsyncMethods { get; } = new(true); + + /// + [DebuggerStepThrough] + public virtual void Intercept(IInvocation invocation) + { + // 1. Should we even intercept this? + if (ShouldSkipIntercepting(invocation.Method)) + { + invocation.Proceed(); + return; + } + + // 2. Check if this method is one of a pair of Operation and OperationAsync methods. + bool isSyncAsyncPair = IsMethodSyncAsyncPair(invocation.Method); + if (!isSyncAsyncPair) + { + throw CreateEx("Method does not have a synchronous and asynchronous pair", invocation.Method); + } + + // 3. If it is, check if the method is the synchronous version. We only allow async versions in the test code + bool isAsyncMethod = invocation.Method.Name.EndsWith(AsyncSuffix); + if (!isAsyncMethod) + { + throw CreateEx("You must use the asynchronous versions of the methods when writing your tests", invocation.Method); + } + + Type asyncReturnType = invocation.Method.ReturnType; + + // 4. Call the correct synchronous or asynchronous method and warp the returned result or exception + if (UseAsync) + { + // Async method running in async mode, no need to do anything, special, continue normally + invocation.Proceed(); + } + else + { + // Call the equivalent sync method + string methodName = RemoveAsyncSuffix(invocation.Method.Name); + Type expectedReturnType = ToSyncRetType(asyncReturnType); + Type[] expectedArgs = invocation.Method.GetParameters().Select(p => p.ParameterType).ToArray(); + + MethodInfo syncMethod = invocation.TargetType.GetMethod( + methodName, _flags, binder: null, expectedArgs, modifiers: null)!; + + // this should never happen since we've already checked for the existence of the expected method + Debug.Assert(syncMethod != null); + if (syncMethod == null) + { + throw CreateEx("Could not find the synchronous version of the method", invocation.Method); + } + + if (syncMethod.ContainsGenericParameters) + { + syncMethod = syncMethod.MakeGenericMethod(invocation.Method.GetGenericArguments()); + } + + // Call the synchronous method + try + { + object? result = syncMethod.Invoke(invocation.InvocationTarget, invocation.Arguments); + if (result != null && !expectedReturnType.IsAssignableFrom(result.GetType())) + { + throw CreateEx("The synchronous method returned an unexpected type", invocation.Method); + } + + invocation.ReturnValue = ToAsyncResult(asyncReturnType, result); + } + catch (TargetInvocationException ex) + { + invocation.ReturnValue = ToAsyncException(asyncReturnType, ex.InnerException ?? ex); + } + } + } + + /// + /// Whether or not we are using async methods. + /// + public bool UseAsync { get; } + + /// Determines whether or not we should skip intercepting this method or not. + /// + /// The method we are inspecting. + /// True to skip intercepting this method, false otherwise. + protected virtual bool ShouldSkipIntercepting(MethodInfo? method) + { + return method == null + // Skip for special names (i.e. getters and setters) + || method.IsSpecialName + // Also for dispose methods + || method.Name == nameof(IDisposable.Dispose) + || method.Name == nameof(IAsyncDisposable.DisposeAsync); + } + + /// + /// Determines whether or not the specified method is part of a pair of synchronous and asynchronous methods. This will + /// check based on 3 factors: + /// + /// If there is a "???" and "???Async" pair of named methods + /// If the arguments are exactly the same for both methods + /// If we know how to determine the expected return type for the synchronous method, from the asynchronous one + /// + /// + /// The method to check. + /// True if it is, false otherwise. + protected virtual bool IsMethodSyncAsyncPair(MethodInfo? method) + { + if (method == null || method.DeclaringType == null) + { + return false; + } + + ISet validPrefixes = s_syncAsyncPairs.GetOrAdd(method.DeclaringType, t => DetermineValidSyncAsyncPairs(t, _flags)); + return validPrefixes.Contains(RemoveAsyncSuffix(method.Name)); + } + + /// + /// Determines what the corresponding synchronous return type would be for the specified asynchronous return type. + /// + /// The asynchronous return type. + /// The corresponding synchronous return type. + /// If we don't know what the equivalent would be. + protected virtual Type ToSyncRetType(Type asyncReturnType) + { + if (typeof(Task) == asyncReturnType || typeof(ValueTask) == asyncReturnType) + { + return typeof(void); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(Task<>), out Type[] genericTypes)) + { + return genericTypes[0]; + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(ValueTask<>), out genericTypes)) + { + return genericTypes[0]; + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(AsyncPageCollection<>), out genericTypes)) + { + return typeof(PageCollection<>).MakeGenericType(genericTypes); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(AsyncCollectionResult<>), out genericTypes)) + { + return typeof(CollectionResult<>).MakeGenericType(genericTypes); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(IAsyncEnumerable<>), out genericTypes)) + { + return typeof(IEnumerable<>).MakeGenericType(genericTypes); + } + else + { + throw new NotSupportedException("Don't know how to create the sync to async wrapper for " + asyncReturnType.FullName); + } + } + + /// + /// Wraps the result from a synchronous method into the equivalent asynchronous return type. + /// + /// The asynchronous return type. + /// The result to wrap. + /// The wrapped result. + /// If we don't support the conversion. + protected virtual object? ToAsyncResult(Type asyncReturnType, object? result) + { + if (typeof(Task) == asyncReturnType) + { + return Task.CompletedTask; + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(Task<>), out Type[] genericTypes)) + { + return s_taskFromResult + .MakeGenericMethod(genericTypes) + .Invoke(null, [result]); + } + else if (typeof(ValueTask) == asyncReturnType) + { + return new ValueTask(); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(ValueTask<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(ValueTask<>).MakeGenericType(genericTypes), + result); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(AsyncPageCollection<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(SyncToAsyncPageCollection<>).MakeGenericType(genericTypes), + result); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(AsyncCollectionResult<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(SyncToAsyncCollectionResult<>).MakeGenericType(genericTypes), + result); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(IAsyncEnumerable<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(SyncToAsyncEnumerable<>).MakeGenericType(genericTypes), + result); + } + else + { + throw new NotSupportedException("Don't know how to wrap the exception for " + asyncReturnType.FullName); + } + } + + /// + /// Wraps the exception from a synchronous method into the equivalent asynchronous return type. + /// + /// The asynchronous return type. + /// The exception to wrap. + /// The wrapped exception. + /// If we don't support the conversion. + protected virtual object? ToAsyncException(Type asyncReturnType, Exception ex) + { + if (typeof(Task) == asyncReturnType) + { + return Task.FromException(ex); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(Task<>), out Type[] genericTypes)) + { + return s_taskFromException + .MakeGenericMethod(genericTypes) + .Invoke(null, [ex]); + } + else if (typeof(ValueTask) == asyncReturnType) + { + return new ValueTask(Task.FromException(ex)); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(ValueTask<>), out genericTypes)) + { + var failedTask = s_taskFromException + .MakeGenericMethod(genericTypes) + .Invoke(null, [ex]); + return Activator.CreateInstance( + typeof(ValueTask<>).MakeGenericType(genericTypes), + failedTask); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(AsyncPageCollection<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(SyncToAsyncPageCollection<>).MakeGenericType(genericTypes), + ex); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(AsyncCollectionResult<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(SyncToAsyncCollectionResult<>).MakeGenericType(genericTypes), + ex); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(IAsyncEnumerable<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(SyncToAsyncEnumerable<>).MakeGenericType(genericTypes), + ex); + } + else + { + throw new NotSupportedException("Don't know how to determine the synchronous equivalent return type of " + asyncReturnType.FullName); + } + } + + private static InvalidOperationException CreateEx(string description, MethodInfo method) + { + return new InvalidOperationException($"{description}. '{method.DeclaringType?.Name} -> {method.Name}'"); + } + + private static string RemoveAsyncSuffix(string? name) + { + if (name == null) + return string.Empty; + + int index = name.LastIndexOf(AsyncSuffix); + return index >= 0 + ? name.Substring(0, index) + : name; + } + + [DebuggerStepperBoundary] + private ISet DetermineValidSyncAsyncPairs(Type declaringType, BindingFlags flags) + { + // Group potential pairs based only on the method name removing the "Async" postfix + var potentialPairs = declaringType.GetMethods(flags) + .Where(m => !m.IsSpecialName) + .GroupBy(m => RemoveAsyncSuffix(m.Name)) + .OrderBy(g => g.Key) + .Select(g => new + { + g.Key, + Potentials = g.Select(m => new + { + m.Name, + Args = m.GetParameters().Select(p => p.ParameterType).ToArray(), + Return = m.ReturnType, + }) + // Order by name to ensure OperationName comes before OperationNameAsync + .OrderBy(p => p.Name) + // Match on method arguments + .GroupBy(g => g.Args, s_typeArrayEquality) + .Select(g => g.ToArray()) + }); + + // Now evaluate potential pairs to ensure that for each argument list for that method, there exists both a synchronous + // and asynchronous version with equivalent return types + HashSet validPairPrefixes = new(); + + foreach (var entry in potentialPairs) + { + bool allValid = entry.Potentials.All(matchedPair => + { + // because of the way we sorted above, we should have exactly 2 entries here, the first is the synchronous method + // the second the corresponding asynchronous method + return matchedPair.Length == 2 + && matchedPair[0].Name + AsyncSuffix == matchedPair[1].Name + && matchedPair[0].Return == ToSyncRetType(matchedPair[1].Return); + }); + + if (allValid) + { + validPairPrefixes.Add(entry.Key); + } + } + + return validPairPrefixes; + } + + /// + /// Helper comparer that compares all of the Types in an array for equality. + /// + private class TypeArrayEquality : IEqualityComparer + { + /// + public bool Equals(Type[]? x, Type[]? y) + { + if (ReferenceEquals(x, y)) + { + return true; + } + else if (x == null || y == null) + { + return false; + } + else if (x.LongLength != y.LongLength) + { + return false; + } + + for (long i = 0; i < x.LongLength; i++) + { + if (x[i] != y[i]) + { + return false; + } + } + + return true; + } + + /// + public int GetHashCode(Type[] obj) + { + if (obj == null) + { + return 0; + } + + int rollingHash = 1; // to distinguish empty case from null case + for (long i = 0; i < obj.LongLength; i++) + { + rollingHash = (rollingHash, obj[i].GetHashCode()).GetHashCode(); + } + + return rollingHash; + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/AutoSyncAsync/AutoSyncAsyncMixIn.cs b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/AutoSyncAsyncMixIn.cs new file mode 100644 index 0000000000000..538f8fb75d16a --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/AutoSyncAsyncMixIn.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.AutoSyncAsync; + +/// +/// An implementation of that allows you to get the original back, as well as a place +/// to store an additional context. +/// +public class AutoSyncAsyncMixIn : IAutoSyncAsync +{ + /// + /// Creates a new instance. + /// + /// The original instance. + public AutoSyncAsyncMixIn(object original, object? context = null) + { + Original = original; + Context = context; + } + + /// + public object Original { get; } + + /// + public object? Context { get; } +} diff --git a/sdk/openai/tools/TestFramework/src/AutoSyncAsync/IAutoSyncAsync.cs b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/IAutoSyncAsync.cs new file mode 100644 index 0000000000000..551df75c52f01 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/IAutoSyncAsync.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.AutoSyncAsync; + +/// +/// An interface that serves as a way to identify a dynamically proxied class that supports automatic sync and async testing. This +/// also provides a way to get the the original un-proxied instance. +/// instance. +/// +public interface IAutoSyncAsync +{ + /// + /// Gets the original un-proxied instance back. + /// + public object Original { get; } + + /// + /// Any additional context associated with the instrumented object (e.g. options used to create it). + /// + public object? Context { get; } +} diff --git a/sdk/openai/tools/TestFramework/src/AutoSyncAsync/TestProxyGenerationHook.cs b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/TestProxyGenerationHook.cs new file mode 100644 index 0000000000000..d11d5d86fdfa1 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/TestProxyGenerationHook.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Reflection; +using Castle.DynamicProxy; +using NUnit.Framework.Interfaces; +using NUnit.Framework.Internal; + +namespace OpenAI.TestFramework.AutoSyncAsync +{ + /// + /// Controls which methods are skipped during dynamic proxy generation. + /// + public class TestProxyGenerationHook : IProxyGenerationHook + { + /// + public void MethodsInspected() + { } + + /// + public void NonProxyableMemberNotification(Type type, MemberInfo memberInfo) + { } + + /// + public bool ShouldInterceptMethod(Type type, MethodInfo methodInfo) + { + IMethodInfo? testMethod = TestExecutionContext.CurrentContext.CurrentTest.Method; + + if (methodInfo == null + // Skip for special names (i.e. getters and setters) + || methodInfo.IsSpecialName + // Also for dispose methods + || methodInfo.Name == nameof(IDisposable.Dispose) + || methodInfo.Name == nameof(IAsyncDisposable.DisposeAsync) + // If we are running a sync only or async only, skip intercepting altogether + || testMethod?.IsDefined(false) == true + || testMethod?.IsDefined(false) == true) + { + return false; + } + + return true; + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/AutoSyncAsync/ThisLeakInterceptor.cs b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/ThisLeakInterceptor.cs new file mode 100644 index 0000000000000..c7d6c1e70c381 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/ThisLeakInterceptor.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics; +using Castle.DynamicProxy; + +namespace OpenAI.TestFramework.AutoSyncAsync; + +/// +/// A basic interceptor that prevents the leaking of the original un-proxied this instance as a return value. +/// +public class ThisLeakInterceptor : IInterceptor +{ + /// + [DebuggerStepThrough] + public void Intercept(IInvocation invocation) + { + invocation.Proceed(); + + if (invocation.ReturnValue == invocation.InvocationTarget) + { + invocation.ReturnValue = invocation.Proxy; + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/AutoSyncAsyncTestFixtureAttribute.cs b/sdk/openai/tools/TestFramework/src/AutoSyncAsyncTestFixtureAttribute.cs new file mode 100644 index 0000000000000..29983a94d92ff --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AutoSyncAsyncTestFixtureAttribute.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; +using NUnit.Framework.Interfaces; +using NUnit.Framework.Internal; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework; + +/// +/// Attribute used to indicate that a test fixture should automatically be be run in both synchronous and asynchronous mode. +/// +[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] +public class AutoSyncAsyncTestFixtureAttribute : NUnitAttribute, IFixtureBuilder2 +{ + /// + public IEnumerable BuildFrom(ITypeInfo typeInfo) + => BuildFrom(typeInfo, null!); + + /// + public IEnumerable BuildFrom(ITypeInfo typeInfo, IPreFilter filter) + { + List suites = + [ + .. new TestFixtureAttribute([false]).BuildFrom(typeInfo, new AndPreFilter(filter, new SyncAsyncPreFilter(false))), + .. new TestFixtureAttribute([true]).BuildFrom(typeInfo, new AndPreFilter(filter, new SyncAsyncPreFilter(true))), + ]; + + return suites; + } +} diff --git a/sdk/openai/tools/TestFramework/src/ClientTestBase.cs b/sdk/openai/tools/TestFramework/src/ClientTestBase.cs new file mode 100644 index 0000000000000..7406e738e10da --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/ClientTestBase.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics; +using Castle.DynamicProxy; +using NUnit.Framework; +using NUnit.Framework.Internal; +using OpenAI.TestFramework.AutoSyncAsync; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework; + +/// +/// Base class for client test cases. This provides support for writing only a test that uses the Async version of +/// methods, and automatically creating a test that uses the equivalent Sync version of a method. Please note that +/// this will only work for public virtual methods. In order for this to work, you should write a test that uses the +/// async version of a method. +/// +[AutoSyncAsyncTestFixture] +public abstract class ClientTestBase +{ + private static ProxyGenerator? s_proxyGenerator = null; + private static ThisLeakInterceptor? s_thisLeakInterceptor = null; + private static AsyncToSyncInterceptor? s_asyncInterceptor = null; + private static AsyncToSyncInterceptor? s_syncInterceptor = null; + + private CancellationTokenSource? _cts = null; + + /// + /// Creates a new instance. + /// + /// True to run the async version of a test, false to run the sync version of a test. + public ClientTestBase(bool isAsync) + { + IsAsync = isAsync; + } + + /// + /// Gets whether or not we are running async tests. + /// + public virtual bool IsAsync { get; } + + /// + /// Gets the start time of the test. + /// + public virtual DateTimeOffset TestStartTime => TestExecutionContext.CurrentContext.StartTime.ToUniversalTime(); + + /// + /// Gets the test timeout. + /// + public virtual TimeSpan TestTimeout => Debugger.IsAttached + ? Default.DebuggerAttachedTestTimeout + : Default.TestTimeout; + + /// + /// Gets the cancellation token to use + /// + public virtual CancellationToken Token => _cts?.Token ?? default; + + [SetUp] + public void TestSetup() + { + _cts?.Dispose(); + _cts = new CancellationTokenSource(TestTimeout); + } + + [TearDown] + public void TestCleanup() + { + _cts?.Dispose(); + _cts = null; + } + + /// + /// Gets the instance to use to create proxies of classes + /// that allow you inject additional functionality in for testing. + /// + protected static ProxyGenerator ProxyGenerator => s_proxyGenerator ??= new ProxyGenerator(); + + /// + /// An interceptor that prevents leaking a reference to the original instance as a return value from methods. + /// + protected static ThisLeakInterceptor ThisLeakInterceptor => s_thisLeakInterceptor ??= new ThisLeakInterceptor(); + + /// + /// An interceptor to force the use of async version of a method. + /// + protected static AsyncToSyncInterceptor UseSyncMethodInterceptor => s_syncInterceptor ??= new AsyncToSyncInterceptor(false); + + /// + /// An interceptor to force the use of sync version of a method. + /// + protected static AsyncToSyncInterceptor UseAsyncMethodInterceptor => s_asyncInterceptor ??= new AsyncToSyncInterceptor(true); + + /// + /// Wraps a client for automatic sync/async testing. This will return a proxied version of the client that will allow you to + /// automatically use the sync versions of a method. + /// + /// The type of the client instance. + /// The client instance to instrument for testing. + /// (Optional) Any additional context to associate with the wrapped client. + /// (Optional) Any additional interceptors to use. + /// The proxied version of the client. + public T WrapClient(T client, object? context = null, params IInterceptor[] interceptors) where T : class + => (T)WrapClient(typeof(T), client, context, interceptors); + + /// + /// Gets the original client from a wrapped client. + /// + /// The type of the client. + /// The wrapped client instance. + /// The original client instance. + /// The the client passed was not wrapped. + public virtual T UnWrap(T wrapped) where T : class + { + if (wrapped is IAutoSyncAsync instrumented) + { + return (T)instrumented.Original; + } + + throw new NotSupportedException($"That instance was not wrapped using {nameof(WrapClient)}"); + } + + /// + /// Gets the context associated with the wrapped instance. + /// + /// The type of the client. + /// The wrapped client. + /// The associated context for the wrapped instance. Will be null if none was set. + /// The the instance passed was not wrapped. + public virtual object? GetClientContext(T client) where T : class + { + if (client is IAutoSyncAsync instrumented) + { + return instrumented.Context; + } + + throw new NotSupportedException($"That instance was not wrapped using {nameof(WrapClient)}"); + } + + /// + /// Wraps a client with sync/async equivalent methods for testing. This enables the automatic testing of the sync version + /// of methods if you write an async test case. + /// + /// The type of the client. + /// The client instance to wrap. + /// (Optional) Any additional context to associate with the wrapped client. + /// (Optional) Any additional interceptors to include. + /// The wrapped version of the client. + protected internal virtual object WrapClient(Type instanceType, object client, object? context, IEnumerable? interceptors) + { + List allInterceptors = new(); + + if (interceptors != null) + { + allInterceptors.AddRange(interceptors); + } + + allInterceptors.Add(ThisLeakInterceptor); + allInterceptors.Add(IsAsync ? UseAsyncMethodInterceptor : UseSyncMethodInterceptor); + + ProxyGenerationOptions options = new(new TestProxyGenerationHook()); + options.AddMixinInstance(new AutoSyncAsyncMixIn(client, context)); + + object proxy = ProxyGenerator.CreateClassProxyWithTarget( + instanceType, + [], + client, + options, + allInterceptors.ToArray()); + + return proxy; + } +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/CapturedMessage.cs b/sdk/openai/tools/TestFramework/src/Mocks/CapturedMessage.cs new file mode 100644 index 0000000000000..854b8cd7d04cf --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/CapturedMessage.cs @@ -0,0 +1,175 @@ +// Copyright(c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// A captured message. This is used as part of the . +/// +public abstract class CapturedMessage +{ + private static BinaryData? s_emptyData = null; + private static IReadOnlyDictionary>? s_emptyHeaders = null; + + /// + /// An empty header dictionary. + /// + public static IReadOnlyDictionary> EMPTY_HEADERS + => s_emptyHeaders ??= new Dictionary>(); + + /// + /// Empty binary data. + /// + public static BinaryData EMPTY_DATA => s_emptyData ??= new BinaryData(Array.Empty()); + + /// + /// Gets or sets the headers of the captured message. + /// + public IReadOnlyDictionary> Headers { get; init; } = EMPTY_HEADERS; + + /// + /// Gets or sets the content of the captured message. + /// + public BinaryData Content { get; init; } = EMPTY_DATA; + + /// + /// Copies the content from the provided to a new instance. + /// + /// The to copy the content from. + /// A new instance containing the copied content. + public static BinaryData CopyContent(HttpContent? content) + { + if (content == null) + { + return EMPTY_DATA; + } + + using Stream stream = content.ReadAsStreamAsync().Result; + return BinaryData.FromStream(stream); + } + + /// + /// Copies the headers from the provided and to a new dictionary. + /// + /// The to copy headers from. + /// The to copy headers from. + /// A new dictionary containing the copied headers. + public static IReadOnlyDictionary> CopyHeaders(HttpHeaders header, HttpContentHeaders? contentHeaders) + { + Dictionary> dict = new(StringComparer.OrdinalIgnoreCase); + foreach (var kvp in header) + { + dict[kvp.Key] = new List(kvp.Value); + } + + if (contentHeaders != null) + { + foreach (var kvp in contentHeaders) + { + var list = (List?)dict.GetValueOrDefault(kvp.Key); + if (list == null) + { + list = new List(); + dict[kvp.Key] = list; + } + + list.AddRange(kvp.Value); + } + } + + return dict; + } +} + +/// +/// A captured request. +/// +public class CapturedRequest : CapturedMessage +{ + /// + /// Creates a new instance. + /// + public CapturedRequest() + { } + + /// + /// Creates a new instance of using the provided . + /// + /// The to create the captured request from. + public CapturedRequest(HttpRequestMessage request) + { + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + Method = request.Method; + Uri = request.RequestUri; + Headers = CopyHeaders(request.Headers, request.Content?.Headers); + Content = CopyContent(request.Content); + } + + /// + /// Gets or sets the HTTP method of the captured request. + /// + public HttpMethod Method { get; init; } = HttpMethod.Get; + + /// + /// Gets or sets the URI of the captured request. + /// + public Uri? Uri { get; init; } +} + +/// +/// A captured response. +/// +public class CapturedResponse : CapturedMessage +{ + /// + /// Gets or sets the status code of the captured response. + /// + public HttpStatusCode Status { get; init; } = HttpStatusCode.OK; + + /// + /// Gets or sets the reason phrase of the captured response. + /// + public string? ReasonPhrase { get; init; } = "OK"; + + /// + /// Converts the captured response to an . + /// + /// The . + public HttpResponseMessage ToResponse() + { + const string contentPrefix = "Content-"; + + HttpResponseMessage response = new() + { + StatusCode = Status, + ReasonPhrase = ReasonPhrase + }; + + foreach (var kvp in Headers.Where(h => h.Key?.StartsWith(contentPrefix) == false)) + { + response.Headers.TryAddWithoutValidation(kvp.Key, kvp.Value); + } + + if (Content != null && Content.ToMemory().Length > 0) + { + response.Content = new StreamContent(Content.ToStream()); + foreach (var kvp in Headers.Where(h => h.Key?.StartsWith(contentPrefix) == true)) + { + response.Content.Headers.TryAddWithoutValidation(kvp.Key, kvp.Value); + } + } + + return response; + } +} + + diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncCollectionResult.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncCollectionResult.cs new file mode 100644 index 0000000000000..86e871aa69876 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncCollectionResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Represents a mock implementation of the class. +/// +/// The type of the values in the collection. +public class MockAsyncCollectionResult : AsyncCollectionResult +{ + private readonly Func> _enumerateAsyncFunc; + + /// + /// Initializes a new instance of the class + /// with the specified asynchronous enumeration function and optional pipeline response. + /// + /// The function that asynchronously enumerates the values in the collection. + /// The optional pipeline response. + public MockAsyncCollectionResult(Func> enumerateAsyncFunc, PipelineResponse? response = null) : + base(response ?? new MockPipelineResponse()) + { + _enumerateAsyncFunc = enumerateAsyncFunc ?? throw new ArgumentNullException(nameof(enumerateAsyncFunc)); + } + + /// + public override IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + => _enumerateAsyncFunc().GetAsyncEnumerator(cancellationToken); +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncPageCollection.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncPageCollection.cs new file mode 100644 index 0000000000000..4246812522826 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncPageCollection.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Represents a mock implementation of the class. +/// +/// The type of the values in the collection. +public class MockAsyncPageCollection : AsyncPageCollection +{ + private readonly Func> _enumerateAsyncFunc; + private readonly PipelineResponse _response; + private readonly int _itemsPerPage; + private PageResult? _currentPage; + + /// + /// Initializes a new instance. + /// + /// The function that enumerates the collection asynchronously. + /// The pipeline response. + public MockAsyncPageCollection(Func> enumerateAsyncFunc, PipelineResponse response, int itemsPerPage = 5) + { + if (itemsPerPage <= 0) + { + throw new ArgumentOutOfRangeException(nameof(itemsPerPage)); + } + + _enumerateAsyncFunc = enumerateAsyncFunc ?? throw new ArgumentNullException(nameof(enumerateAsyncFunc)); + _response = response; + _itemsPerPage = itemsPerPage; + } + + /// + protected override Task> GetCurrentPageAsyncCore() + => Task.FromResult(_currentPage ?? throw new InvalidOperationException("Please call MoveNextAsync first.")); + + /// + protected override async IAsyncEnumerator> GetAsyncEnumeratorCore(CancellationToken cancellationToken = default) + { + List items = new(_itemsPerPage); + int pageStart = 0; + int rolling = 0; + + await foreach (TValue value in _enumerateAsyncFunc()) + { + items.Add(value); + rolling++; + if (items.Count == _itemsPerPage) + { + _currentPage = PageResult.Create(items, ToContinuation(pageStart), ToContinuation(rolling), _response); + yield return _currentPage; + items.Clear(); + pageStart = rolling; + } + } + + if (items.Count > 0) + { + _currentPage = PageResult.Create(items, ToContinuation(pageStart), ToContinuation(rolling), _response); + yield return _currentPage; + } + } + + private static ContinuationToken ToContinuation(int offset) + => ContinuationToken.FromBytes(BinaryData.FromBytes(BitConverter.GetBytes(offset))); +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockCollectionResult.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockCollectionResult.cs new file mode 100644 index 0000000000000..e12e34b3428c8 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockCollectionResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks +{ + /// + /// Represents a mock implementation of the class. + /// + /// The type of the values in the collection. + public class MockCollectionResult : CollectionResult + { + private readonly Func> _enumerateFunc; + + /// + /// Initializes a new instance of the class with the specified enumeration + /// function and optional pipeline response. + /// + /// The function used to enumerate the collection. + /// The pipeline response associated with the collection. + public MockCollectionResult(Func> enumerateFunc, PipelineResponse? response = null) : + base(response ?? new MockPipelineResponse()) + { + _enumerateFunc = enumerateFunc ?? throw new ArgumentNullException(nameof(enumerateFunc)); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// An enumerator that can be used to iterate through the collection. + public override IEnumerator GetEnumerator() + => _enumerateFunc().GetEnumerator(); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockHeaders.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockHeaders.cs new file mode 100644 index 0000000000000..7cac493761826 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockHeaders.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Basic implementation of headers. +/// +public class MockHeaders +{ + private IDictionary> _headers = + new Dictionary>(StringComparer.OrdinalIgnoreCase); + + /// + /// Adds a header value. + /// + /// The name of the header. + /// The value to add. + public virtual void Add(string name, string value) + { + IList? existing; + if (!_headers.TryGetValue(name, out existing)) + { + existing = new List(); + _headers[name] = existing; + } + + existing.Add(value); + } + + /// + /// Removes all values of a header. + /// + /// The name of the header to remove. + /// True if we removed a value, false otherwise. + public virtual bool Remove(string name) => _headers.Remove(name); + + /// + /// Sets the value for a header. This will override all existing values. + /// + /// The name of the header. + /// The value to set. + public virtual void Set(string name, string value) => _headers[name] = new List() { value }; + + /// + /// Gets an enumerator for the header values. In the case of a header with more than one value, they will be joined into + /// a single comma separated string. + /// + /// The enumerator. + public virtual IEnumerator> GetEnumerator() + => _headers + .Select(kvp => new KeyValuePair(kvp.Key, string.Join(",", kvp.Value))) + .GetEnumerator(); + + /// + /// Gets the value for a header. In the case of a header with more than one value, they will be joined into a single comma + /// separated string. + /// + /// The name of the header. + /// The value of the headers + /// True if the header was found, false otherwise. + public virtual bool TryGetValue(string name, out string? value) + { + if (_headers.TryGetValue(name, out IList? existing)) + { + value = string.Join(",", existing); + return true; + } + + value = null; + return false; + } + + /// + /// Gets the values for a header. + /// + /// The name of the header. + /// All of the values for the header. + /// True if the header was found, false otherwise. + public virtual bool TryGetValues(string name, out IEnumerable? values) + { + if (_headers.TryGetValue(name, out IList? existing)) + { + values = existing; + return true; + } + + values = null; + return false; + } +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockHttpMessageHandler.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockHttpMessageHandler.cs new file mode 100644 index 0000000000000..74f4b998047fe --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockHttpMessageHandler.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Net; +using System.Net.Http; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// A mock message handler that doesn't use the network. This captures all received requests, and allows you to specify a handler +/// to hand craft response messages. This can be useful for unit testing. +/// +public class MockHttpMessageHandler : HttpMessageHandler, IDisposable +{ + /// + /// Handles a captured request. + /// + /// The captured request. + /// The corresponding response. + public delegate CapturedResponse RequestHandlerDelegate(CapturedRequest request); + + private RequestHandlerDelegate _handler; + private List _requests; + private List _responses; + private PipelineTransport? _transport; + + /// + /// Creates a new instance. + /// + /// (Optional) The handler to use to generate responses. Default returns an empty + /// response body with HTTP 204 + public MockHttpMessageHandler(RequestHandlerDelegate? requestHandler = null) + { + _handler = requestHandler ?? ReturnEmpty; + _requests = new List(); + _responses = new List(); + } + + /// + /// Event raised when a request is received. + /// + public event EventHandler? OnRequest; + + /// + /// Event raised when a response is generated. + /// + public event EventHandler? OnResponse; + + /// + /// Gets the transport to pass to your System.ClientModel based clients. + /// + public PipelineTransport Transport => _transport ??= new HttpClientPipelineTransport(new HttpClient(this)); + + /// + /// All received requests. + /// + public IReadOnlyList Requests => _requests; + + /// + /// All generated responses. + /// + public IReadOnlyList Responses => _responses; + + /// + /// Default handler that always returns an empty JSON payload as the response with the correct headers set + /// + /// The request + /// An empty successful JSON response + public static CapturedResponse ReturnEmptyJson(CapturedRequest request) + => new() + { + Status = HttpStatusCode.OK, + ReasonPhrase = "OK", + Content = BinaryData.FromString("{}"), + Headers = new Dictionary>() + { + ["Content-Type"] = ["application/json"], + ["Content-Length"] = ["2"] + } + }; + + /// + /// Default handler that returns an empty HTTP 204 payload + /// + /// The request + /// An HTTP 204 empty response + public static CapturedResponse ReturnEmpty(CapturedRequest request) + => new() { Status = HttpStatusCode.NoContent }; + + private HttpResponseMessage HandleRequest(HttpRequestMessage request, CancellationToken token) + { + try + { + CapturedRequest capturedRequest = new(request); + OnRequest?.Invoke(this, capturedRequest); + _requests.Add(capturedRequest); + + CapturedResponse capturedResponse = _handler(capturedRequest); + OnResponse?.Invoke(this, capturedResponse); + _responses.Add(capturedResponse); + + return capturedResponse.ToResponse(); + } + catch (Exception ex) + { + throw new ClientResultException("Failed to process request", null, ex); + } + } + + #region HttpMessagHandler implementation + +#if NET + override +#endif + protected HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) + => HandleRequest(request, cancellationToken); + + protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + => Task.FromResult(HandleRequest(request, cancellationToken)); + + #endregion +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockPageCollection.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockPageCollection.cs new file mode 100644 index 0000000000000..1f08987aeb65a --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockPageCollection.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Represents a mock implementation of the class. +/// +/// The type of the values in the collection. +public class MockPageCollection : PageCollection +{ + private readonly Func> _enumerateFunc; + private readonly PipelineResponse _response; + private readonly int _itemsPerPage; + private PageResult? _currentPage; + + /// + /// Creates a new instance. + /// + /// The function used to enumerate the collection. + /// The pipeline response. + /// (Optional) The number of items per page. + public MockPageCollection(Func> enumerateFunc, PipelineResponse response, int itemsPerPage = 5) + { + if (itemsPerPage <= 0) + { + throw new ArgumentOutOfRangeException(nameof(itemsPerPage)); + } + + _enumerateFunc = enumerateFunc ?? throw new ArgumentNullException(nameof(enumerateFunc)); + _response = response; + _itemsPerPage = itemsPerPage; + } + + /// + protected override PageResult GetCurrentPageCore() + => _currentPage ?? throw new InvalidOperationException("Please call MoveNextAsync first."); + + /// + protected override IEnumerator> GetEnumeratorCore() + { + List items = new(_itemsPerPage); + int pageStart = 0; + int rolling = 0; + + foreach (TValue item in _enumerateFunc()) + { + items.Add(item); + rolling++; + if (items.Count == _itemsPerPage) + { + _currentPage = PageResult.Create(items, ToContinuation(pageStart), ToContinuation(rolling), _response); + yield return _currentPage; + items.Clear(); + pageStart = rolling; + } + } + + if (items.Count > 0) + { + _currentPage = PageResult.Create(items, ToContinuation(pageStart), null, _response); + yield return _currentPage; + } + } + + private static ContinuationToken ToContinuation(int offset) + => ContinuationToken.FromBytes(BinaryData.FromBytes(BitConverter.GetBytes(offset))); +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockPipelineResponse.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockPipelineResponse.cs new file mode 100644 index 0000000000000..1ade396dfce6c --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockPipelineResponse.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// A mock implementation of a pipeline response +/// +public class MockPipelineResponse : PipelineResponse +{ + private Stream? _contentStream; + private BinaryData? _buffered; + + /// + /// Creates a new instance. + /// + /// (Optional) The HTTP status. + /// (Optional) The HTTP reason phrase. + /// (Optional) The HTTP response body content. + public MockPipelineResponse( + int? status = null, + string? reasonPhrase = null, + BinaryData? content = null) + { + Status = status ?? 200; + ReasonPhrase = reasonPhrase ?? "OK"; + _buffered = content; + ContentStream = content?.ToStream(); + HeadersCore = new MockResponseHeaders(); + } + + /// + public override int Status { get; } + + /// + public override string ReasonPhrase { get; } + + /// + public override Stream? ContentStream + { + get => _contentStream; + set + { + _contentStream = value; + _buffered = null; + } + } + + /// + public override BinaryData Content => _buffered ?? throw new InvalidOperationException("Response content is not yet buffered"); + + /// + protected override PipelineResponseHeaders HeadersCore { get; } + + /// + public override BinaryData BufferContent(CancellationToken cancellationToken = default) + => BufferContentSyncAsync(false, cancellationToken).GetAwaiter().GetResult(); + + /// + public override ValueTask BufferContentAsync(CancellationToken cancellationToken = default) + => BufferContentSyncAsync(true, cancellationToken); + + /// + public override void Dispose() + { + ContentStream?.Dispose(); + } + + private async ValueTask BufferContentSyncAsync(bool isAsync, CancellationToken token) + { + if (_buffered != null) + { + return _buffered; + } + + _buffered = ContentStream == null + ? BinaryData.FromBytes(Array.Empty()) + : isAsync + ? await BinaryData.FromStreamAsync(ContentStream, token).ConfigureAwait(false) + : BinaryData.FromStream(ContentStream); + + ContentStream?.Dispose(); + ContentStream = _buffered.ToStream(); + return _buffered; + } +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockRequestHeaders.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockRequestHeaders.cs new file mode 100644 index 0000000000000..e03c4cd181bd5 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockRequestHeaders.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Mock implementation of request headers. +/// +public class MockRequestHeaders : PipelineRequestHeaders +{ + private MockHeaders _headers = new(); + + /// + public override void Add(string name, string value) + => _headers.Add(name, value); + + /// + public override bool Remove(string name) + => _headers.Remove(name); + + /// + public override void Set(string name, string value) + => _headers.Set(name, value); + + /// + public override IEnumerator> GetEnumerator() + => _headers.GetEnumerator(); + + /// + public override bool TryGetValue(string name, out string? value) + => _headers.TryGetValue(name, out value); + + /// + public override bool TryGetValues(string name, out IEnumerable? values) + => _headers.TryGetValues(name, out values); +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockResponseHeaders.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockResponseHeaders.cs new file mode 100644 index 0000000000000..aead0b4b84b6c --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockResponseHeaders.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Mock implementation of response headers. +/// +public class MockResponseHeaders : PipelineResponseHeaders +{ + private MockHeaders _headers = new(); + + /// + public override IEnumerator> GetEnumerator() + => _headers.GetEnumerator(); + + /// + public override bool TryGetValue(string name, out string? value) + => _headers.TryGetValue(name, out value); + + /// + public override bool TryGetValues(string name, out IEnumerable? values) + => _headers.TryGetValues(name, out values); +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockRestService.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockRestService.cs new file mode 100644 index 0000000000000..58420f679331c --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockRestService.cs @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Concurrent; +using System.Net; +using System.Net.Sockets; +using System.Text.Json; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Represents a mock REST service for testing purposes. +/// +/// The type of data stored in the service. +public class MockRestService : IDisposable +{ + /// + /// Represents an entry in the mock REST service. + /// + /// The ID of the entry. + /// The data associated with the entry. + public record Entry(string id, TData data) + { +#if NETFRAMEWORK + public Entry() : this(string.Empty, default!) + { + // .Net framework System.Text.Json cannot deserialize records without a parameterless constructor + } +#endif + }; + + /// + /// Represents an error in the mock REST service. + /// + /// The error code. + /// The error message. + /// The stack trace of the error. + public record Error(int error, string message, string? stack = null); + + private static readonly JsonSerializerOptions s_options = new() + { + WriteIndented = true, +#pragma warning disable SYSLIB0020 + IgnoreNullValues = true +#pragma warning restore SYSLIB0020 + }; + + private ConcurrentDictionary _data; + private HttpListener _listener; + private CancellationTokenSource _cts; + private Task _workerTask; + + /// + /// Initializes a new instance of the class. + /// + /// (Optional) The base path of the service. + /// (Optional) The port number to listen on. If set to 0, a port will be automatically selected. + public MockRestService(string? basePath = null, ushort port = 0) + { + _data = new(); + basePath = basePath?.EnsureEndsWith("/"); + + int maxAttempts = port == 0 ? 15 : 1; + Exception? ex = null; + for (int i = 0; _listener == null && i < maxAttempts; i++) + { + _listener = TryStartListener(basePath ?? string.Empty, port, out ex)!; + } + + if (_listener == null || ex != null) + { + throw new ApplicationException("Failed to start the mock rest service", ex); + } + + HttpEndpoint = TerminatePathWithSlash(new Uri(_listener.Prefixes.First())); + _cts = new(); + _workerTask = Task.Run(() => WorkerAsync(_cts.Token), _cts.Token); + } + + /// + /// Gets the HTTP endpoint of the mock REST service. + /// + public Uri HttpEndpoint { get; } + + /// + /// Gets all entries in the mock REST service. + /// + /// An enumerable collection of entries. + public virtual IEnumerable GetAll() + => _data.Select(kvp => new Entry(kvp.Key, kvp.Value)); + + /// + /// Tries to get an entry from the mock REST service. + /// + /// The ID of the entry to get. + /// When this method returns, contains the entry associated with the specified ID, if found; otherwise, null. + /// true if the entry was found; otherwise, false. + public virtual bool TryGet(string id, out Entry? entry) + { + if (_data.TryGetValue(id, out TData? value)) + { + entry = new(id, value); + return true; + } + + entry = null; + return false; + } + + /// + /// Tries to add an entry to the mock REST service. + /// + /// The ID of the entry to add. + /// The data associated with the entry. + /// When this method returns, contains the added entry, if successful; otherwise, null. + /// true if the entry was added successfully; otherwise, false. + public virtual bool TryAdd(string id, TData data, out Entry? entry) + { + entry = null; + + if (_data.TryAdd(id, data)) + { + entry = new(id, data); + return true; + } + + return false; + } + + /// + /// Tries to delete an entry from the mock REST service. + /// + /// The ID of the entry to delete. + /// true if the entry was deleted successfully; otherwise, false. + public virtual bool TryDelete(string id) + => _data.TryRemove(id, out _); + + /// + /// Tries to update an entry in the mock REST service. + /// + /// The ID of the entry to update. + /// The updated data for the entry. + /// When this method returns, contains the updated entry, if successful; otherwise, null. + /// true if the entry was updated successfully; otherwise, false. + public virtual bool TryUpdate(string id, TData data, out Entry? entry) + { + _data[id] = data; + entry = new(id, data); + return true; + } + + /// + /// Resets the mock REST service removing all entries. + /// + public virtual void Reset() + => _data.Clear(); + + /// + /// Disposes of the resources used by the mock REST service. + /// + public void Dispose() + { + _cts.Cancel(); + _listener.Stop(); + try { _workerTask.Wait(500); } catch { } + _listener.Close(); + _cts.Dispose(); + } + + /// + /// Worker method that handles incoming HTTP requests. + /// + /// The cancellation token. + protected virtual async Task WorkerAsync(CancellationToken token) + { + while (!token.IsCancellationRequested) + { + HttpListenerContext context = await _listener.GetContextAsync().ConfigureAwait(false); + HttpListenerRequest request = context.Request; + HttpListenerResponse response = context.Response; + + if (request == null || request.Url == null) + { + context.Response?.Abort(); + continue; + } + + try + { + response.ContentLength64 = 0; + + string? id = GetId(HttpEndpoint, request.Url); + switch (request.HttpMethod.ToUpperInvariant()) + { + case "GET": + if (id == null) + { + // Send down all data + IEnumerable allData = GetAll(); + WriteJsonResponse(response, 200, allData); + } + else if (TryGet(id, out Entry? entry) && entry != null) + { + WriteJsonResponse(response, 200, entry); + } + else + { + response.StatusCode = (int)HttpStatusCode.NotFound; + } + break; + + case "POST": + if (id == null) + { + response.StatusCode = (int)HttpStatusCode.BadRequest; + } + else + { + TData? data = ReadBody(request); + if (data == null) + { + response.StatusCode = (int)HttpStatusCode.GatewayTimeout; + } + else if (TryAdd(id, data, out Entry? entry)) + { + if (entry == null) + { + response.StatusCode = (int)HttpStatusCode.NoContent; + } + else + { + WriteJsonResponse(response, 200, entry); + } + } + else + { + response.StatusCode = (int)HttpStatusCode.Conflict; + } + } + break; + + case "PUT": + if (id == null) + { + response.StatusCode = (int)HttpStatusCode.BadRequest; + } + else + { + TData? data = ReadBody(request); + if (data == null) + { + response.StatusCode = (int)HttpStatusCode.GatewayTimeout; + } + else if (TryUpdate(id, data, out Entry? entry)) + { + if (entry == null) + { + response.StatusCode = (int)HttpStatusCode.NoContent; + } + else + { + WriteJsonResponse(response, 200, entry); + } + } + else + { + response.StatusCode = (int)HttpStatusCode.NotFound; + response.ContentLength64 = 0; + } + } + break; + + case "DELETE": + response.ContentLength64 = 0; + if (id == null) + { + response.StatusCode = (int)HttpStatusCode.BadRequest; + } + else if (TryDelete(id)) + { + response.StatusCode = (int)HttpStatusCode.NoContent; + } + else + { + response.StatusCode = (int)HttpStatusCode.NotFound; + } + break; + + default: + response.StatusCode = (int)HttpStatusCode.MethodNotAllowed; + break; + } + + response.Close(); + } + catch (Exception ex) + { + response.StatusCode = (int)HttpStatusCode.InternalServerError; + try + { + if (response.OutputStream.Length > 0 || response.OutputStream.CanSeek) + { + response.OutputStream.SetLength(0); + } + + if (response.OutputStream.Length == 0) + { + WriteJsonResponse( + response, + (int)HttpStatusCode.InternalServerError, + new Error( + 500, + ex.Message +#if DEBUG + , ex.StackTrace +#endif + )); + } + } + catch { /* we tried */ } + } + } + } + + private static ushort GetFreePort() + { + TcpListener? listener = null; + try + { + listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + return (ushort)((IPEndPoint)listener.LocalEndpoint).Port; + } + finally + { + listener?.Stop(); + } + } + + private static HttpListener? TryStartListener(string basePath, ushort port, out Exception? ex) + { + if (port == 0) + { + port = GetFreePort(); + } + + HttpListener? listener = null; + try + { + listener = new(); + listener.Prefixes.Add($"http://localhost:{port}/{basePath}"); + listener.Start(); + ex = null; + return listener; + } + catch (Exception e) + { + listener?.Close(); + ex = e; + return null; + } + } + + private static Uri TerminatePathWithSlash(Uri uri) + { + if (uri.IsAbsoluteUri) + { + if (!uri.AbsolutePath.EndsWith("/")) + { + UriBuilder builder = new(uri); + builder.Path += '/'; + return builder.Uri; + } + } + else if (!uri.OriginalString.EndsWith("/")) + { + return new Uri(uri.OriginalString + '/', UriKind.RelativeOrAbsolute); + } + + return uri; + } + + private static string? GetId(Uri baseUri, Uri requestUri) + { + Uri normalizedRequestUri = TerminatePathWithSlash(requestUri); + Uri relative = baseUri.MakeRelativeUri(normalizedRequestUri); + return relative.OriginalString.Split(["/"], StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(); + } + + private static TData? ReadBody(HttpListenerRequest request) + { + if (request.ContentLength64 == 0) + { + return default; + } + + return JsonHelpers.Deserialize(request.InputStream, s_options); + } + + private static void WriteJsonResponse(HttpListenerResponse response, int status, T data) + { + response.StatusCode = status; + + using MemoryStream buffer = new(); + JsonHelpers.Serialize(buffer, data, s_options); + buffer.Seek(0, SeekOrigin.Begin); + + response.ContentType = "application/json"; + response.ContentLength64 = buffer.Length; + buffer.CopyTo(response.OutputStream); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockRestServiceClient.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockRestServiceClient.cs new file mode 100644 index 0000000000000..a3fb851d3968c --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockRestServiceClient.cs @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Globalization; +using System.Net.Http; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// A client for . +/// +/// The type of data used by the client. +public class MockRestServiceClient : IDisposable +{ + private ClientPipeline _pipeline; + private Uri _baseUri; + + /// + /// Only used to generate a dynamic proxy for testing. Do not use this yourself. + /// + internal MockRestServiceClient() + { + _pipeline = null!; + _baseUri = null!; + } + + /// + /// Initializes a new instance of the class with the specified service URI and options. + /// + /// The service URI. + /// The client pipeline options. + public MockRestServiceClient(Uri serviceUri, ClientPipelineOptions? options = null) + { + _pipeline = ClientPipeline.Create(options); + _baseUri = serviceUri ?? throw new ArgumentNullException(nameof(serviceUri)); + } + + /// + /// Adds data asynchronously to the service with the specified ID. + /// + /// The ID of the data. + /// The data to add. + /// The cancellation token. + /// A task representing the asynchronous operation. + public virtual Task AddAsync(string id, TData data, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(id)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(id)); + + ValidateData(data); + return SendSyncOrAsync(true, HttpMethod.Post, id, data, token).AsTask(); + } + + /// + /// Adds data synchronously to the service with the specified ID. + /// + /// The ID of the data. + /// The data to add. + /// The cancellation token. + /// The result of the operation. + public virtual ClientResult Add(string id, TData data, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(id)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(id)); + + ValidateData(data); + return SendSyncOrAsync(false, HttpMethod.Post, id, data, token).GetAwaiter().GetResult(); + } + + /// + /// Gets data asynchronously from the service with the specified ID. Will return null if the data does not exist. + /// + /// The ID of the data. + /// The cancellation token. + /// A task representing the asynchronous operation. + public virtual async Task> GetAsync(string id, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(id)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(id)); + + try + { + ClientResult result = await SendSyncOrAsync(true, HttpMethod.Get, id, default, token) + .ConfigureAwait(false); + + var response = result.GetRawResponse(); + return ClientResult.FromOptionalValue( + response.Content.ToObjectFromJson.Entry>().data, + response); + } + catch (ClientResultException ex) + { + if (ex.GetRawResponse()?.Status == 404) + { + return ClientResult.FromOptionalValue(default, ex.GetRawResponse()!); + } + + throw; + } + } + + /// + /// Gets data synchronously from the service with the specified ID. Will return null if the data does not exist. + /// + /// The ID of the data. + /// The cancellation token. + /// The result of the operation. + public virtual ClientResult Get(string id, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(id)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(id)); + + try + { + ClientResult result = SendSyncOrAsync(false, HttpMethod.Get, id, default, token).GetAwaiter().GetResult(); + var response = result.GetRawResponse(); + return ClientResult.FromOptionalValue( + response.Content.ToObjectFromJson.Entry>().data, + response); + } + catch (ClientResultException ex) + { + if (ex.GetRawResponse()?.Status == 404) + { + return ClientResult.FromOptionalValue(default, ex.GetRawResponse()!); + } + + throw; + } + } + + /// + /// Removes data asynchronously from the service with the specified ID. + /// + /// The ID of the data. + /// The cancellation token. + /// A task representing the asynchronous operation. + public virtual async Task> RemoveAsync(string id, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(id)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(id)); + + try + { + ClientResult result = await SendSyncOrAsync(true, HttpMethod.Delete, id, default, token); + return ClientResult.FromValue(true, result.GetRawResponse()); + } + catch (ClientResultException ex) + { + if (ex.GetRawResponse()?.Status == 404) + { + return ClientResult.FromValue(false, ex.GetRawResponse()!); + } + + throw; + } + } + + /// + /// Removes data synchronously from the service with the specified ID. + /// + /// The ID of the data. + /// The cancellation token. + /// The result of the operation. + public virtual ClientResult Remove(string id, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(id)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(id)); + + try + { + ClientResult result = SendSyncOrAsync(false, HttpMethod.Delete, id, default, token).GetAwaiter().GetResult(); + return ClientResult.FromValue(true, result.GetRawResponse()); + } + catch (ClientResultException ex) + { + if (ex.GetRawResponse()?.Status == 404) + { + return ClientResult.FromValue(false, ex.GetRawResponse()!); + } + + throw; + } + } + + /// + /// Disposes of the resources used by the client. + /// + public virtual void Dispose() + { + // no obvious way to dispose of the pipeline, nor the inner transport + } + + /// + /// Validates the data before sending it to the service. + /// + /// The data to validate. + protected virtual void ValidateData(TData? data) + { + if (data == null) + { + throw new ArgumentNullException(nameof(data)); + } + } + + /// + /// Sends the request to the service synchronously or asynchronously. This will serialize the passed in data to JSON using the default + /// serializer. + /// + /// Indicates whether the request should be sent asynchronously. + /// The HTTP method. + /// The ID of the data. + /// The data to send. + /// The cancellation token. + /// The result of the operation. + protected async ValueTask SendSyncOrAsync(bool isAsync, HttpMethod method, string? id, TData? data, CancellationToken token) + { + UriBuilder builder = new(_baseUri); + if (id != null) + { + builder.Path += id; + } + + PipelineMessage message = _pipeline.CreateMessage(); + message.Request.Method = method.Method; + message.Request.Uri = builder.Uri; + message.Apply(new RequestOptions() + { + CancellationToken = token, + BufferResponse = true + }); + + if (data == null) + { + message.Request.Headers.Set("Content-Length", "0"); + } + else + { + using MemoryStream stream = new(); + JsonHelpers.Serialize(stream, data); + var binaryData = BinaryData.FromBytes(new ReadOnlyMemory(stream.GetBuffer(), 0, (int)stream.Length)); + + message.Request.Headers.Set("Content-Length", stream.Length.ToString(CultureInfo.InvariantCulture)); + message.Request.Headers.Set("Content-Type", "application/json"); + message.Request.Content = BinaryContent.Create(binaryData); + } + + if (isAsync) + { + await _pipeline.SendAsync(message).ConfigureAwait(false); + } + else + { + _pipeline.Send(message); + } + + if (message.Response?.IsError == true) + { + if (message.Response.Content?.ToMemory().Length > 0) + { + var error = message.Response.Content.ToObjectFromJson.Error>(); + throw new ClientResultException($"Error {error.error}: {error.message}", message.Response); + } + + throw new ClientResultException(message.Response); + } + + return ClientResult.FromResponse(message.Response!); + } +} diff --git a/sdk/openai/tools/TestFramework/src/OpenAI.TestFramework.csproj b/sdk/openai/tools/TestFramework/src/OpenAI.TestFramework.csproj new file mode 100644 index 0000000000000..dc92fd798ff7f --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/OpenAI.TestFramework.csproj @@ -0,0 +1,39 @@ + + + + $(RequiredTargetFrameworks) + enable + enable + latest + + + + + Utils\Polyfill\%(RecursiveDir)\%(Filename).cs + + + + + + + + + + + + + + 0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7 + + + + + + + <_Parameter1>TestProxyPath + <_Parameter2>$(NuGetPackageRoot)\azure.sdk.tools.testproxy\$(TestProxyVersion)\tools\net6.0\any\Azure.Sdk.Tools.TestProxy.dll + + + + diff --git a/sdk/openai/tools/TestFramework/src/RecordedClientTestBase.cs b/sdk/openai/tools/TestFramework/src/RecordedClientTestBase.cs new file mode 100644 index 0000000000000..27d6ca2e7b2eb --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/RecordedClientTestBase.cs @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.Diagnostics; +using System.Net; +using System.Text; +using NUnit.Framework; +using NUnit.Framework.Internal; +using OpenAI.TestFramework.Recording; +using OpenAI.TestFramework.Recording.Proxy; +using OpenAI.TestFramework.Recording.Proxy.Service; +using OpenAI.TestFramework.Recording.RecordingProxy; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework; + +/// +/// Base class for client test cases that supports recording and playback of HTTP/HTTPS REST requests. This recording +/// support is provided by use of the Test Proxy . +/// This provides the basic framework to start the Test Proxy, create a recording for a test or playback a recording +/// for a test. It also provides support for automatic testing of async and sync versions of methods (see +/// for more details). +/// +[NonParallelizable] +public abstract class RecordedClientTestBase : ClientTestBase +{ + /// + /// Invalid characters that will be removed from test names when creating recordings. + /// + /// + /// Using Windows version as it is the most restrictive of all platforms: + /// + /// + protected static readonly ISet s_invalidChars = new HashSet() + { + '\"', '<', '>', '|', '\0', + (char)1, (char)2, (char)3, (char)4, (char)5, (char)6, (char)7, (char)8, (char)9, (char)10, + (char)11, (char)12, (char)13, (char)14, (char)15, (char)16, (char)17, (char)18, (char)19, (char)20, + (char)21, (char)22, (char)23, (char)24, (char)25, (char)26, (char)27, (char)28, (char)29, (char)30, + (char)31, ':', '*', '?', '\\', '/' + }; + + private DateTimeOffset _testStartTime; + private TestRecordingOptions _options; + + /// + /// Creates a new instance. + /// + /// True to run the async version of a test, false to run the sync version of a test. + public RecordedClientTestBase(bool isAsync) : this(isAsync, null) + { } + + /// + /// Creates a new instance. + /// + /// True to run the async version of a test, false to run the sync version of a test. + /// (Optional) The recorded test mode to use. If unset, the default recorded test mode will be used. + public RecordedClientTestBase(bool isAsync, RecordedTestMode? mode = null) : base(isAsync) + { + _options = new TestRecordingOptions(); + Mode = mode ?? GetDefaultRecordedTestMode(); + } + + /// + public override DateTimeOffset TestStartTime => _testStartTime; + + /// + /// Gets the test proxy instance to use for the current test case. + /// + public ProxyService? Proxy { get; protected internal set; } + + /// + /// Gets or sets the current recording mode for the test. + /// + public RecordedTestMode Mode { get; set; } + + /// + /// Gets or sets the recording options to use for the current test. This will be pre-populated with a sensible configuration. + /// + public TestRecordingOptions RecordingOptions + { + get => _options; + set => _options = value ?? throw new ArgumentNullException(nameof(value)); + } + + /// + /// Gets the recording for the current test. + /// + public TestRecording? Recording { get; protected internal set; } + + /// + /// Gets the maximum amount of time to wait for starting/tearing down the test proxy, as well as the maximum amount of time + /// to wait for configuring a recording session, and then saving it or closing it. + /// + public virtual TimeSpan TestProxyWaitTime => Debugger.IsAttached + ? Default.DebuggerAttachedTestTimeout + : Default.TestProxyWaitTime; + + /// + /// Gets the test timeout. + /// + public override TimeSpan TestTimeout + { + get + { + if (Debugger.IsAttached) + { + return Default.DebuggerAttachedTestTimeout; + } + + switch (Mode) + { + default: + case RecordedTestMode.Record: + case RecordedTestMode.Live: + return TimeSpan.FromSeconds(60); + + case RecordedTestMode.Playback: + return Default.TestTimeout; + } + } + } + + /// + /// Determines whether or not to use Fiddler. If this is true, then the recording transport will be updated to use Fiddler + /// as the intermediary when talking to the test proxy, as well as accept the Fiddler root certificate. + /// + public virtual bool UseFiddler + { + get + { + // Check to see if Fiddler is already running and capturing traffic by checking to see if a proxy is configured for + // 127.0.0.1:8888 with no credentials + try + { + Uri dummyUri = new("https://not.a.real.uri.com"); + + IWebProxy webProxy = WebRequest.GetSystemWebProxy(); + Uri? proxyUri = webProxy?.GetProxy(dummyUri); + if (proxyUri == null || proxyUri == dummyUri) + { + return false; + } + + // assume default of 127.0.0.1:8888 with no credentials + var cred = webProxy?.Credentials?.GetCredential(dummyUri, string.Empty); + return proxyUri.Host == "127.0.0.1" + && proxyUri.Port == 8888 + && string.IsNullOrWhiteSpace(cred?.UserName) + && string.IsNullOrWhiteSpace(cred?.Password); + } + catch + { + return false; + } + } + } + + /// + /// Checks if the recording has a recorded value for . If there is none, the + /// will be added and return. Otherwise the existing value will be returned. + /// + /// The name of the value. + /// The value to add. + /// The existing value, or the newly added value. + /// If you called this function outside of a test run. + public string? GetOrAddRecordedValue(string name, string valueToAdd) + => GetOrAddRecordedValue(name, () => valueToAdd); + + /// + /// Checks if the recording has a recorded value for . If there is none, a value will be created, added + /// and returned. Otherwise the existing value will be returned. + /// + /// The name of the value. + /// The factory used to create the value. + /// The existing value, or the newly added value. + /// If you called this function outside of a test run. + public virtual string GetOrAddRecordedValue(string name, Func valueFactory) + { + if (Recording == null) + { + throw new InvalidOperationException("Recorded value should not be retrieved outside the test method invocation"); + } + + return Recording.GetOrAddVariable(name, valueFactory); + } + + /// + /// Starts the test proxy for the current test. This will be called once at the start of the test fixture. + /// + /// Asynchronous task. + [OneTimeSetUp] + public virtual async Task StartTestProxyAsync() + { + using CancellationTokenSource cts = new(TestProxyWaitTime); + + ProxyServiceOptions options = CreateProxyServiceOptions(); + Proxy = await ProxyService.CreateNewAsync(options, cts.Token).ConfigureAwait(false); + } + + [OneTimeTearDown] + public virtual Task StopTestProxyAsync() + { + Proxy?.Dispose(); + Proxy = null; + + //TODO FIXME: Do we need to do any cleanup here? + return Task.CompletedTask; + } + + /// + /// Starts the test proxy (if it has not already been started), and then configures the recording session for the current + /// test. This should also set the property to the new recording session. + /// + /// Asynchronous task. + [SetUp] + public virtual async Task StartTestRecordingAsync() + { + // Check if the current NUnit test method has a specific attribute applied to it + if (!IsCurrentTestRecorded()) + { + return; + } + + if (Proxy == null) + { + throw new InvalidOperationException("The proxy service was not set and/or started"); + } + + _testStartTime = DateTimeOffset.UtcNow; + + // TODO FIXME: Add logic to ignore certain tests here by throwing IgnoreException()? + + using CancellationTokenSource cts = new(TestProxyWaitTime); + Recording = await StartAndConfigureRecordingSessionAsync(Proxy, cts.Token).ConfigureAwait(false); + + // don't include test proxy overhead as part of the test time + _testStartTime = DateTimeOffset.UtcNow; + } + + /// + /// Stops a recording session for the current test. If the test passed and we are in recording mode, the recording will be saved, + /// otherwise it will be discarded. + /// + /// Asynchronous task. + [TearDown] + public virtual async Task StopTestRecordingAsync() + { + if (!IsCurrentTestRecorded()) + { + return; + } + + bool testsPassed = TestContext.CurrentContext.Result.Outcome.Status == NUnit.Framework.Interfaces.TestStatus.Passed; + using CancellationTokenSource cts = new(TestProxyWaitTime); + + if (Recording != null) + { + await Recording.FinishAsync(testsPassed, cts.Token).ConfigureAwait(false); + } + } + + /// + /// Configures the client options for a System.ClientModel based service client. This will be used to configure the transport + /// such that all requests are routed to the test proxy during recording (for capture), and playback (for replaying captured + /// requests). + /// + /// The type of the client options. + /// The options to configure. + /// The configured client options. + /// The current recording mode is not supported. + /// There was no test recording configured for this test. + public virtual TClientOptions ConfigureClientOptions(TClientOptions options) + where TClientOptions : ClientPipelineOptions + { + if (!IsCurrentTestRecorded()) + { + return options; + } + + // If we are in playback, or record mode we should set the transport to the test proxy transport, except + // in the case where we've explicitly specified the transport ourselves in case we are doing some custom + // work. + if (options.Transport != null) + { + return options; + } + + switch (Mode) + { + case RecordedTestMode.Live: + // no need to to anything special + return options; + + case RecordedTestMode.Record: + // continue + break; + + case RecordedTestMode.Playback: + // force the use of a fixed retry with a short timeout + options.RetryPolicy = new TestClientRetryPolicy(delay: TimeSpan.FromMilliseconds(100)); + break; + + default: + throw new NotSupportedException("The following mode is not supported: " + Mode); + } + + if (Recording == null) + { + throw new InvalidOperationException("Please call this from within a test method invocation"); + } + + ProxyTransportOptions transportOptions = Recording.GetProxyTransportOptions(); + transportOptions.UseFiddler = UseFiddler; + if (_options.RequestOverride != null) + { + transportOptions.ShouldRecordRequest = _options.RequestOverride; + } + + options.Transport = new ProxyTransport(transportOptions); + return options; + } + + /// + /// Gets the default recorded test mode to use. + /// + /// The test mode to use. + protected virtual RecordedTestMode GetDefaultRecordedTestMode() => RecordedTestMode.Playback; + + /// + /// Gets the name of recording JSON file that contains the recording. This will be based on a sanitized version + /// of test name, and "Async" will be automatically appended when running the asynchronous versions of tests. + /// + /// The name of the test to use. + protected virtual string GetRecordedTestFileName() + { + const string c_asyncSuffix = "Async"; + TestContext.TestAdapter testAdapter = TestContext.CurrentContext.Test; + + StringBuilder builder = new(testAdapter.Name.Length + c_asyncSuffix.Length); + foreach (char c in testAdapter.Name) + { + builder.Append(s_invalidChars.Contains(c) ? '%' : c); + } + + if (IsAsync) + { + builder.Append(c_asyncSuffix); + } + + builder.Append(".json"); + + return builder.ToString(); + } + + /// + /// Configures a recording/playback session for the current test on the test proxy. This is called at the start of every test. + /// It is responsible for configuring all the necessary sanitizers, matchers, and transforms for the test proxy. + /// + /// The test proxy service to configure the recording session for. + /// The cancellation token to use. + /// The configured test recording session. + /// The test proxy service instance did not have a valid client configured. + /// The recording mode is not supported. + protected virtual async Task StartAndConfigureRecordingSessionAsync(ProxyService proxy, CancellationToken token) + { + var client = proxy.Client ?? throw new ArgumentNullException("Test proxy client was null"); + IDictionary? variables = null; + + ProxyClientResult result; + switch (Mode) + { + case RecordedTestMode.Live: + // nothing to see here + return new TestRecording(string.Empty, RecordedTestMode.Live, proxy); + + case RecordedTestMode.Playback: + var playbackResult = await client.StartPlaybackAsync(CreateRecordingSessionStartInfo(), token).ConfigureAwait(false); + variables = playbackResult.Value; + result = playbackResult; + break; + + case RecordedTestMode.Record: + result = await client.StartRecordingAsync(CreateRecordingSessionStartInfo(), token).ConfigureAwait(false); + break; + + default: + throw new NotSupportedException("Don't know how to handle recording mode: " + Mode); + } + + string? recordingId = result.RecordingId; + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new InvalidOperationException("Recording test proxy did not return a recording ID"); + } + + TestRecording recording = new TestRecording(recordingId!, Mode, proxy, variables); + await recording.ApplyOptions(_options, token).ConfigureAwait(false); + return recording; + } + + /// + /// Determines whether or not the current test should be recorded (or played back from a file). + /// + /// True to enable the use of the recording test proxy, false otherwise. + protected virtual bool IsCurrentTestRecorded() + { + return TestExecutionContext.CurrentContext.CurrentTest.GetCustomAttributes(true).Any(); + } + + /// + /// Creates the options used when starting a new instance of the test proxy service. + /// + /// The options to use. + protected abstract ProxyServiceOptions CreateProxyServiceOptions(); + + /// + /// Creates the information used to configured a recording/playback session for the current test on the test proxy. + /// + /// The information to use. + protected abstract RecordingStartInformation CreateRecordingSessionStartInfo(); +} diff --git a/sdk/openai/tools/TestFramework/src/RecordedTestAttribute.cs b/sdk/openai/tools/TestFramework/src/RecordedTestAttribute.cs new file mode 100644 index 0000000000000..81d94268cac90 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/RecordedTestAttribute.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; + +namespace OpenAI.TestFramework; + +/// +/// An attribute used to indicate that a test should be recorded (or played back from a file). When you inherit from +/// in your test class, and add this attribute to your test function, and then +/// make sure to call +/// on the client options you use to configure a client, this should automatically enable the recording/playback +/// functionality. +/// +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] +public class RecordedTestAttribute : TestAttribute +{ +} diff --git a/sdk/openai/tools/TestFramework/src/RecordedTestMode.cs b/sdk/openai/tools/TestFramework/src/RecordedTestMode.cs new file mode 100644 index 0000000000000..bc0371ccf5f97 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/RecordedTestMode.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework; + +/// +/// The recording mode. +/// +public enum RecordedTestMode +{ + /// + /// Talk to live services. No recording or playback is used. + /// + Live, + + /// + /// Record the test and overwrite any existing recordings. + /// + Record, + + /// + /// Playback the test from a recording. + /// + Playback, +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Condition.cs b/sdk/openai/tools/TestFramework/src/Recording/Condition.cs new file mode 100644 index 0000000000000..6b0bdad00b0e7 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Condition.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording; + +/// +/// A condition used to evaluate whether or not a sanitizer should be applied. +/// +public class Condition +{ + /// Gets or sets the uri regex. + public string? UriRegex { get; set; } + + /// Header condition to apply. + public HeaderCondition? ResponseHeader { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/HeaderCondition.cs b/sdk/openai/tools/TestFramework/src/Recording/HeaderCondition.cs new file mode 100644 index 0000000000000..12d2ba55cef63 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/HeaderCondition.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording; + +/// +/// Header condition to apply. +/// +public class HeaderCondition +{ + /// Gets or sets the key. + public string? Key { get; set; } + /// Gets or sets the value regex. + public string? ValueRegex { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Matchers/BaseMatcher.cs b/sdk/openai/tools/TestFramework/src/Recording/Matchers/BaseMatcher.cs new file mode 100644 index 0000000000000..c4578d763bf78 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Matchers/BaseMatcher.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using System.Text.Json.Serialization; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.Matchers; + +/// +/// The base class for matchers that are applied during a playback session to match an incoming request +/// to a recorded one. +/// +public abstract class BaseMatcher : IUtf8JsonSerializable +{ + /// + /// Creates a new instance. + /// + /// The type of this sanitizer (e.g. GeneralRegexSanitizer). + /// If the type was null. + protected BaseMatcher(string type) + { + Type = type ?? throw new ArgumentNullException(nameof(type)); + } + + /// + /// Gets the type of the matcher (e.g. BodilessMatcher). + /// + [JsonIgnore] + public string Type { get; } + + /// + public virtual void Write(Utf8JsonWriter writer, JsonSerializerOptions? options = null) + { + // By default use reflection based serialization + JsonSerializer.Serialize(writer, this, GetType(), Default.InnerRecordingJsonOptions); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Matchers/CustomMatcher.cs b/sdk/openai/tools/TestFramework/src/Recording/Matchers/CustomMatcher.cs new file mode 100644 index 0000000000000..80e0f1b6d41b2 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Matchers/CustomMatcher.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Matchers; + +/// +/// This matcher exposes the default matcher in a customizable way. Currently this merely includes enabling/disabling body match and +/// adding additional excluded headers. All optional settings are safely defaulted. This means that providing zero additional +/// configuration will produce a sanitizer that is functionally identical to the default. +/// +public class CustomMatcher() : BaseMatcher("CustomDefaultMatcher") +{ + /// + /// A comma separated list of additional headers that should be excluded during matching. "Excluded" headers are entirely ignored. + /// Unlike "ignored" headers, the presence (or lack of presence) of a header will not cause mismatch. + /// + public string? ExcludedHeaders { get; set; } + + /// + /// Should the body value be compared during lookup operations? + /// + public bool? CompareBodies { get; set; } + + /// + /// A comma separated list of additional headers that should be ignored during matching. Any headers that are "ignored" will not + /// do value comparison when matching. This means that if the recording has a header that isn't in the request, a test mismatch + /// exception will be thrown noting the lack of header in the request. This also applies if the header is present in the request + /// but not recording. + /// + public string? IgnoredHeaders { get; set; } + + /// + /// A comma separated list of query parameters that should be ignored during matching. + /// + public string? IgnoredQueryParameters { get; set; } + + /// + /// By default, the test-proxy does not sort query params before matching. Setting true will sort query params alphabetically + /// before comparing URI. + /// + public bool? IgnoreQueryOrdering { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Matchers/ExistingMatcher.cs b/sdk/openai/tools/TestFramework/src/Recording/Matchers/ExistingMatcher.cs new file mode 100644 index 0000000000000..8d2cb4eab40f1 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Matchers/ExistingMatcher.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; + +namespace OpenAI.TestFramework.Recording.Matchers; + +/// +/// Used for specifying the use of pre-existing matchers defined in the test proxy. +/// +/// The name of the existing matcher. +public class ExistingMatcher(string existingMatcherName) : BaseMatcher(existingMatcherName) +{ + private static ExistingMatcher? _bodiless = null; + private static ExistingMatcher? _headerless = null; + + /// + /// This matcher adjusts the "match" operation to EXCLUDE the body when matching a request to a recording's entries. + /// + public static ExistingMatcher Bodiless => _bodiless ??= new ExistingMatcher("BodilessMatcher"); + + /// + /// NOT RECOMMENDED. This matcher adjusts the "match" operation to ignore header differences when matching a request. + /// Be aware that wholly ignoring headers during matching might incur unexpected issues down the line. + /// + public static ExistingMatcher Headerless => _headerless ??= new ExistingMatcher("HeaderlessMatcher"); + + /// + public override void Write(Utf8JsonWriter writer, JsonSerializerOptions? options = null) + { + // Pre-existing matchers use an empty JSON object. + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClient.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClient.cs new file mode 100644 index 0000000000000..55660d990b2b4 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClient.cs @@ -0,0 +1,679 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Net.Http; +using System.Text.Json; +using OpenAI.TestFramework.Recording.Matchers; +using OpenAI.TestFramework.Recording.Proxy; +using OpenAI.TestFramework.Recording.Proxy.Service; +using OpenAI.TestFramework.Recording.Sanitizers; +using OpenAI.TestFramework.Recording.Transforms; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.RecordingProxy; + +/// +/// A client for configuring the recording text proxy. Please see here for more information: +/// https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md +/// +public class ProxyClient +{ + protected internal const string X_RECORDING_ID_HEADER = "x-recording-id"; + + private ProxyClientOptions _options; + private ClientPipeline _pipeline; + + /// + /// For testing only. + /// + internal ProxyClient() + { + _options = new(new Uri("http://localhost:0")); + _pipeline = ClientPipeline.Create(); + } + + /// + /// Creates a new instance. + /// + /// The options to use. + public ProxyClient(ProxyClientOptions options) + { + _options = options ?? throw new ArgumentNullException(nameof(options)); + _pipeline = ClientPipeline.Create(options); + } + + /// + /// Starts playback session of recordings. + /// + /// The configuration to use for starting playback. + /// The cancellation token to use. + /// The result that includes any recorded variables. + public virtual ProxyClientResult> StartPlayback(RecordingStartInformation startInfo, CancellationToken token = default) + { + if (startInfo == null) + { + throw new ArgumentNullException(nameof(startInfo)); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "playback/start", startInfo, token); + return SendSyncOrAsync>(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Starts playback session of recordings asynchronously. + /// + /// The configuration to use for starting playback. + /// The cancellation token to use. + /// The result that includes any recorded variables. + public virtual async Task>> StartPlaybackAsync(RecordingStartInformation startInfo, CancellationToken token = default) + { + if (startInfo == null) + { + throw new ArgumentNullException(nameof(startInfo)); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "playback/start", startInfo, token); + return await SendSyncOrAsync>(true, message, token).ConfigureAwait(false); + } + + /// + /// Stops a playback session. + /// + /// The ID for the playback session to stop. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult StopPlayback(string recordingId, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new ArgumentException("Recording ID cannot be null, empty, or white space only"); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "playback/stop", null, token, new() + { + [X_RECORDING_ID_HEADER] = recordingId, + }); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Stops a playback session asynchronously. + /// + /// The ID for the playback session to stop. + /// The cancellation token to use. + /// The client result. + public virtual async Task StopPlaybackAsync(string recordingId, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new ArgumentException("Recording ID cannot be null, empty, or white space only"); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "playback/stop", null, token, new() + { + [X_RECORDING_ID_HEADER] = recordingId, + }); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Starts a recording session. + /// + /// The configuration to use for the recording session. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult StartRecording(RecordingStartInformation startInfo, CancellationToken token = default) + { + if (startInfo == null) + { + throw new ArgumentNullException(nameof(startInfo)); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "record/start", startInfo, token); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Starts a recording session asynchronously. + /// + /// The configuration to use for the recording session. + /// The cancellation token to use. + /// The client result. + public virtual async Task StartRecordingAsync(RecordingStartInformation startInfo, CancellationToken token = default) + { + if (startInfo == null) + { + throw new ArgumentNullException(nameof(startInfo)); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "record/start", startInfo, token); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Stops a recording session. + /// + /// The identifier for the recording session. + /// (Optional) Any additional variables to include with the recording. + /// (Optional) Set this to true to turn off recording. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult StopRecording(string recordingId, IDictionary? variables = null, bool skipRecording = false, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new ArgumentException("Recording ID cannot be null, empty, or white space only"); + } + + Dictionary additionalHeaders = new() + { + [X_RECORDING_ID_HEADER] = recordingId + }; + + if (skipRecording) + { + additionalHeaders["x-recording-skip"] = "request-response"; + } + + variables ??= new Dictionary(); + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "record/stop", variables, token, additionalHeaders); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Stops a recording session asynchronously. + /// + /// The ID for the recording session to stop. + /// (Optional) Any additional variables to include with the recording. + /// (Optional) Set this to true to turn off recording. + /// The cancellation token to use. + /// The client result. + public virtual async Task StopRecordingAsync(string recordingId, IDictionary? variables = null, bool skipRecording = false, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new ArgumentException("Recording ID cannot be null, empty, or white space only"); + } + + Dictionary additionalHeaders = new() + { + [X_RECORDING_ID_HEADER] = recordingId + }; + + if (skipRecording) + { + additionalHeaders["x-recording-skip"] = "request-response"; + } + + variables ??= new Dictionary(); + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "record/stop", variables, token, additionalHeaders); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Sets options for the proxy. + /// + /// The identifier for the playback/recording session. + /// The options to set. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult SetRecordingTransportOptions(string recordingId, ProxyServiceOptions options, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new ArgumentException("Recording ID cannot be null, empty, or white space only"); + } + else if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "admin/setrecordingoptions", options, token, new() + { + [X_RECORDING_ID_HEADER] = recordingId, + }); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Sets options for the proxy asynchronously. + /// + /// The identifier for the playback/recording session. + /// The options to set. + /// The cancellation token to use. + /// The client result. + public virtual async Task SetRecordingTransportOptionsAsync(string recordingId, ProxyServiceOptions options, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new ArgumentException("Recording ID cannot be null, empty, or white space only"); + } + else if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "admin/setrecordingoptions", options, token, new() + { + [X_RECORDING_ID_HEADER] = recordingId, + }); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Removes some pre-defined sanitizers to be used during recording/playback by specifying their IDs. + /// + /// The set of sanitizer IDs to remove. + /// (Optional) If specified, the sanitizers will be removed for a particular session only. + /// If null, the sanitizers will be removed globally on the test proxy. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult RemoveSanitizers(ISet sanitizerIds, string? recordingId = null, CancellationToken token = default) + { + if (sanitizerIds == null) + { + throw new ArgumentNullException(nameof(sanitizerIds)); + } + + Dictionary headers = new(); + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest( + HttpMethod.Post, + "admin/removesanitizers", + new SanitizerIdList() { Sanitizers = sanitizerIds.ToArray() }, + token, + headers); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Removes some pre-defined sanitizers to be used during recording/playback by specifying their IDs. + /// + /// The set of sanitizer IDs to remove. + /// (Optional) If specified, the sanitizers will be removed for a particular session only. + /// If null, the sanitizers will be removed globally on the test proxy. + /// The cancellation token to use. + /// The client result. + public virtual async Task RemoveSanitizersAsync(ISet sanitizerIds, string? recordingId = null, CancellationToken token = default) + { + if (sanitizerIds == null) + { + throw new ArgumentNullException(nameof(sanitizerIds)); + } + + Dictionary headers = new(); + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest( + HttpMethod.Post, + "admin/removesanitizers", + new SanitizerIdList() { Sanitizers = sanitizerIds.ToArray() }, + token, + headers); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Adds sanitizers for the recording test proxy. + /// + /// The sanitizers to add. + /// (Optional) If specified, the sanitizers will added for a particular session only. + /// If null, the sanitizers will be added globally on the test proxy. + /// The cancellation token to use. + /// The client result with the set of sanitizer IDs added. + public virtual ProxyClientResult> AddSanitizers(IEnumerable sanitizers, string? recordingId = null, CancellationToken token = default) + { + if (sanitizers == null) + { + throw new ArgumentNullException(nameof(sanitizers)); + } + + Dictionary headers = new(); + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "Admin/AddSanitizers", sanitizers, token, headers); + ProxyClientResult result = SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + return new ProxyClientResult>( + result.Value.Sanitizers ?? Array.Empty(), + result.GetRawResponse()); + } + + /// + /// Adds sanitizers for the recording test proxy asynchronously. + /// + /// The sanitizers to add. + /// (Optional) If specified, the sanitizers will added for a particular session only. + /// If null, the sanitizers will be added globally on the test proxy. + /// The cancellation token to use. + /// The client result with the set of sanitizer IDs added. + public virtual async Task>> AddSanitizersAsync(IEnumerable sanitizers, string? recordingId = null, CancellationToken token = default) + { + if (sanitizers == null) + { + throw new ArgumentNullException(nameof(sanitizers)); + } + + Dictionary headers = new(); + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "Admin/AddSanitizers", sanitizers, token, headers); + ProxyClientResult result = await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + return new ProxyClientResult>( + result.Value.Sanitizers ?? Array.Empty(), + result.GetRawResponse()); + } + + /// + /// Sets the matcher to use. + /// + /// The matcher to use. + /// (Optional) If specified, the matcher will be set for a particular session only. + /// If null, the matcher will be set globally on the test proxy. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult SetMatcher(BaseMatcher matcher, string? recordingId = null, CancellationToken token = default) + { + if (matcher == null) + { + throw new ArgumentNullException(nameof(matcher)); + } + + Dictionary headers = new() + { + ["x-abstraction-identifier"] = matcher.Type + }; + + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "admin/setmatcher", matcher, token, headers); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Sets the matcher to use asynchronously. + /// + /// The matcher to use. + /// (Optional) If specified, the matcher will be set for a particular session only. + /// If null, the matcher will be set globally on the test proxy. + /// The cancellation token to use. + /// The client result. + public virtual async Task SetMatcherAsync(BaseMatcher matcher, string? recordingId = null, CancellationToken token = default) + { + if (matcher == null) + { + throw new ArgumentNullException(nameof(matcher)); + } + + Dictionary headers = new() + { + ["x-abstraction-identifier"] = matcher.Type + }; + + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "admin/setmatcher", matcher, token, headers); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Adds a transform. + /// + /// The transform to add. + /// (Optional) If specified, the transform will be added for a particular session only. + /// If null, the transform will be added globally on the test proxy. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult AddTransform(BaseTransform transform, string? recordingId = null, CancellationToken token = default) + { + if (transform == null) + { + throw new ArgumentNullException(nameof(transform)); + } + + Dictionary headers = new() + { + ["x-abstraction-identifier"] = transform.Type + }; + + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "admin/addtransform", transform, token, headers); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Adds a transform asynchronously. + /// + /// The transform to add. + /// (Optional) If specified, the transform will be added for a particular session only. + /// If null, the transform will be added globally on the test proxy. + /// The cancellation token to use. + /// The client result. + public virtual async Task AddTransformAsync(BaseTransform transform, string? recordingId = null, CancellationToken token = default) + { + if (transform == null) + { + throw new ArgumentNullException(nameof(transform)); + } + + Dictionary headers = new() + { + ["x-abstraction-identifier"] = transform.Type + }; + + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "admin/addtransform", transform, token, headers); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Resets the sanitizers, matcher, and transforms to the default. + /// + /// (Optional) If specified, only the particular session will be reset. + /// If null, the reset will apply globally. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult Reset(string? recordingId = null, CancellationToken token = default) + { + Dictionary headers = new(); + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "Admin/Reset", null, token, headers); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Resets the sanitizers, matcher, and transforms to the default asynchronously. + /// + /// (Optional) If specified, only the particular session will be reset. + /// If null, the reset will apply globally. + /// The cancellation token to use. + /// The client result. + public virtual async Task ResetAsync(string? recordingId = null, CancellationToken token = default) + { + Dictionary headers = new(); + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "Admin/Reset", null, token, headers); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Lists the available sanitizers, matchers, and transforms. + /// + /// The cancellation token. + /// The client result with the HTML returned from the service. + public virtual ProxyClientResult ListAvailable(CancellationToken token = default) + { + PipelineMessage message = CreateJsonRequest(HttpMethod.Get, "Info/Available", null, token); + ProxyClientResult result = SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + return new ProxyClientResult(result.GetRawResponse().Content.ToString(), result.GetRawResponse()); + } + + /// + /// Lists the available sanitizers, matchers, and transforms asynchronously. + /// + /// The cancellation token. + /// The client result with the HTML returned from the service. + public virtual async Task> ListAvailableAsync(CancellationToken token = default) + { + PipelineMessage message = CreateJsonRequest(HttpMethod.Get, "Info/Available", null, token); + ProxyClientResult result = await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + return new ProxyClientResult(result.GetRawResponse().Content.ToString(), result.GetRawResponse()); + } + + protected virtual PipelineMessage CreateJsonRequest(HttpMethod method, string path, TBody? body, CancellationToken token, Dictionary? headers = null) + { + PipelineMessage message = _pipeline.CreateMessage(); + message.Apply(new RequestOptions + { + CancellationToken = token, + BufferResponse = true + }); + + PipelineRequest request = message.Request; + request.Method = method.Method; + request.Uri = new Uri(_options.HttpEndpoint, path); + request.Headers.Add("Accept", "application/json"); + + if (headers != null) + { + foreach (var kvp in headers) + { + request.Headers.Add(kvp.Key, kvp.Value); + } + } + + if (body != null) + { + MemoryStream stream = new(); + using Utf8JsonWriter writer = new(stream); + JsonSerializer.Serialize(writer, body, Default.RecordingJsonOptions); + BinaryData jsonBody = BinaryData.FromBytes(new ReadOnlyMemory(stream.GetBuffer(), 0, (int)stream.Length)); + + request.Headers.Add("Content-Type", "application/json"); + request.Content = BinaryContent.Create(jsonBody); + } + + return message; + } + + protected virtual async ValueTask SendSyncOrAsync(bool isAsync, PipelineMessage message, CancellationToken token) + { + if (isAsync) + { + await _pipeline.SendAsync(message).ConfigureAwait(false); + } + else + { + _pipeline.Send(message); + } + + PipelineResponse response = message.Response ?? throw new ClientResultException("Response was null", message.Response); + if (response.IsError) + { + if (response.Content.ToMemory().Length > 0) + { + string contentType = response.Headers.GetFirstOrDefault("Content-Type") ?? string.Empty; + + if (contentType.StartsWith("text/", StringComparison.OrdinalIgnoreCase)) + { + string error = response.Content.ToString(); + throw new ClientResultException(error, response); + } + else if (contentType.StartsWith("application/json", StringComparison.OrdinalIgnoreCase)) + { + string error; + try + { + var parsed = response.Content.ToObjectFromJson(new() + { + PropertyNameCaseInsensitive = true + }); + + error = $"{parsed.Status}: {parsed.Message}"; + } + catch + { + error = response.Content.ToString(); + } + + throw new ClientResultException(error, response); + } + } + + throw new ClientResultException(response); + } + + return new ProxyClientResult(response); + } + + protected virtual async ValueTask> SendSyncOrAsync(bool isAsync, PipelineMessage message, CancellationToken token) + { + if (isAsync) + { + await SendSyncOrAsync(isAsync, message, token).ConfigureAwait(false); + } + else + { + SendSyncOrAsync(isAsync, message, token).GetAwaiter().GetResult(); + } + + PipelineResponse response = message.Response!; // we've already validated this is not null in the previous call + + try + { + TResponse? parsed = JsonSerializer.Deserialize(response.Content.ToMemory().Span, Default.TestProxyJsonOptions); + if (parsed == null) + { + throw new InvalidDataException("Response parsed to null"); + } + + return new ProxyClientResult(parsed, response); + } + catch (Exception ex) + { + throw new ClientResultException("Failed to deserialize response", message.Response, ex); + } + } + + private struct ErrorResponse + { + public string? Message { get; set; } + public string? Status { get; set; } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientOptions.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientOptions.cs new file mode 100644 index 0000000000000..bb35323c9f7ed --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientOptions.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Recording.RecordingProxy; + +/// +/// Options for the test proxy client. +/// +public class ProxyClientOptions : ClientPipelineOptions +{ + /// + /// Creates a new instance. + /// + /// The HTTP endpoint. + /// The endpoint was null. + /// The endpoint was not absolute. + public ProxyClientOptions(Uri http) + { + if (http == null) throw new ArgumentNullException(nameof(http)); + else if (!http.IsAbsoluteUri) throw new ArgumentException("URI must be absolute", nameof(http)); + + HttpEndpoint = http; + } + + /// + /// The HTTP endpoint to use + /// + public Uri HttpEndpoint { get; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientResult.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientResult.cs new file mode 100644 index 0000000000000..a1e16d300d52a --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientResult.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.RecordingProxy +{ + /// + /// Represents the result of a proxy client operation. + /// + public class ProxyClientResult : ClientResult + { + /// + /// Initializes a new instance of the class. + /// + /// (Optional) The pipeline response. + public ProxyClientResult(PipelineResponse? response = null) + { + if (response != null) + { + SetRawResponse(response); + } + } + + /// + /// Gets the recording ID from the response headers. + /// + public string? RecordingId => GetRawResponse().Headers.GetFirstOrDefault(ProxyClient.X_RECORDING_ID_HEADER); + } + + /// + /// Represents the result of a proxy client operation. + /// + /// The type of the result value. + public class ProxyClientResult : ProxyClientResult + { + /// + /// Initializes a new instance of the class. + /// + /// The result value. + /// (Optional) The pipeline response. + public ProxyClientResult(TResult value, PipelineResponse? response = null) + { + Value = value; + if (response != null) + { + SetRawResponse(response); + } + } + + /// + /// Gets the result value. + /// + public virtual TResult Value { get; } + + /// + /// Implicitly converts the to the result value. + /// + /// The instance. + /// The result value. + public static implicit operator TResult(ProxyClientResult result) => result.Value; + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyService.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyService.cs new file mode 100644 index 0000000000000..8d6460afd0c63 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyService.cs @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Text; +using NUnit.Framework; +using OpenAI.TestFramework.Recording.RecordingProxy; +using OpenAI.TestFramework.Utils.Processes; + +namespace OpenAI.TestFramework.Recording.Proxy; + +/// +/// Represents the test proxy. See here for more information: +/// https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md +/// +public class ProxyService : IDisposable +{ + private const int c_maxLines = 50; + + private Process _testProxyProcess; + private Uri? _http; + private Uri? _https; + private TaskCompletionSource<(int, int)> _portsAvailableTcs; + private StringBuilder _errorOutput; + private int _lines; + private ProxyClient? _client; + private WindowsJob? _windowsJob; + + /// + /// Creates a new instance. + /// + /// The options to use. + /// was null. + private ProxyService(ProxyServiceOptions options) + { + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + options.Validate(); + + ProcessStartInfo startInfo = new() + { + FileName = options.DotnetExecutable, + Arguments = $@"""{options.TestProxyDll}"" start -u --storage-location=""{options.StorageLocationDir}""", + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + EnvironmentVariables = + { + ["ASPNETCORE_URLS"] = $"http://127.0.0.1:{options.HttpPort};https://127.0.0.1:{options.HttpsPort}", + ["Logging__LogLevel__Azure.Sdk.Tools.TestProxy"] = "Error", + ["Logging__LogLevel__Default"] = "Error", + ["Logging__LogLevel__Microsoft.AspNetCore"] = "Error", + ["Logging__LogLevel__Microsoft.Hosting.Lifetime"] = "Information", + } + }; + + if (options.DevCertFile != null) + { + startInfo.EnvironmentVariables["ASPNETCORE_Kestrel__Certificates__Default__Path"] = options.DevCertFile; + if (options.DevCertPassword != null) + { + startInfo.EnvironmentVariables["ASPNETCORE_Kestrel__Certificates__Default__Password"] = options.DevCertPassword; + } + } + + _errorOutput = new(); + _portsAvailableTcs = new(); + _testProxyProcess = new Process() + { + EnableRaisingEvents = true, + StartInfo = startInfo + }; + + _testProxyProcess.Exited += (_, _) => + { + _portsAvailableTcs.TrySetException(new InvalidOperationException("Test proxy process exited unexpectedly")); + }; + _testProxyProcess.ErrorDataReceived += HandleStdErr; + _testProxyProcess.OutputDataReceived += HandleStdOut; + + _windowsJob = null; + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + // If running on Windows, use a Job to instruct the OS to kill the test proxy service process + // should this current process die for any reason. + _windowsJob = new($"TestProxy_{Process.GetCurrentProcess().Id}"); + } + } + + /// + /// Gets the client to use to communicate with this recording test proxy. + /// + public ProxyClient Client => _client + ?? throw new InvalidOperationException("Please wait for the proxy to finish starting first"); + + /// + /// Gets the HTTP endpoint the test recording proxy is listening on. + /// + public Uri HttpEndpoint => _http + ?? throw new InvalidOperationException("Please wait for the proxy to finish starting first"); + + /// + /// Gets the HTTPS endpoint the test recording proxy is listening on. + /// + public Uri HttpsEndpoint => _https + ?? throw new InvalidOperationException("Please wait for the proxy to finish starting first"); + + /// + /// Creates a new instance of the recording test proxy. + /// + /// The options to use for the proxy. + /// The cancellation token to use. + /// The initialized recording test proxy instance. + public static async Task CreateNewAsync(ProxyServiceOptions options, CancellationToken token = default) + { + token.ThrowIfCancellationRequested(); + + ProxyService proxy = new ProxyService(options); + + // Try to make sure the test proxy process is terminated when we exit + AppDomain.CurrentDomain.DomainUnload += (_, _) => proxy.Dispose(); + // TODO FIXME: On Windows, use a job to ensure the OS will properly kill the process + + await proxy.StartAsync(token).ConfigureAwait(false); + return proxy; + } + + /// + /// Tears down the recording test proxy instance. + /// + public void Dispose() + { + _portsAvailableTcs.TrySetException(new ObjectDisposedException(nameof(ProxyService))); + try + { + _testProxyProcess.Kill(); + if (_windowsJob != null) + { + // do NOT call Dispose here. This will terminate this process too. + } + } catch { /* we tried */ } + } + + /// + /// Checks to see if any errors were encountered in the test proxy, and if so throws an exception. + /// + /// If there were any errors encountered. + public void ThrowOnErrors() + { + lock (_errorOutput) + { + if (_errorOutput.Length > 0) + { + string error = _errorOutput.ToString(); + _errorOutput.Clear(); + throw new InvalidOperationException($"An error occurred in the test proxy:\n{error}"); + } + } + } + + /// + /// For testing purposes only + /// + /// The client to set. + internal void SetClient(ProxyClient client) + { + _client = client; + } + + /// + /// Starts the recording test proxy instance, and waits until we can read the ports it is listening on for + /// HTTP and HTTPS. + /// + /// The cancellation token to use. + /// Asynchronous tas + /// The test proxy failed to start, or we encountered some other error. + protected async Task StartAsync(CancellationToken token = default) + { + token.Register(_portsAvailableTcs.SetCanceled); + + bool success = _testProxyProcess.Start(); + if (!success) + { + throw new InvalidOperationException("The test proxy process failed to start"); + } + + _windowsJob?.Add(_testProxyProcess); + + _testProxyProcess.BeginOutputReadLine(); + _testProxyProcess.BeginErrorReadLine(); + + await _portsAvailableTcs.Task.ConfigureAwait(false); + } + + private static Uri? ParseListeningOnUri(string line) + { + const string nowListeningOn = "Now listening on: "; + int index = line.IndexOf(nowListeningOn, StringComparison.OrdinalIgnoreCase); + if (index < 0) + { + return null; + } + + Uri.TryCreate(line.AsSpan().Slice(index + nowListeningOn.Length).Trim().ToString(), UriKind.Absolute, out Uri? uri); + return uri; + } + + private void HandleStdErr(object sender, DataReceivedEventArgs args) + { + if (args?.Data != null) + { + lock (_errorOutput) + { + _errorOutput.Append(args.Data); + } + + TestContext.Progress.WriteLine(args.Data); + } + } + + private void HandleStdOut(object sender, DataReceivedEventArgs args) + { + if (_lines++ >= c_maxLines) + { + _portsAvailableTcs.TrySetException(new InvalidOperationException( + $"Failed to start the test proxy. One or both the ports was not populated. http: {_http}, https: {_https}")); + _testProxyProcess.OutputDataReceived -= HandleStdOut; + return; + } + else if (args?.Data == null) + { + return; + } + + Uri? uri = ParseListeningOnUri(args.Data); + if (_http == null && uri?.Scheme == "http") + { + _http = uri; + _client = new ProxyClient(new ProxyClientOptions(_http!)); + } + else if (_https == null && uri?.Scheme == "https") + { + _https = uri; + } + + if (_http != null && _https != null) + { + _testProxyProcess.OutputDataReceived -= HandleStdOut; + _portsAvailableTcs.TrySetResult((_http.Port, _https.Port)); + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyServiceOptions.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyServiceOptions.cs new file mode 100644 index 0000000000000..2f3e3d27f7b6e --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyServiceOptions.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Proxy; + +/// +/// Options for starting the recording test proxy. +/// +public class ProxyServiceOptions +{ + /// + /// Gets the full path to the dotnet executable. + /// + required public string DotnetExecutable { get; set; } + + /// + /// Gets the full path to the test proxy DLL. + /// + required public string TestProxyDll { get; set; } + + /// + /// The path to the directory to store or read recordings from. + /// + required public string StorageLocationDir { get; set; } + + /// + /// (Optional) The file to use for the HTTPS endpoint certificate. + /// + public string? DevCertFile { get; set; } + + /// + /// (Optional) The password to use for opening the for the HTTPS endpoint. + /// + public string? DevCertPassword { get; set; } + + /// + /// (Optional) The HTTP port the test proxy should listen on. Set this to 0 to have the next available port be automatically selected. + /// + public ushort HttpPort { get; set; } + + /// + /// (Optional) The HTTPS port the test proxy should listen on. Set this to 0 to have the next available port be automatically selected. + /// + public ushort HttpsPort { get; set; } + + /// + /// Validates the configuration. + /// + /// The storage location directory was could not be found. + /// The HTTPS certificate file could not be found. + /// No password was specified for the developer certificate file. + internal protected virtual void Validate() + { + List exceptions = new(); + + if (!File.Exists(DotnetExecutable)) + { + exceptions.Add(new FileNotFoundException("Could not find (or read from) the dotnet executable: " + DotnetExecutable)); + } + else if (!File.Exists(TestProxyDll)) + { + exceptions.Add(new FileNotFoundException("Could not find (or read from) the test proxy DLL: " + TestProxyDll)); + } + else if (!Directory.Exists(StorageLocationDir)) + { + exceptions.Add(new DirectoryNotFoundException("Could not find (or read from) the following directory: " + StorageLocationDir)); + } + else if (DevCertFile != null && !File.Exists(DevCertFile)) + { + exceptions.Add(new FileNotFoundException("Could not find (or read from) the HTTPS certificate file: " + DevCertFile)); + } + else if (DevCertFile != null && DevCertPassword == null) + { + exceptions.Add(new InvalidOperationException($"You must set the {nameof(DevCertPassword)} property if you specify the {nameof(DevCertFile)}")); + } + + if (exceptions.Any()) + { + throw new AggregateException("The test proxy service configuration is invalid", exceptions); ; + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransport.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransport.cs new file mode 100644 index 0000000000000..69cb9a8fcd6a9 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransport.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Net.Http; +using System.Text.Json; + +namespace OpenAI.TestFramework.Recording.RecordingProxy; + +/// +/// Implements a that will redirect all HTTP/HTTPS requests to the test proxy for recording or playback. +/// Depending on the mode, the test proxy will then either forward the request to the upstream service and record the request and response, +/// or playback the response from a previous recording. +/// +public class ProxyTransport : PipelineTransport +{ + private const string DevCertIssuer = "CN=localhost"; + private const string FiddlerCertIssuer = "CN=DO_NOT_TRUST_FiddlerRoot, O=DO_NOT_TRUST, OU=Created by http://www.fiddler2.com"; + private const string FiddlerHost = "ipv4.fiddler"; + + private readonly ProxyTransportOptions _options; + + /// + /// Initializes a new instance of the class. + /// + /// The options for the proxy transport. + public ProxyTransport(ProxyTransportOptions options) + { + _options = options ?? throw new ArgumentNullException(nameof(options)); + + string certIssuer; + if (_options.UseFiddler) + { + certIssuer = FiddlerCertIssuer; + } + else + { + certIssuer = DevCertIssuer; + } + + HttpClientHandler handler = new() + { + ServerCertificateCustomValidationCallback = (_, certificate, _, _) => certificate?.Issuer == certIssuer, + UseCookies = _options.AllowCookies, + AllowAutoRedirect = _options.AllowAutoRedirect + }; + + InnerTransport = new HttpClientPipelineTransport(new HttpClient(handler)); + } + + /// + /// The actual transport to use for sending requests, and receiving responses. + /// + protected PipelineTransport InnerTransport { get; } + + /// + protected override PipelineMessage CreateMessageCore() + { + Exception? ex = _options.MismatchException?.GetValue(); + if (ex != null) + { + throw ex; + } + + PipelineMessage message = InnerTransport.CreateMessage(); + PipelineRequest request = message.Request; + + // PipelineRequest no longer has a ClientRequestId property, so we need to set it on the headers directly + request.Headers.Add("x-ms-client-request-id", _options.RequestId); + + return message; + } + + /// + protected override void ProcessCore(PipelineMessage message) + => ProcessCoreSyncOrAsync(message, async: false).GetAwaiter().GetResult(); + + /// + protected override ValueTask ProcessCoreAsync(PipelineMessage message) + => ProcessCoreSyncOrAsync(message, async: true); + + /// + /// Processes the pipeline message synchronously or asynchronously. + /// + /// The pipeline message to process. + /// A flag indicating whether to process asynchronously. + /// A representing the asynchronous operation. + protected virtual async ValueTask ProcessCoreSyncOrAsync(PipelineMessage message, bool async) + { + try + { + RedirectToTestProxy(message); + if (async) + { + await InnerTransport.ProcessAsync(message).ConfigureAwait(false); + } + else + { + InnerTransport.Process(message); + } + + await ProcessResponseSyncAsync(message, async).ConfigureAwait(false); + } + finally + { + // revert the original URI - this is important for tests that rely on aspects of the URI in the pipeline + // e.g. KeyVault caches tokens based on URI + message.Request.Headers.TryGetValue("x-recording-upstream-base-uri", out string? original); + if (message.Request.Uri is null) + { + throw new InvalidOperationException("The request cannot have a null URI"); + } + if (original == null) + { + throw new InvalidOperationException("The TestProxy response did not contain the expected \"x-recording-upstream-base-uri\" header"); + } + + var originalBaseUri = new Uri(original); + var builder = new UriBuilder(message.Request.Uri); + builder.Scheme = originalBaseUri.Scheme; + builder.Host = originalBaseUri.Host; + builder.Port = originalBaseUri.Port; + + message.Request.Uri = builder.Uri; + } + } + + /// + /// Processes the response synchronously or asynchronously. + /// + /// The pipeline message containing the response. + /// A flag indicating whether to process asynchronously. + /// A representing the asynchronous operation. + protected virtual async ValueTask ProcessResponseSyncAsync(PipelineMessage message, bool async) + { + if (message.Response?.Headers.TryGetValues("x-request-mismatch", out _) == true) + { + if (message.Response.ContentStream == null) + { + throw new TestRecordingMismatchException("Detected a mismatch but the response had no body"); + } + + using var doc = async + ? await JsonDocument.ParseAsync(message.Response.ContentStream).ConfigureAwait(false) + : JsonDocument.Parse(message.Response.ContentStream); + throw new TestRecordingMismatchException(doc.RootElement.GetProperty("Message").GetString(), null); + } + } + + // copied from https://github.com/Azure/azure-sdk-for-net/blob/main/common/Perf/Azure.Test.Perf/TestProxyPolicy.cs + /// + /// Redirects the pipeline message to the test proxy based on the recording mode. + /// + /// The pipeline message to redirect. + protected virtual void RedirectToTestProxy(PipelineMessage message) + { + if (_options.Mode == RecordedTestMode.Record) + { + switch (_options.ShouldRecordRequest(message.Request)) + { + case RequestRecordMode.Record: + break; + case RequestRecordMode.RecordWithoutRequestBody: + message.Request.Headers.Set("x-recording-skip", "request-body"); + break; + case RequestRecordMode.DoNotRecord: + message.Request.Headers.Set("x-recording-skip", "request-response"); + break; + } + } + else if (_options.Mode == RecordedTestMode.Playback) + { + switch (_options.ShouldRecordRequest(message.Request)) + { + case RequestRecordMode.Record: + break; + case RequestRecordMode.RecordWithoutRequestBody: + // CAUTION: setting the request content to null has the unfortunate side effect of causing any HttpClient backed + // implementation of networking to not send up any Content-??? headers as well which can cause test + // mismatches. Let's work around this by setting some empty content. + message.Request.Content = BinaryContent.Create(BinaryData.FromBytes(Array.Empty())); + break; + case RequestRecordMode.DoNotRecord: + throw new InvalidOperationException( + "Cannot playback when recording has been disabled. Please make sure to skip the test or request."); + } + } + + var request = message.Request; + request.Headers.Set("x-recording-id", _options.RecordingId); + request.Headers.Set("x-recording-mode", _options.Mode.ToString().ToLowerInvariant()); + + if (request.Uri is null) + { + throw new InvalidOperationException("Request URI cannot be null"); + } + + // Intentionally reset the upstream URI in case the request URI changes between retries - e.g. when using GeoRedundant secondary Storage + var builder = new UriBuilder() + { + Scheme = request.Uri.Scheme, + Host = request.Uri.Host, + Port = request.Uri.Port, + }; + request.Headers.Set("x-recording-upstream-base-uri", builder.ToString()); + + Uri baseUri = request.Uri.Scheme == "https" ? _options.HttpsEndpoint : _options.HttpEndpoint; + + builder = new(request.Uri); + builder.Host = _options.UseFiddler ? FiddlerHost : baseUri.Host; + builder.Port = baseUri.Port; + + request.Uri = builder.Uri; + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransportOptions.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransportOptions.cs new file mode 100644 index 0000000000000..a0087e8508468 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransportOptions.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.RecordingProxy; + +/// +/// The options for the recording test proxy transport. +/// +public class ProxyTransportOptions +{ + private Func? _shouldRecordRequest; + + /// + /// Gets or sets the test proxy HTTP endpoint. + /// + required public Uri HttpEndpoint { get; set; } + + /// + /// Gets or sets the test proxy HTTPS endpoint. + /// + required public Uri HttpsEndpoint { get; set; } + + /// + /// Gets or sets the current test recording mode. + /// + required public RecordedTestMode Mode { get; set; } + + /// + /// Gets or sets the identifier for the recording. + /// + required public string RecordingId { get; set; } + + /// + /// The ID for the request. Please make sure that a consistent ID is used during recording and playback to avoid + /// mismatches. + /// + required public string RequestId { get; set; } + + /// + /// Gets or sets the delegate used to get/set the test recording mismatch exception. + /// + public PropertyDelegate? MismatchException { get; set; } + + /// + /// Gets or sets a value indicating whether to use Fiddler. If this is true, the transport will be updated to accept + /// the Fiddler root certificate. + /// + public bool UseFiddler { get; set; } + + /// + /// Gets or sets the predicate used to determine whether or not a particular request should not be recorded. + /// Default behaviour is to defer to what the matchers/sanitizers do. + /// + public Func ShouldRecordRequest + { + get => _shouldRecordRequest ?? (_ => RequestRecordMode.Record); + set => _shouldRecordRequest = value; + } + + /// + /// Gets or sets a value indicating whether to allow cookies while sending and receiving requests. + /// + public bool AllowCookies { get; set; } + + /// + /// Gets or sets a value indicating whether to allow auto redirect when processing server responses. + /// + public bool AllowAutoRedirect { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/RequestRecordMode.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/RequestRecordMode.cs new file mode 100644 index 0000000000000..d8a782327c8de --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/RequestRecordMode.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.RecordingProxy; + +/// +/// Enumeration of possible values of how to record a request. This acts as an override. +/// +public enum RequestRecordMode +{ + /// + /// Records the request. + /// + Record, + /// + /// Records the request headers but skips the request body. + /// + RecordWithoutRequestBody, + /// + /// Does not record the request (nor the response). + /// + DoNotRecord, +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/PemPair.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/PemPair.cs new file mode 100644 index 0000000000000..15c72d94e9921 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/PemPair.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Proxy.Service; + +/// +/// Information about certificates for the test proxy service. +/// +public class PemPair +{ + /// Gets or sets the pem value. + public string? PemValue { get; set; } + /// Gets or sets the pem key. + public string? PemKey { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceRecordingOptions.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceRecordingOptions.cs new file mode 100644 index 0000000000000..449e909260155 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceRecordingOptions.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Proxy.Service; + +/// +/// Options for the test proxy. +/// +public class ProxyServiceRecordingOptions +{ + /// + /// Whether or not to follow redirects + /// + public bool? HandleRedirects { get; set; } + + /// + /// If set, this will change the "root" path the test proxy uses when loading a recording. + /// + public string? ContextDirectory { get; set; } + + /// + /// Options for the transport. + /// + public ProxyServiceTransportCustomizations? Transport { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceTransportCustomizations.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceTransportCustomizations.cs new file mode 100644 index 0000000000000..6be1ba257e34c --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceTransportCustomizations.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.Proxy.Service; + +/// +/// Transport customizations for the test proxy service. +/// +public class ProxyServiceTransportCustomizations() +{ + /// Gets or sets the allow auto redirect. + public bool? AllowAutoRedirect { get; set; } + + /// + /// If specified, the public key contained here will be used during validation of the SSL connection by + /// comparing thumbprints. + /// + public string? TLSValidationCert { get; set; } + + /// + /// If specified, the will only be applied to the specified host. + /// + public string? TSLValidationCertHost { get; set; } + + /// + /// Each certificate pair contained within this list should be added to the clientHandler for the server + /// or an individual recording. + /// + public IList? Certificates { get; set; } + + /// + /// During playback, a response is normally returned all at once. By offering this response time, we can + /// "stretch" the writing of the response bytes over a time range of milliseconds. + /// + [JsonConverter(typeof(TimespanToMillisecondConverter))] + public TimeSpan? PlaybackResponseTime { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/RecordingStartInformation.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/RecordingStartInformation.cs new file mode 100644 index 0000000000000..e3526592a288e --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/RecordingStartInformation.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; + +namespace OpenAI.TestFramework.Recording.Proxy.Service; + +/// +/// Information for starting a recording or playback session with the recording test proxy. +/// +public class RecordingStartInformation +{ + /// + /// Gets or sets the file to save recordings to, or to play back requests from. + /// + [JsonPropertyName("x-recording-file")] + required public string RecordingFile { get; set; } + + /// + /// Gets or sets the path to the "assets.json" file to use for integration with external Git + /// repositories. This enables the proxy to work against repositories that do not emplace their + /// test recordings directly alongside their test implementations. + /// + /// + /// Please refer to the documentation for more information: + /// https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/documentation/asset-sync/README.md + /// + [JsonPropertyName("x-recording-assets-file")] + public string? AssetsFile { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/SanitizerIdList.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/SanitizerIdList.cs new file mode 100644 index 0000000000000..f0982542b7be2 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/SanitizerIdList.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Proxy.Service; + +/// +/// Request to remove sanitizers for the test proxy. +/// +public struct SanitizerIdList +{ + /// + /// The IDs of the sanitizers to remove. + /// + public string[]? Sanitizers { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseRegexSanitizer.cs b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseRegexSanitizer.cs new file mode 100644 index 0000000000000..3c52f35b83628 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseRegexSanitizer.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Sanitizers; + +/// +/// The case class for regex based sanitizers +/// +public abstract class BaseRegexSanitizer(string type) : BaseSanitizer(type) +{ + /// + /// Gets the regular expression to match what to replace. + /// + public string? Regex { get; set; } + + /// + /// Gets or sets the value to replace the match with. + /// + public string? Value { get; set; } + + /// + /// Gets or sets the group in the regex match to replace. + /// + public string? GroupForReplace { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseSanitizer.cs b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseSanitizer.cs new file mode 100644 index 0000000000000..011145bf58a05 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseSanitizer.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using System.Text.Json.Serialization; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.Sanitizers; + +/// +/// The base class for all test proxy recording sanitizers +/// +public abstract class BaseSanitizer : IUtf8JsonSerializable +{ + /// + /// Creates a new instance. + /// + /// The type of this sanitizer (e.g. GeneralRegexSanitizer). + /// If the type was null. + protected BaseSanitizer(string type) + { + Type = type ?? throw new ArgumentNullException(nameof(Type)); + } + + /// + /// Gets the type of the sanitizer (e.g. HeaderRegexSanitizer). + /// + [JsonIgnore] + public string Type { get; } + + /// + public void Write(Utf8JsonWriter writer, JsonSerializerOptions? options = null) + { + writer.WriteStartObject(); + { + writer.WriteString("Name"u8, Type); + writer.WritePropertyName("Body"u8); + + SerializeInner(writer, options); + } + writer.WriteEndObject(); + } + + /// + /// Serializes the child types. By default this will use reflection based serialization. + /// + /// The writer to write to. + protected virtual void SerializeInner(Utf8JsonWriter writer, JsonSerializerOptions? options = null) + { + // By default use reflection based serialization + JsonSerializer.Serialize(writer, this, GetType(), Default.InnerRecordingJsonOptions); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyKeySanitizer.cs b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyKeySanitizer.cs new file mode 100644 index 0000000000000..87b3f67e1da36 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyKeySanitizer.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Sanitizers; + +/// +/// Sanitizer for a request body that matches a particular value in JSON using a JPath expression. +/// +public class BodyKeySanitizer : BaseRegexSanitizer +{ + /// + /// Creates a new instance. + /// + /// The JSON path to match. + /// If the JSON path is null. + public BodyKeySanitizer(string jsonPath) : base("BodyKeySanitizer") + { + JsonPath = jsonPath ?? throw new ArgumentNullException(nameof(jsonPath)); + } + + /// + /// The JPath expression to match a particular value to sanitize. + /// + public string JsonPath { get; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyRegexSanitizer.cs b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyRegexSanitizer.cs new file mode 100644 index 0000000000000..e49b6f625f4d9 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyRegexSanitizer.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Sanitizers; + +/// +/// Sanitizer for the body of a request or response. +/// +public class BodyRegexSanitizer : BaseRegexSanitizer +{ + /// + /// Creates a new instance. + /// + /// Gets the regular expression to match what to replace. + /// If was null. + public BodyRegexSanitizer(string regex) : base("BodyRegexSanitizer") + { + Regex = regex ?? throw new ArgumentNullException(nameof(regex)); + } + + /// + /// Condition to apply for the sanitization or transform. If the condition is not met, sanitization is not performed. + /// + public Condition? Condition { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/HeaderRegexSanitizer.cs b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/HeaderRegexSanitizer.cs new file mode 100644 index 0000000000000..d1a76fc0455df --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/HeaderRegexSanitizer.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Sanitizers; + +/// +/// Sanitizer for a request header. +/// +public class HeaderRegexSanitizer : BaseRegexSanitizer +{ + /// + /// Creates a new instance. + /// + /// The header to sanitize. + /// If the is null. + public HeaderRegexSanitizer(string key) : base("HeaderRegexSanitizer") + { + Key = key ?? throw new ArgumentNullException(nameof(key)); + } + + /// + /// The name of the header to sanitize. + /// + public string Key { get; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/UriRegexSanitizer.cs b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/UriRegexSanitizer.cs new file mode 100644 index 0000000000000..3c5bad68e871d --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/UriRegexSanitizer.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Sanitizers; + +/// +/// Sanitizer for a request URI. +/// +public class UriRegexSanitizer : BaseRegexSanitizer +{ + /// + /// Creates a new instance. + /// + /// The regular expression to match in the request URI. + /// If the regular expression is null. + public UriRegexSanitizer(string regex) : base("UriRegexSanitizer") + { + Regex = regex ?? throw new ArgumentNullException(nameof(regex)); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/TestRandom.cs b/sdk/openai/tools/TestFramework/src/Recording/TestRandom.cs new file mode 100644 index 0000000000000..d3b6bccb6a3b6 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/TestRandom.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording; + +/// +/// Represents an implementation of the class used for test recordings. +/// +public class TestRandom : Random +{ + private RecordedTestMode _mode; + + /// + /// Initializes a new instance of the class. + /// + /// The recorded test mode. + /// The seed value. + public TestRandom(RecordedTestMode mode, int seed) : base(seed) + { + _mode = mode; + } + + /// + /// Generates a new based on the recorded test mode. + /// + /// A new . + public Guid NewGuid() + { + if (_mode == RecordedTestMode.Live) + { + return Guid.NewGuid(); + } + + var bytes = new byte[16]; + NextBytes(bytes); + return new Guid(bytes); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/TestRecording.cs b/sdk/openai/tools/TestFramework/src/Recording/TestRecording.cs new file mode 100644 index 0000000000000..d58573f9e58a1 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/TestRecording.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Globalization; +using System.Security.Cryptography; +using OpenAI.TestFramework.Recording.Matchers; +using OpenAI.TestFramework.Recording.Proxy; +using OpenAI.TestFramework.Recording.RecordingProxy; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording; + +/// +/// Represents a test recording session. This is used to record or playback requests and responses. It also provides +/// a random generator that is consistent between recording and playback sessions. +/// +public class TestRecording : IAsyncDisposable +{ + /// + /// The key to use to store the random seed in the recording. + /// + public const string RandomSeedVariableKey = "RandomSeed"; + + private SortedDictionary _variables; + + /// + /// Creates a new instance. + /// + /// The unique identifier for the recording. + /// The current recording mode. + /// The test proxy service instance to use for the recording. + /// (Optional) Any variables populate this recording this. This is normally used in + /// playback mode to pass in any variables saved as part of the recording. + /// Any of the required parameters are null. + /// Some expected values were missing or null. + /// The current recording mode is not supported. + public TestRecording(string id, RecordedTestMode mode, ProxyService proxy, IDictionary? variables = null) + { + ID = id ?? throw new ArgumentNullException(nameof(id)); + Mode = mode; + Proxy = proxy ?? throw new ArgumentNullException(nameof(proxy)); + _variables = variables == null + ? new() + : new(variables); + + if (Proxy.Client == null) + { + throw new InvalidOperationException("Recording test proxy did not have a client defined"); + } + + int seed; + switch (Mode) + { + case RecordedTestMode.Live: + Random = new TestRandom(Mode, GetRandomSeed()); + break; + + case RecordedTestMode.Record: + seed = GetRandomSeed(); + _variables[RandomSeedVariableKey] = seed.ToString(CultureInfo.InvariantCulture); + Random = new TestRandom(Mode, seed); + break; + + case RecordedTestMode.Playback: + if (Variables.TryGetValue(RandomSeedVariableKey, out string? seedString) + && int.TryParse(seedString, NumberStyles.Integer, CultureInfo.InvariantCulture, out seed)) + { + Random = new TestRandom(Mode, seed); + } + else + { + // To maximise backwards compatibility with the recordings from the previous test framework, we'll just use a random + // seed if one wasn't set instead of failing here. Worst case, we'll get recording mismatches if this is not configured + // correctly. + Random = new TestRandom(Mode, GetRandomSeed()); + } + break; + + default: + throw new NotSupportedException("Unsupported recording mode: " + Mode); + } + } + + /// + /// Gets the unique identifier for this recording. + /// + public string ID { get; } + + /// + /// Gets the current recording mode. + /// + public RecordedTestMode Mode { get; } + + /// + /// Gets the random generator to use for this recording. Using this ensures consistent random values generated during + /// recording, as well as during playback. + /// + public TestRandom Random { get; } + + /// + /// Gets the proxy service associated with the recording. + /// + protected internal ProxyService Proxy { get; } + + /// + /// Gets any variables associated with the recording. + /// + protected IReadOnlyDictionary Variables => _variables; + + /// + /// Disposes of the recording session. If you were recording, this will try to save your captured requests and + /// responses. If you were playing back, this will stop the playback session. + /// + /// Asynchronous task + public virtual ValueTask DisposeAsync() => FinishAsync(true); + + /// + /// Finishes the recording session. This will stop recording or playback. If you were recording, you can use + /// to determine whether or not captured requests and responses will be saved. + /// + /// True to save any captured requests and responses to the file specified in your + /// . False to not save. This is only used if + /// you were recording. + /// The cancellation token to use. + /// Asynchronous task + /// If the recording mode is not supported. + public async virtual ValueTask FinishAsync(bool save, CancellationToken token = default) + { + switch (Mode) + { + case RecordedTestMode.Live: + // nothing to see here, move along + break; + case RecordedTestMode.Playback: + await Proxy.Client.StopPlaybackAsync(ID, token).ConfigureAwait(false); + break; + case RecordedTestMode.Record: + await Proxy.Client.StopRecordingAsync(ID, _variables, !save, token).ConfigureAwait(false); + break; + default: + throw new NotSupportedException("The following mode is not supported: " + Mode); + } + + Proxy.ThrowOnErrors(); + } + + /// + /// Gets a recorded variable. + /// + /// The name of the variable. + /// The variable value, or null if the variable was not set. + public virtual string? GetVariable(string name) + { + return _variables.GetValueOrDefault(name); + } + + /// + /// Sets a recorded variable to a value. + /// + /// The name of the variable. + /// The value to set. + public virtual void SetVariable(string name, string value) + { + _variables[name] = value; + } + + /// + /// Gets a recorded variable, or if it was not set, creates and adds a new variable. + /// + /// The name of the variable. + /// The factory used to create a value if none was previously set. + /// The already existing value, or the newly added value. + public virtual string GetOrAddVariable(string name, Func valueFactory) + { + string? value; + if (!_variables.TryGetValue(name, out value) || value == null) + { + value = valueFactory(); + SetVariable(name, value); + } + + return value; + } + + /// + /// Gets the options to use as the options for creating transport to pass to clients. This will allow the clients to + /// forward requests to the test proxy. + /// + /// The options to use. + public virtual ProxyTransportOptions GetProxyTransportOptions() + { + return new() + { + HttpEndpoint = Proxy.HttpEndpoint, + HttpsEndpoint = Proxy.HttpsEndpoint, + Mode = Mode, + RecordingId = ID, + RequestId = Random.NewGuid().ToString() + }; + } + + /// + /// Applies recording options to the current recording. + /// + /// The recording options to apply for this recording/playback session. + /// The cancellation token to use. + /// Asynchronous task + public virtual async Task ApplyOptions(TestRecordingOptions options, CancellationToken token) + { + if (options.Sanitizers.Any()) + { + await Proxy.Client.AddSanitizersAsync(options.Sanitizers, ID, token).ConfigureAwait(false); + } + + if (options.SanitizersToRemove.Any()) + { + await Proxy.Client.RemoveSanitizersAsync(options.SanitizersToRemove, ID, token).ConfigureAwait(false); + } + + if (Mode == RecordedTestMode.Playback) + { + BaseMatcher matcher = options.Matcher ?? new CustomMatcher() + { + CompareBodies = options.CompareBodies, + ExcludedHeaders = options.ExcludedHeaders.JoinOrNull(","), + IgnoredHeaders = options.IgnoredHeaders.JoinOrNull(","), + IgnoredQueryParameters = options.IgnoredQueryParameters.JoinOrNull(","), + }; + + await Proxy.Client.SetMatcherAsync(matcher, ID, token).ConfigureAwait(false); + + foreach (var transform in options.Transforms) + { + await Proxy.Client.AddTransformAsync(transform, ID, token).ConfigureAwait(false); + } + } + } + + private static int GetRandomSeed() + { +#if NET6_0_OR_GREATER + return RandomNumberGenerator.GetInt32(int.MaxValue); +#else + byte[] bytes = new byte[4]; + using var rng = RandomNumberGenerator.Create(); + rng.GetBytes(bytes); + return BitConverter.ToInt32(bytes, 0); +#endif + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/TestRecordingMismatchException.cs b/sdk/openai/tools/TestFramework/src/Recording/TestRecordingMismatchException.cs new file mode 100644 index 0000000000000..3f6af0242620e --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/TestRecordingMismatchException.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.Serialization; + +namespace OpenAI.TestFramework.Recording; + +/// +/// Exception thrown when the test recording does not match during playback. +/// +[Serializable] +public class TestRecordingMismatchException : Exception +{ + /// + /// Creates a new instance + /// + public TestRecordingMismatchException() + { + } + + /// + /// Creates a new instance. + /// + /// The exception message. + public TestRecordingMismatchException(string message) : base(message) + { + } + + /// + /// Creates a new instance. + /// + /// The exception message. + /// The inner exception. + public TestRecordingMismatchException(string? message, Exception? innerException = null) : base(message, innerException) + { + } + +#if !NET8_0_OR_GREATER + /// + protected TestRecordingMismatchException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } +#endif +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/TestRecordingOptions.cs b/sdk/openai/tools/TestFramework/src/Recording/TestRecordingOptions.cs new file mode 100644 index 0000000000000..de97b0d89d9d5 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/TestRecordingOptions.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using OpenAI.TestFramework.Recording.Matchers; +using OpenAI.TestFramework.Recording.RecordingProxy; +using OpenAI.TestFramework.Recording.Sanitizers; +using OpenAI.TestFramework.Recording.Transforms; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording; + +/// +/// Options to configure a test recording. This can be used to set sanitizers to apply to the URI, headers, and/or body of a request +/// before matching, and before saving the recording. This can also be used to specify which matcher will be used to match a request +/// to a recorded one during playback. Finally this can be used to set the transforms applied to responses from the test proxy. +/// +public class TestRecordingOptions +{ + /// + /// Creates a new instance + /// + public TestRecordingOptions() + { } + + /// + /// The list of sanitizers to apply to request before matching, and before saving a recording. + /// + public IList Sanitizers { get; } = new List(); + + /// + /// Gets or sets the matcher to use. If this is unset, a custom matcher will be created based on the options specified in this class. + /// + public BaseMatcher? Matcher { get; set; } + + /// + /// The list of transforms to apply when returning a response during playback. + /// + public IList Transforms { get; } = new List(); + + /// + /// The sanitizers to remove from the list of default sanitizers. More details about default sanitizers can be found here: + /// https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md#removing-a-sanitizer. + /// + /// You can find the list of sanitizer IDs to remove in two ways: + /// + /// Sending a GET request to http://{proxy_endpoint}/Info/Active + /// Looking at the source code for the test proxy here: + /// https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs + /// + /// + public ISet SanitizersToRemove { get; } = new HashSet() + { + // For now, we should leave the default sanitizers in place since it is better to err on the side of caution + }; + + /// + /// Query parameters that we are only interested in checking if a value is set, but don't care about the actual value set. + /// + public ISet IgnoredQueryParameters { get; } = new HashSet(); + + /// + /// Headers that we are only interested in checking if a value is set, but don't care about the actual value set. + /// + public ISet IgnoredHeaders { get; } = new HashSet() + { + "Date", + "x-ms-date", + "User-Agent", + }; + + /// + /// Headers to completely disregard when recording and matching. In other words it is as if these headers were never set. + /// + public ISet ExcludedHeaders { get; } = new HashSet() + { +#if NETFRAMEWORK + // .Net framework will add some headers not found in newer .Net versions so let's completely ignore them here. It is also + // different in how it handles setting the Content-Length header when there is no body as compared to .Net + "Connection", + "Content-Length", +#endif + }; + + /// + /// Whether or not we want to compare bodies from the request and the recorded request during playback. Default + /// is true. + /// + public bool CompareBodies { get; set; } = true; + + /// + /// A function used to override if recording is enabled for a particular request. This will override other settings present + /// here. + /// + public Func? RequestOverride { get; set; } + + /// + /// Helper method to simplify sanitizing specific headers values. This will add a entry + /// to . The default replacement value will be set to . + /// + /// The keys to sanitize. + public void SanitizeHeaders(params string[] keys) + => SanitizeHeaders(Default.SanitizedValue, keys); + + /// + /// Helper method to simplify sanitizing specific headers values. This will add a entry + /// to . + /// + /// The value to replace matches with. + /// The keys to sanitize. + public virtual void SanitizeHeaders(string sanitizedValue, IEnumerable keys) + { + if (keys == null) + { + return; + } + + foreach (var key in keys) + { + Sanitizers.Add(new HeaderRegexSanitizer(key) { Value = sanitizedValue }); + } + } + + /// + /// Helper method to sanitize specific parts of a JSON request body. This will add a entry + /// to for each JSON path provided in . The default replacement value + /// will be set to . + /// + /// The JSON paths to sanitize. + public void SanitizeJsonBody(params string[] jsonPaths) + => SanitizeJsonBody(Default.SanitizedValue, jsonPaths); + + /// + /// Helper method to sanitize specific parts of a JSON request body. This will add a entry + /// to for each JSON path provided in . + /// + /// The value to replace matches with. + /// The JSON paths to sanitize. + public virtual void SanitizeJsonBody(string sanitizedValue, IEnumerable jsonPaths) + { + if (jsonPaths == null) + { + return; + } + + foreach (var key in jsonPaths) + { + Sanitizers.Add(new BodyKeySanitizer(key) { Value = sanitizedValue }); + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Transforms/BaseTransform.cs b/sdk/openai/tools/TestFramework/src/Recording/Transforms/BaseTransform.cs new file mode 100644 index 0000000000000..11be5e1be0833 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Transforms/BaseTransform.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using System.Text.Json.Serialization; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.Transforms; + +/// +/// Base class for test recording proxy transforms. Transforms are applied when returning a request during playback. +/// +public abstract class BaseTransform : IUtf8JsonSerializable +{ + /// + /// Creates a new instance. + /// + /// The type of this sanitizer (e.g. GeneralRegexSanitizer). + /// If the type was null. + protected BaseTransform(string type) + { + Type = type ?? throw new ArgumentNullException(nameof(Type)); + } + + /// + /// Gets the type of the sanitizer (e.g. HeaderRegexSanitizer). + /// + [JsonIgnore] + public string Type { get; } + + /// + public virtual void Write(Utf8JsonWriter writer, JsonSerializerOptions? options = null) + { + // By default use reflection based serialization + JsonSerializer.Serialize(writer, this, GetType(), Default.InnerRecordingJsonOptions); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Transforms/HeaderTransform.cs b/sdk/openai/tools/TestFramework/src/Recording/Transforms/HeaderTransform.cs new file mode 100644 index 0000000000000..4817f84c512c9 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Transforms/HeaderTransform.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Transforms; + +/// +/// Transform applied to headers before the response is generated during recording playback. +/// +public class HeaderTransform : BaseTransform +{ + /// + /// Creates a new instance. + /// + /// The response header to set. + /// If the is null. + public HeaderTransform(string key) : base("HeaderTransform") + { + Key = key ?? throw new ArgumentNullException(nameof(key)); + } + + /// + /// Gets the header to transform. + /// + public string Key { get; } + + /// + /// Gets or sets the value to set. + /// + public string? Value { get; set; } + + /// + /// The condition to apply for this transform. If the condition is not met, no transform is performed. + /// + public Condition? Condition { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/SyncOnlyAttribute.cs b/sdk/openai/tools/TestFramework/src/SyncOnlyAttribute.cs new file mode 100644 index 0000000000000..2d00681f9cbe9 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/SyncOnlyAttribute.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; + +namespace OpenAI.TestFramework; + +/// +/// Attribute that can be applied to a test to indicate it only runs in synchronous mode. +/// +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] +public class SyncOnlyAttribute() : NUnitAttribute +{ +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/AndPreFilters.cs b/sdk/openai/tools/TestFramework/src/Utils/AndPreFilters.cs new file mode 100644 index 0000000000000..714bb78e1836e --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/AndPreFilters.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Reflection; +using NUnit.Framework.Interfaces; + +namespace OpenAI.TestFramework.Utils; + +/// +/// Represents a pre-filter that combines multiple pre-filters using a logical AND operation. +/// +public class AndPreFilter : IPreFilter +{ + private IEnumerable _filters; + + /// + /// Initializes a new instance. + /// + /// The pre-filters to combine. + public AndPreFilter(params IPreFilter[] filters) : this((IEnumerable)filters) + { } + + /// + /// Initializes a new instance. + /// + /// The pre-filters to combine. + public AndPreFilter(IEnumerable filters) + { + _filters = filters?.Where(p => p != null) ?? Array.Empty(); + } + + /// + public bool IsMatch(Type type) => _filters.All(p => p.IsMatch(type)); + + /// + public bool IsMatch(Type type, MethodInfo method) => _filters.All(p => p.IsMatch(type, method)); +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/AssemblyHelper.cs b/sdk/openai/tools/TestFramework/src/Utils/AssemblyHelper.cs new file mode 100644 index 0000000000000..ae11a0eed22a6 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/AssemblyHelper.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Reflection; +using System.Runtime.InteropServices; + +namespace OpenAI.TestFramework.Utils +{ + /// + /// Assembly related helper methods + /// + public static class AssemblyHelper + { + /// + /// Gets the value of the named assembly metadata attribute for the assembly where the is defined. + /// + /// The type whose assembly we want to read from. + /// The name of the metadata assembly attribute to read. + /// The value of the metadata attribute, or null if none was specified or could be found. + public static string? GetAssemblyMetadata(string name) + => GetAssemblyMetadata(typeof(T).Assembly, name); + + /// + /// Gets the value of the named assembly metadata attribute from assembly. + /// + /// The assembly to read the metadata attribute from + /// The name of the metadata assembly attribute to read. + /// The value of the metadata attribute, or null if none was specified or could be found. + public static string? GetAssemblyMetadata(this Assembly assembly, string name) + { + return assembly + ?.GetCustomAttributes() + .FirstOrDefault(a => a.Key == name && !string.IsNullOrWhiteSpace(a.Value)) + ?.Value; + } + + /// + /// Gets the root source directory for the assembly that defines the type . + /// + /// The type whose assembly source path we want to read. + /// The directory containing the original source path, or null if it was not set or did not exist. + public static DirectoryInfo? GetAssemblySourceDir() + => GetAssemblySourceDir(typeof(T).Assembly); + + /// + /// Gets the source path for the assembly. In order for this to work, you will need to set the assembly metadata attribute + /// your project file as follows: + /// + /// <ItemGroup> + /// <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute"> + /// <_Parameter1>SourcePath</_Parameter1> + /// <_Parameter2>$(MSBuildProjectDirectory)</_Parameter2> + /// </AssemblyAttribute> + /// </ItemGroup> + /// + /// + /// The assembly whose source path we want to find. + /// The directory containing the original source path, or null if it was not set or did not exist. + public static DirectoryInfo? GetAssemblySourceDir(this Assembly assembly) + { + string? sourcePath = assembly.GetAssemblyMetadata("SourcePath"); + if (sourcePath == null) + { + return null; + } + + DirectoryInfo dir = new(sourcePath); + return dir.Exists + ? dir + : null; + } + + /// + /// Finds the dotnet executable path for the current system. It does this by reading the DOTNET_INSTALL_DIR environment variable + /// first, and then inspecting all folders in the current PATH environment variable. + /// + /// The path to the found dotnet executable, or null if none could be found. + public static FileInfo? GetDotnetExecutable() + { + string dotnetExeName = "dotnet"; + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + dotnetExeName += ".exe"; + } + + List searchDirs = + [ + Environment.GetEnvironmentVariable("DOTNET_INSTALL_DIR"), + ..Environment.GetEnvironmentVariable("PATH") + ?.Split(Path.PathSeparator) + ?? Array.Empty() + ]; + + return searchDirs + .Where(dir => !string.IsNullOrWhiteSpace(dir)) + .Select(dir => new FileInfo(Path.Combine(dir!, dotnetExeName))) + .FirstOrDefault(file => file.Exists); + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/Default.cs b/sdk/openai/tools/TestFramework/src/Utils/Default.cs new file mode 100644 index 0000000000000..5774a477498ac --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/Default.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace OpenAI.TestFramework.Utils; + +/// +/// Options used for various recordings. +/// +public static class Default +{ + private static JsonSerializerOptions? _recordingJsonOptions; + private static JsonSerializerOptions? _innerRecordingJsonOptions; + private static JsonSerializerOptions? _testProxyJsonOptions; + private static TimeSpan? _testProxyWaitTime; + private static TimeSpan? _requestRetryDelay; + private static TimeSpan? _debuggerTestTimeout; + private static TimeSpan? _defaultTestTimeout; + + /// + /// Gets the default value to replace matches with while sanitizing. + /// + public const string SanitizedValue = "Sanitized"; + + /// + /// Gets the JSON serialization options to use for recording sanitizers, matchers, and transforms child instances. + /// + public static JsonSerializerOptions InnerRecordingJsonOptions => _innerRecordingJsonOptions ??= new() + { + PropertyNameCaseInsensitive = true, + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + WriteIndented = true, +#if NET + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, +#else + IgnoreNullValues = true, +#endif + }; + + /// + /// Gets the JSON serialization options to use for recording sanitizers, matchers, and transforms. + /// + public static JsonSerializerOptions RecordingJsonOptions + { + get + { + if (_recordingJsonOptions == null) + { + _recordingJsonOptions = InnerRecordingJsonOptions.Clone(); + _recordingJsonOptions.Converters.Add( + +#if NET6_0 + // .Net 6.0 seems to have a weird bug here. This is not needed for .Net framework, nor .Net 7+ + new Utf8JsonSerializableConverterFactory() +#else + new Utf8JsonSerializableConverter() +#endif + ); + } + + return _recordingJsonOptions; + } + } + + + /// + /// Gets the JSON serialization options to use for the test proxy + /// + public static JsonSerializerOptions TestProxyJsonOptions => _testProxyJsonOptions ??= new() + { + PropertyNameCaseInsensitive = true, + WriteIndented = true, +#if NET + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, +#else + IgnoreNullValues = true, +#endif + }; + + /// + /// The default maximum amount of time to wait to for the test proxy operations to finish (e.g. start up + /// and configuration, or saving a recording and teardown). + /// + public static TimeSpan TestProxyWaitTime => _testProxyWaitTime ??= TimeSpan.FromMinutes(2); + + /// + /// Gets the maximum number of times to retry requests + /// + public const int MaxRequestRetries = 3; + + /// + /// The amount of time to wait between requests. + /// + public static TimeSpan RequestRetryDelay => _requestRetryDelay ??= TimeSpan.FromSeconds(0.8); + + /// + /// The amount of time to wait when the debugger is attached. This is much higher than normal to allow for more time while debugging. + /// + public static TimeSpan DebuggerAttachedTestTimeout => _debuggerTestTimeout ??= TimeSpan.FromMinutes(15); + + /// + /// The default test timeout. + /// + public static TimeSpan TestTimeout => _defaultTestTimeout ??= TimeSpan.FromSeconds(15); +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/Extensions.cs b/sdk/openai/tools/TestFramework/src/Utils/Extensions.cs new file mode 100644 index 0000000000000..333febdafad3a --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/Extensions.cs @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.Diagnostics; + +namespace OpenAI.TestFramework.Utils; + +/// +/// String related extension methods. +/// +public static class StringExtensions +{ + /// + /// Ensures that a string ends with a specified suffix. + /// + /// The string value. + /// The suffix to check for. + /// The string comparison type. Default is . + /// The original string if it ended in the suffix, or a new string value with the suffix appended. + public static string EnsureEndsWith(this string value, string suffix, StringComparison comparison = StringComparison.Ordinal) + { + if (value == null) + { + return null!; + } + + if (value.EndsWith(suffix, comparison)) + { + return value; + } + + return value + suffix; + } + + /// + /// Ensures that a string ends with a specified suffix. + /// + /// The string value. + /// The suffix to check for. + /// The string comparison type. Default is . + /// The original string if it ended in the suffix, or a new string value with the suffix appended. + public static string EnsureEndsWith(this string value, char suffix, StringComparison comparison = StringComparison.Ordinal) + => EnsureEndsWith(value, suffix.ToString(), comparison); +} + +/// +/// Extension methods for System.ClientModel types. +/// +public static class ScmExtensions +{ + /// + /// Gets the first value associated with the specified header name from the pipeline request headers. + /// + /// The pipeline request headers. + /// The name of the header. + /// The first non-empty value associated with the specified header name, or null if the header is not found or has no non-empty values. + public static string? GetFirstOrDefault(this PipelineRequestHeaders headers, string name) + { + if (headers?.TryGetValues(name, out IEnumerable? values) == true) + { + return values?.FirstOrDefault(v => !string.IsNullOrWhiteSpace(v)); + } + + return null; + } + + /// + /// Gets the first value associated with the specified header name from the pipeline response headers. + /// + /// The pipeline response headers. + /// The name of the header. + /// The first non-empty value associated with the specified header name, or null if the header is not found or has no non-empty values. + public static string? GetFirstOrDefault(this PipelineResponseHeaders headers, string name) + { + if (headers?.TryGetValues(name, out IEnumerable? values) == true) + { + return values?.FirstOrDefault(v => !string.IsNullOrWhiteSpace(v)); + } + + return null; + } +} + +/// +/// Extensions for collections +/// +public static class CollectionExtensions +{ + /// + /// Adds the elements to a collection. + /// + /// The type of the elements in the collection. + /// The collection to add elements to. + /// The items to add. + public static void AddRange(this ICollection collection, IEnumerable itemsToAdd) + { + foreach (T item in itemsToAdd) + { + collection.Add(item); + } + } + + /// + /// Joins the elements of a collection into a single string using the specified separator. + /// Returns null if the collection is null or empty. + /// + /// The collection of strings to join. + /// The separator string. + /// A string that consists of the elements of the collection joined by the separator, or null if the collection is null or empty. + public static string? JoinOrNull(this IEnumerable values, string separator) + { + if (values == null || !values.Any()) + { + return null; + } + + return string.Join(separator, values); + } + +#if NETFRAMEWORK + /// + /// Gets the value associated with the specified key from the dictionary, or returns the default value if the key is not found. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The value associated with the specified key, or the default value if the key is not found. + public static TVal? GetValueOrDefault(this IReadOnlyDictionary dict, TKey key) + => GetValueOrDefault(dict, key, default!); + + /// + /// Gets the value associated with the specified key from the dictionary, or returns the specified default value if the key is not found. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The default value to return if the key is not found. + /// The value associated with the specified key, or the specified default value if the key is not found. + public static TVal GetValueOrDefault(this IReadOnlyDictionary dict, TKey key, TVal defaultValue) + { + if (dict?.TryGetValue(key, out TVal? value) == true) + { + return value; + } + + return defaultValue; + } +#endif + + /// + /// Gets the value associated with the specified key from the dictionary, or returns the default value if the key is not found. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The value associated with the specified key, or the default value if the key is not found. + public static TVal? GetValueOrDefault(this Dictionary dict, TKey key) where TKey : notnull + => GetValueOrDefault((IDictionary)dict, key, default!); + + /// + /// Gets the value associated with the specified key from the dictionary, or returns the specified default value if the key is not found. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The default value to return if the key is not found. + /// The value associated with the specified key, or the specified default value if the key is not found. + public static TVal GetValueOrDefault(this Dictionary dict, TKey key, TVal defaultValue) where TKey : notnull + => GetValueOrDefault((IDictionary)dict, key, defaultValue); + + /// + /// Gets the value associated with the specified key from the sorted dictionary, or returns the default value if the key is not found. + /// + /// The type of the keys in the sorted dictionary. + /// The type of the values in the sorted dictionary. + /// The sorted dictionary. + /// The key to locate. + /// The value associated with the specified key, or the default value if the key is not found. + public static TVal? GetValueOrDefault(this SortedDictionary dict, TKey key) where TKey : notnull + => GetValueOrDefault((IDictionary)dict, key, default!); + + /// + /// Gets the value associated with the specified key from the sorted dictionary, or returns the specified default value if the key is not found. + /// + /// The type of the keys in the sorted dictionary. + /// The type of the values in the sorted dictionary. + /// The sorted dictionary. + /// The key to locate. + /// The default value to return if the key is not found. + /// The value associated with the specified key, or the specified default value if the key is not found. + public static TVal GetValueOrDefault(this SortedDictionary dict, TKey key, TVal defaultValue) where TKey : notnull + => GetValueOrDefault((IDictionary)dict, key, defaultValue); + + /// + /// Gets the value associated with the specified key from the dictionary, or returns the default value if the key is not found. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The value associated with the specified key, or the default value if the key is not found. + public static TVal? GetValueOrDefault(this IDictionary dict, TKey key) + => GetValueOrDefault(dict, key, default!); + + /// + /// Gets the value associated with the specified key from the dictionary, or returns the specified default value if the key is not found. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The default value to return if the key is not found. + /// The value associated with the specified key, or the specified default value if the key is not found. + public static TVal GetValueOrDefault(this IDictionary dict, TKey key, TVal defaultValue) + { + if (dict?.TryGetValue(key, out TVal? value) == true) + { + return value; + } + + return defaultValue; + } + + /// + /// Gets the value associated with the specified key from the dictionary, or creates and adds a new value if the key did not exist. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The function used to create a value for the key if it is not found in the dictionary. + /// The value associated with the specified key, or the value created by the if the key is not found. + public static TValue GetOrAdd(this IDictionary dictionary, TKey key, Func valueFactory) + { + if (dictionary == null) + { + throw new ArgumentNullException(nameof(dictionary)); + } + + if (!dictionary.TryGetValue(key, out TValue? value)) + { + value = valueFactory(key); + dictionary[key] = value; + } + + return value!; + } + + /// + /// Asynchronously returns the first element of a sequence. + /// is found. + /// + /// The type of the elements in the sequence. + /// The sequence to search. + /// A cancellation token to cancel the operation. + /// Asynchronous task. + public static ValueTask FirstOrDefaultAsync(this IAsyncEnumerable enumerable, CancellationToken token = default) + => FirstOrDefaultAsync(enumerable, _ => true); + + /// + /// Asynchronously returns the first element of a sequence that satisfies a specified condition or a default value if no such element + /// is found. + /// + /// The type of the elements in the sequence. + /// The sequence to search. + /// A function to test each element for a condition. + /// A cancellation token to cancel the operation. + /// Asynchronous task. + public static async ValueTask FirstOrDefaultAsync(this IAsyncEnumerable enumerable, Predicate predicate, CancellationToken token = default) + { + await foreach (T item in enumerable.WithCancellation(token)) + { + if (predicate(item)) + { + return item; + } + } + + return default!; + } + + /// + /// Converts an to a asynchronously. + /// + /// The type of the elements in the enumerable. + /// The to convert. + /// The cancellation token. + /// Asynchronous task to do the conversion. + public static async Task> ToListAsync(this IAsyncEnumerable asyncEnumerable, CancellationToken token = default) + { + List list = new List(); + await foreach (T item in asyncEnumerable.WithCancellation(token)) + { + list.Add(item); + } + return list; + } +} + +/// +/// Helpers for working with paths. +/// +public static class PathHelpers +{ + /// + /// Create a relative path from one path to another. Paths will be resolved before calculating the difference. + /// + /// The source path the output should be relative to. This path is always considered to be a directory. + /// The destination path. + /// The relative path or if the paths don't share the same root. + public static string GetRelativePath(string relativeTo, string path) + { + +#if NET + return Path.GetRelativePath(relativeTo, path); +#else + relativeTo = Path.GetFullPath(relativeTo).EnsureEndsWith(Path.DirectorySeparatorChar); + path = Path.GetFullPath(path).EnsureEndsWith(Path.DirectorySeparatorChar); + + Uri relativeToUri = new Uri(relativeTo); + Uri pathUri = new Uri(path); + + if (relativeToUri.Scheme != pathUri.Scheme) + { + return path; + } + + Uri relative = relativeToUri.MakeRelativeUri(pathUri); + return Uri.UnescapeDataString(relative.ToString()) + .Replace('/', '\\'); +#endif + } +} + + +/// +/// Extensions for types. +/// +public static class TypeExtensions +{ + /// + /// Determines whether the specified type either implements the open generic type specified, + /// or inherits from the open generic type specified. + /// + /// The type to inspect. + /// The open generic type. + /// The arguments of the closed generic type. + /// True if the type implements, or inherits, or is a closed version of the open type. + [DebuggerStepThrough] + public static bool IsClosedGenericOf(this Type type, Type openGeneric, out Type[] closedTypeArguments) + { + Type? closedType = null; + + if (openGeneric.IsInterface) + { + closedType = type.GetInterfaces() + .FirstOrDefault(iType => IsAssignableToOpen(iType, openGeneric)); + } + + if (closedType == null) + { + for (Type? current = type; current != null && closedType == null; current = current.BaseType) + { + if (IsAssignableToOpen(current, openGeneric)) + { + closedType = current; + } + } + } + + closedTypeArguments = closedType?.GetGenericArguments() ?? Array.Empty(); + return closedType != null; + } + + /// + /// Determines if the type is or inherits from the open generic type. + /// + /// The type. + /// The open generic type. + /// True if the open generic type could be assigned from the type. + [DebuggerStepThrough] + public static bool IsAssignableToOpen(this Type type, Type openGeneric) + { + if (!type.IsGenericType || !type.IsConstructedGenericType) + { + return false; + } + + return openGeneric.IsAssignableFrom(type.GetGenericTypeDefinition()); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/IUtf8JsonSerializable.cs b/sdk/openai/tools/TestFramework/src/Utils/IUtf8JsonSerializable.cs new file mode 100644 index 0000000000000..7b81c3532f3f0 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/IUtf8JsonSerializable.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; + +namespace OpenAI.TestFramework.Utils; + +/// +/// Interface applied to types that can be serialized to JSON. +/// +public interface IUtf8JsonSerializable +{ + /// + /// Writes this instance as JSON to the writer. + /// + /// The writer to write to. + /// The options to use when writing. + void Write(Utf8JsonWriter writer, JsonSerializerOptions? options = null); +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/JsonHelpers.cs b/sdk/openai/tools/TestFramework/src/Utils/JsonHelpers.cs new file mode 100644 index 0000000000000..ed6752ca4c306 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/JsonHelpers.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace OpenAI.TestFramework.Utils; + +public static class JsonHelpers +{ + /// + /// Serializes the specified data to a stream using as a UTF-8 encoded JSON text. + /// + /// The type of the data to serialize. + /// The stream to write the serialized data to. + /// The data to serialize. + /// (Optional) Options to use when serializing. + public static void Serialize(Stream stream, T data, JsonSerializerOptions? options = null) + { +#if NETFRAMEWORK + using (Utf8JsonWriter writer = new(stream)) + { + JsonSerializer.Serialize(writer, data, options); + writer.Flush(); + } +#else + JsonSerializer.Serialize(stream, data, options); +#endif + } + + /// + /// Deserializes UTF-8 encoded JSON text from a stream. + /// + /// The type of the data to deserialize. + /// The stream to read the serialized data from. + /// (Optional) Options to use when deserializing. + /// The deserialized data. + public static T? Deserialize(Stream stream, JsonSerializerOptions? options = null) + { +#if NETFRAMEWORK + // For now let's keep it simple and load entire JSON bytes into memory + using MemoryStream buffer = new(); + stream.CopyTo(buffer); + + ReadOnlySpan jsonBytes = buffer.GetBuffer().AsSpan(0, (int)buffer.Length); + return JsonSerializer.Deserialize(jsonBytes, options); +#else + return JsonSerializer.Deserialize(stream, options); +#endif + } + +#if NET6_0_OR_GREATER + // .Net 6 and newer already have the extension method we need defined in JsonSerializer +#else + // TODO FIXME once we move to newer versions of System.Text.Json we can directly use the + // JsonSerializer extension method for elements + public static T? Deserialize(this JsonElement element, JsonSerializerOptions? options = null) + { + using MemoryStream stream = new(); + using Utf8JsonWriter writer = new(stream, new() + { + Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + Indented = false, + SkipValidation = true + }); + element.WriteTo(writer); + writer.Flush(); + + stream.Seek(0, SeekOrigin.Begin); + if (((ulong)stream.Length & 0xffffffff00000000) != 0ul) + { + throw new ArgumentOutOfRangeException("JsonElement is too large"); + } + + ReadOnlySpan span = new(stream.GetBuffer(), 0, (int)stream.Length); + return JsonSerializer.Deserialize(span, options); + } +#endif + + /// + /// Serializes a value to a JsonElement. + /// + /// Type of the data to serialize. + /// The value to serialize. + /// (Optional) Options to use when serializing. + /// The serialized value as a JsonElement. + public static JsonElement SerializeToElement(T value, JsonSerializerOptions? options = null) + { +#if NET6_0_OR_GREATER + return JsonSerializer.SerializeToElement(value, options); +#else + using MemoryStream stream = new(); + Serialize(stream, value, options); + stream.Seek(0, SeekOrigin.Begin); + return JsonDocument.Parse(stream).RootElement; +#endif + } + + /// + /// Creates a clone of the specified JSON serializer options. + /// + /// The JSON serializer options to clone. + /// (Optional) Filter to apply for selecting specific converters to include in the cloned options. + /// A clone of the JSON serializer options. + public static JsonSerializerOptions Clone(this JsonSerializerOptions options, Predicate? converterFilter = null) + { +#if NET + JsonSerializerOptions cloned = new JsonSerializerOptions(options); + if (converterFilter != null) + { + cloned.Converters.Clear(); + foreach (var converter in options.Converters.Where(c => converterFilter(c))) + { + cloned.Converters.Add(converter); + } + } + + return cloned; +#else + JsonSerializerOptions clone = new() + { + AllowTrailingCommas = options.AllowTrailingCommas, + DefaultBufferSize = options.DefaultBufferSize, + DictionaryKeyPolicy = options.DictionaryKeyPolicy, + Encoder = options.Encoder, + IgnoreNullValues = options.IgnoreNullValues, + IgnoreReadOnlyProperties = options.IgnoreReadOnlyProperties, + MaxDepth = options.MaxDepth, + PropertyNameCaseInsensitive = options.PropertyNameCaseInsensitive, + PropertyNamingPolicy = options.PropertyNamingPolicy, + ReadCommentHandling = options.ReadCommentHandling, + WriteIndented = options.WriteIndented, + }; + + foreach (var converter in options.Converters.Where(c => converterFilter?.Invoke(c) ?? true)) + { + clone.Converters.Add(converter); + } + + return clone; +#endif + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/PropertyDelegate.cs b/sdk/openai/tools/TestFramework/src/Utils/PropertyDelegate.cs new file mode 100644 index 0000000000000..3c2f467cf80a0 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/PropertyDelegate.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Utils; + +/// +/// Represents a delegate for getting and setting property values. +/// +/// The type of the property value. +public struct PropertyDelegate +{ + private Func? _getter; + private Action? _setter; + + /// + /// Initializes a new instance of the struct. + /// + /// The delegate used to get the property value. + /// The delegate used to set the property value. + public PropertyDelegate(Func getter, Action setter) + { + _getter = getter ?? throw new ArgumentNullException(nameof(getter)); + _setter = setter ?? throw new ArgumentNullException(nameof(setter)); + } + + /// + /// Gets the value of the property. + /// + /// The value of the property. + public TVal GetValue() + { + if (_getter != null) + return _getter(); + else + throw new InvalidOperationException("No getter was set"); + } + + /// + /// Sets the value of the property. + /// + /// The value to set. + public void SetValue(TVal val) + { + if (_setter != null) + _setter(val); + else + throw new InvalidOperationException("No setter was set"); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/SyncAsyncPreFilter.cs b/sdk/openai/tools/TestFramework/src/Utils/SyncAsyncPreFilter.cs new file mode 100644 index 0000000000000..a2c32fc1a0874 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/SyncAsyncPreFilter.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Reflection; +using NUnit.Framework.Interfaces; + +namespace OpenAI.TestFramework.Utils +{ + /// + /// Filter to exclude sync only or async only tests in the appropriate test run. + /// + public class SyncAsyncPreFilter : IPreFilter + { + private bool _isAsync; + + /// + /// Creates a new instance. + /// + /// True to filter for an async test run, false to filter for sync test run. + public SyncAsyncPreFilter(bool isAsync) + { + _isAsync = isAsync; + } + + /// + public bool IsMatch(Type type) + => type.GetCustomAttribute() != null; + + /// + public bool IsMatch(Type type, MethodInfo method) + { + if (!IsMatch(type)) + { + return false; + } + + return _isAsync && method.GetCustomAttribute() == null + || !_isAsync && method.GetCustomAttribute() == null; + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/TestClientRetryPolicy.cs b/sdk/openai/tools/TestFramework/src/Utils/TestClientRetryPolicy.cs new file mode 100644 index 0000000000000..517ff55764216 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/TestClientRetryPolicy.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.Diagnostics; +using System.Reflection; + +namespace OpenAI.TestFramework.Utils; + +/// +/// Represents a retry policy to be used when testing clients. +/// +public class TestClientRetryPolicy : ClientRetryPolicy +{ + private Func _getRetries; + + /// + /// Initializes a new instance of the class. + /// + /// The maximum number of retries. + /// The delay between retries. + /// Indicates whether the delay should be exponential. + public TestClientRetryPolicy(int maxRetries = Utils.Default.MaxRequestRetries, TimeSpan? delay = null, bool exponentialDelay = false) + : base(maxRetries) + { + MaxRetries = MaxRetries; + Delay = delay ?? Utils.Default.RequestRetryDelay; + IsExponentialDelay = exponentialDelay; + + // Of course, even reading the number of retries property on the PipelineMessage is internal only. + // So reflection it is + _getRetries = (Func) + (typeof(PipelineMessage).GetProperty("RetryCount", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance) + ?.GetGetMethod(true) + ?.CreateDelegate(typeof(Func)) + ?? throw new InvalidOperationException("Failed to get RetryCount property")); + } + + /// + /// Gets the maximum number of retries. + /// + public int MaxRetries { get; } + + /// + /// Gets the delay between retries. + /// + public TimeSpan Delay { get; } + + /// + /// Gets a value indicating whether the delay should be exponential. + /// + public bool IsExponentialDelay { get; } + + /// + protected override TimeSpan GetNextDelay(PipelineMessage message, int tryCount) + { + TimeSpan delay = IsExponentialDelay + ? TimeSpan.FromMilliseconds((1 << tryCount - 1) * Delay.TotalMilliseconds) + : Delay; + + return delay; + } + + /// + protected override bool ShouldRetry(PipelineMessage message, Exception? exception) + { + if (_getRetries(message) >= MaxRetries) + { + return false; + } + + if (!message.ResponseClassifier.TryClassify(message, exception, out bool isRetriable) + && !PipelineMessageClassifier.Default.TryClassify(message, exception, out isRetriable)) + { + Debug.Assert(false, "Failed to classify message"); + } + + return isRetriable; + } + + /// + protected override ValueTask ShouldRetryAsync(PipelineMessage message, Exception? exception) + => new ValueTask(ShouldRetry(message, exception)); +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/TestPipelinePolicy.cs b/sdk/openai/tools/TestFramework/src/Utils/TestPipelinePolicy.cs new file mode 100644 index 0000000000000..bc004f1bcee5f --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/TestPipelinePolicy.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Utils; + +/// +/// A pipeline policy that raises events before a request sent, and after response has been received. +/// +public class TestPipelinePolicy() : PipelinePolicy() +{ + /// + /// Creates a new instance. This will instantiate the and + /// events based on and respectively. + /// + /// (Optional) Action to perform before sending a request. + /// (Optional) Action to perform after a response is received. + public TestPipelinePolicy(Action? requestAction, Action? responseAction) : this() + { + if (requestAction != null) BeforeRequest += (s, e) => requestAction(e); + + if (responseAction != null) AfterResponse += (s, e) => responseAction(e); + } + + /// + /// Event raised before a request is sent. + /// + public event EventHandler? BeforeRequest; + + /// + /// Event raised after a response has been received. + /// + public event EventHandler? AfterResponse; + + /// + public override void Process(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) + { + BeforeRequest?.Invoke(this, message.Request); + ProcessNext(message, pipeline, currentIndex); + if (message.Response != null) + { + AfterResponse?.Invoke(this, message.Response); + } + } + + /// + public override async ValueTask ProcessAsync(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) + { + BeforeRequest?.Invoke(this, message.Request); + await ProcessNextAsync(message, pipeline, currentIndex).ConfigureAwait(false); + if (message.Response != null) + { + AfterResponse?.Invoke(this, message.Response); + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/TimespanToMillisecondConverter.cs b/sdk/openai/tools/TestFramework/src/Utils/TimespanToMillisecondConverter.cs new file mode 100644 index 0000000000000..7045f956b75ce --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/TimespanToMillisecondConverter.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace OpenAI.TestFramework.Utils; + +/// +/// Converter for TimeSpans to/from integer millisecond values in JSON. +/// +public class TimespanToMillisecondConverter : JsonConverter +{ + /// + /// Reads a value from JSON. + /// + /// The to read from. + /// The type of the object to convert. + /// The serializer options. + /// The deserialized value. + public override TimeSpan? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case JsonTokenType.Null: + return null; + + case JsonTokenType.Number: + return TimeSpan.FromMilliseconds(reader.GetInt32()); + + case JsonTokenType.String: + string? strValue = reader.GetString(); + if (int.TryParse(strValue, NumberStyles.Integer, CultureInfo.InvariantCulture, out int milliseconds)) + { + return TimeSpan.FromMilliseconds(milliseconds); + } + else + { + throw new JsonException("Invalid millisecond value: " + strValue); + } + + default: + throw new JsonException($"Don't know how to parse '{reader.TokenType}' as a millisecond value"); + } + } + + /// + /// Writes a value to JSON. + /// + /// The to write to. + /// The value to write. + /// The serializer options. + public override void Write(Utf8JsonWriter writer, TimeSpan? value, JsonSerializerOptions options) + { + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteNumberValue((int)Math.Ceiling(value.Value.TotalMilliseconds)); + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/Utf8JsonSerializableConverter.cs b/sdk/openai/tools/TestFramework/src/Utils/Utf8JsonSerializableConverter.cs new file mode 100644 index 0000000000000..3613f66c03495 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/Utf8JsonSerializableConverter.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace OpenAI.TestFramework.Utils; + +/// +/// Converter for types that implement . +/// +public class Utf8JsonSerializableConverter : JsonConverter +{ + private static Utf8JsonSerializableConverter? s_instance; + + /// + /// Gets the shared instance of the converter. + /// + public static Utf8JsonSerializableConverter Instance => s_instance ??= new(); + + /// + public override bool CanConvert(Type typeToConvert) + => typeof(IUtf8JsonSerializable).IsAssignableFrom(typeToConvert); + + /// + public override IUtf8JsonSerializable Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + => throw new NotSupportedException("Only writing JSON is supported"); + + /// + public override void Write(Utf8JsonWriter writer, IUtf8JsonSerializable value, JsonSerializerOptions options) + => value.Write(writer); +} + +#if NET6_0 +/// +/// .Net 6.0 has some odd quirks and is particularly pedantic with converters so directly using Utf8JsonSerializableConverter would +/// result in an InvalidCastException. The work around is to use a converter factory. Thankfully, neither .Net Framework, nor .Net 7+ +/// exhibit this behavior. +/// +public class Utf8JsonSerializableConverterFactory : JsonConverterFactory +{ + public override bool CanConvert(Type typeToConvert) => typeof(IUtf8JsonSerializable).IsAssignableFrom(typeToConvert); + public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) + => (JsonConverter?)Activator.CreateInstance(typeof(InnerConverter<>).MakeGenericType(typeToConvert)); + + private class InnerConverter : JsonConverter where T : IUtf8JsonSerializable + { + public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + => (T)Utf8JsonSerializableConverter.Instance.Read(ref reader, typeToConvert, options); + + public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options) + => Utf8JsonSerializableConverter.Instance.Write(writer, value, options); + } +} +#endif diff --git a/sdk/openai/tools/TestFramework/src/Utils/WindowsJob.cs b/sdk/openai/tools/TestFramework/src/Utils/WindowsJob.cs new file mode 100644 index 0000000000000..a5eb2570b1d1d --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/WindowsJob.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics; +using System.Runtime.ConstrainedExecution; +using System.Runtime.InteropServices; +using System.Security; + +namespace OpenAI.TestFramework.Utils.Processes; + +/// +/// A job provides a way to link several processes together on Windows. In this way, they can all be +/// terminated by calling the method. The OS will also automatically terminate +/// the linked processes if the owner process terminates. +/// +public class WindowsJob : IDisposable +{ + private IntPtr _jobHandle; + private int _disposed; + + /// + /// Creates a new job + /// + /// (Optional) The name to associate + public WindowsJob(string? name = null) + { + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + throw new NotSupportedException("This is only supported on Windows platforms"); + } + + var securityAttributes = new SECURITY_ATTRIBUTES() + { + nLength = (uint)Marshal.SizeOf(typeof(SECURITY_ATTRIBUTES)), + lpSecurityDescriptor = IntPtr.Zero, + bInheritHandle = false + }; + + // Create the job handle + _jobHandle = CreateJobObject(ref securityAttributes, name); + if (_jobHandle == IntPtr.Zero) + { + throw new COMException("Failed to create job", Marshal.GetLastWin32Error()); + } + + // Set the job state so that all associated handles are closed + var extendedInfo = new JOBOBJECT_EXTENDED_LIMIT_INFORMATION() + { + BasicLimitInformation = new JOBOBJECT_BASIC_LIMIT_INFORMATION() + { + LimitFlags = JobObjectLimits.LIMIT_KILL_ON_JOB_CLOSE + } + }; + + int length = Marshal.SizeOf(typeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION)); + IntPtr ptr = IntPtr.Zero; + try + { + ptr = Marshal.AllocHGlobal(length); + Marshal.StructureToPtr(extendedInfo, ptr, false); + + bool success = SetInformationJobObject( + _jobHandle, + JOBOBJECTINFOCLASS.JobObjectExtendedLimitInformation, + ptr, + (uint)length); + + if (!success) + { + throw new COMException("Failed to set the job extended information", Marshal.GetLastWin32Error()); + } + } + finally + { + Marshal.FreeHGlobal(ptr); + } + } + + /// + /// Adds a process to the job + /// + /// The process to add + public void Add(Process process) + { + if (process == null) + { + throw new ArgumentNullException(nameof(process)); + } + else if (process.Handle == IntPtr.Zero) + { + throw new ArgumentException("The specified process has a NULL handle"); + } + + bool success = AssignProcessToJobObject(_jobHandle, process.Handle); + if (!success) + { + throw new COMException("Failed to add the process to the job", Marshal.GetLastWin32Error()); + } + } + + /// + /// Closes the job. This will close all linked processes + /// + public void Close() + { + CloseHandle(_jobHandle); + _jobHandle = IntPtr.Zero; + } + + /// + /// Disposes of the job. This will also close all linked process. + /// + public void Dispose() + { + if (Interlocked.Exchange(ref _disposed, 1) == 0) + { + Close(); + } + } + + #region native methods + + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + internal static extern IntPtr CreateJobObject([In] ref SECURITY_ATTRIBUTES lpJobAttributes, string? lpName); + + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + internal static extern IntPtr OpenJobObject(uint dwDesiredAccess, bool bInheritHandles, string lpName); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool AssignProcessToJobObject(IntPtr hJob, IntPtr hProcess); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool SetInformationJobObject( + [In] IntPtr hJob, + JOBOBJECTINFOCLASS JobObjectInfoClass, + [In] IntPtr lpJobObjectInfo, + uint cbJobObjectInfoLength); + + [DllImport("kernel32.dll", SetLastError = true)] +#if NETFRAMEWORK + [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] +#endif + [SuppressUnmanagedCodeSecurity] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool CloseHandle(IntPtr hObject); + +#endregion + + #region native types + + [StructLayout(LayoutKind.Sequential)] + internal struct SECURITY_ATTRIBUTES + { + public uint nLength; + public IntPtr lpSecurityDescriptor; + public bool bInheritHandle; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct JOBOBJECT_BASIC_LIMIT_INFORMATION + { + public Int64 PerProcessUserTimeLimit; + public Int64 PerJobUserTimeLimit; + public JobObjectLimits LimitFlags; + public UIntPtr MinimumWorkingSetSize; + public UIntPtr MaximumWorkingSetSize; + public UInt32 ActiveProcessLimit; + public UIntPtr Affinity; + public UInt32 PriorityClass; + public UInt32 SchedulingClass; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION + { + public JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation; + public IO_COUNTERS IoInfo; + public UIntPtr ProcessMemoryLimit; + public UIntPtr JobMemoryLimit; + public UIntPtr PeakProcessMemoryUsed; + public UIntPtr PeakJobMemoryUsed; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct IO_COUNTERS + { + public UInt64 ReadOperationCount; + public UInt64 WriteOperationCount; + public UInt64 OtherOperationCount; + public UInt64 ReadTransferCount; + public UInt64 WriteTransferCount; + public UInt64 OtherTransferCount; + } + + internal enum JOBOBJECTINFOCLASS + { + JobObjectExtendedLimitInformation = 9, + } + + internal enum JobObjectLimits : UInt32 + { + LIMIT_KILL_ON_JOB_CLOSE = 0x00002000, + } +} + +#endregion diff --git a/sdk/openai/tools/TestFramework/tests/AdaptersTests.cs b/sdk/openai/tools/TestFramework/tests/AdaptersTests.cs new file mode 100644 index 0000000000000..266d388a3537b --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/AdaptersTests.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.Diagnostics; +using NUnit.Framework; +using OpenAI.TestFramework.Adapters; +using OpenAI.TestFramework.Mocks; + +namespace OpenAI.TestFramework.Tests; + +[TestFixture] +public class AdaptersTests +{ + public CancellationToken Token => + new CancellationTokenSource(Debugger.IsAttached + ? TimeSpan.FromMinutes(15) + : TimeSpan.FromSeconds(5)) + .Token; + + [Test] + public async Task TestSyncToAsyncEnumerator() + { + const int start = 0; + const int num = 100; + + IEnumerator sync = Enumerable.Range(start, num).GetEnumerator(); + await using SyncToAsyncEnumerator async = new(sync, Token); + + for (int i = start; i < num; i++) + { + bool success = await async.MoveNextAsync(); + Assert.That(success, Is.True); + Assert.That(async.Current, Is.EqualTo(i)); + } + } + + [Test] + public async Task TestSyncToAsyncResultCollection() + { + const int start = 0; + const int num = 100; + + MockCollectionResult sync = new(() => Enumerable.Range(start, num)); + SyncToAsyncCollectionResult asyncAdapter = new(sync); + + await using var asyncEnumerator = asyncAdapter.GetAsyncEnumerator(Token); + + for (int i = start; i < num; i++) + { + bool success = await asyncEnumerator.MoveNextAsync(); + Assert.That(success, Is.True); + Assert.That(asyncEnumerator.Current, Is.EqualTo(i)); + } + } + + [Test] + public async Task TestFailedSyncToAsyncResultCollection() + { + MockCollectionResult sync = new(Fail); + SyncToAsyncCollectionResult asyncAdapter = new(sync); + + await using var asyncEnumerator = asyncAdapter.GetAsyncEnumerator(Token); + Assert.ThrowsAsync(() => asyncEnumerator.MoveNextAsync().AsTask()); + } + + [Test] + public async Task TestSyncToAsyncPageableCollection() + { + const int start = 0; + const int num = 100; + const int itemsPerPage = 10; + int expectedPages = (int)Math.Ceiling((double)num / itemsPerPage); + + MockPageCollection sync = new(() => Enumerable.Range(start, num), new MockPipelineResponse(), itemsPerPage); + SyncToAsyncPageCollection asyncAdapter = new(sync); + + int numPages = 0; + int expected = 0; + await foreach (var page in asyncAdapter) + { + numPages++; + foreach (int actual in page.Values) + { + Assert.That(actual, Is.EqualTo(expected)); + expected++; + } + } + + Assert.That(numPages, Is.EqualTo(expectedPages)); + } + + [Test] + public async Task TestFailedSyncToAsyncPageableCollection() + { + MockPageCollection sync = new(Fail, new MockPipelineResponse()); + SyncToAsyncPageCollection asyncAdapter = new(sync); + + await using var asyncEnumerator = ((IAsyncEnumerable>)asyncAdapter).GetAsyncEnumerator(Token); + Assert.ThrowsAsync(() => asyncEnumerator.MoveNextAsync().AsTask()); + } + + private static IEnumerable Fail() + { + throw new ApplicationException("This should fail"); + } +} diff --git a/sdk/openai/tools/TestFramework/tests/AutoSyncAsyncTests.cs b/sdk/openai/tools/TestFramework/tests/AutoSyncAsyncTests.cs new file mode 100644 index 0000000000000..44f13bee39f1f --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/AutoSyncAsyncTests.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using NUnit.Framework; +using OpenAI.TestFramework.Tests.Helpers; + +namespace OpenAI.TestFramework.Tests; + +public class AutoSyncAsyncTests(bool useAsync) : ClientTestBase(useAsync) +{ + private static readonly string EX_MSG = Guid.NewGuid().ToString(); + + [Test] + [SyncOnly] + public void OnlyInSyncMode() + { + Assert.That(IsAsync, Is.False); + } + + [Test] + [AsyncOnly] + public void OnlyInAsyncMode() + { + Assert.That(IsAsync, Is.True); + } + + [Test] + public void CanGetOriginal() + { + MockClient original = new MockClient(); + + MockClient instrumented = WrapClient(original); + Assert.That(instrumented, Is.Not.Null); + Assert.That(ReferenceEquals(original, instrumented), Is.False); + Assert.That(typeof(MockClient).IsAssignableFrom(instrumented.GetType()), Is.True); + + MockClient recovered = UnWrap(instrumented); + Assert.That(recovered, Is.Not.Null); + Assert.That(ReferenceEquals(original, recovered), Is.True); + } + + [Test] + public void CanGetContext() + { + var context = new MockClientContext(); + + MockClient client = WrapClient(new MockClient(), context); + Assert.That(client, Is.Not.Null); + + var recoveredContext = GetClientContext(client) as MockClientContext; + Assert.That(recoveredContext, Is.Not.Null); + Assert.That(recoveredContext!.Id, Is.EqualTo(context.Id)); + Assert.That(ReferenceEquals(recoveredContext, context), Is.True); + } + + [Test] + public async Task TaskWorks() + { + MockClient client = WrapClient(new MockClient()); + await client.DoAsync(); + AssertCorrectFunctionCalled(client); + } + + [Test] + public void FailedTaskWorks() + { + MockClient client = WrapClient(new MockClient()); + ArgumentException? ex = Assert.ThrowsAsync(() => client.FailAsync(EX_MSG)); + Assert.That(ex, Is.Not.Null); + Assert.That(ex!.Message, Is.EqualTo(EX_MSG)); + AssertCorrectFunctionCalled(client); + } + + [Test] + public async Task TaskWithResultWorks() + { + MockClient client = WrapClient(new MockClient()); + int count = await client.CountAsync(); + Assert.That(count, Is.EqualTo(IsAsync ? 12 : 5)); + AssertCorrectFunctionCalled(client); + } + + [Test] + public void FailedTaskWithResultWorks() + { + MockClient client = WrapClient(new MockClient()); + ArgumentException? ex = Assert.ThrowsAsync(() => client.FailWithResultAsync(EX_MSG)); + Assert.That(ex, Is.Not.Null); + Assert.That(ex!.Message, Is.EqualTo(EX_MSG)); + AssertCorrectFunctionCalled(client); + } + + [Test] + public async Task ResultCollectionWorks() + { + const int num = 3; + const int increment = 2; + + MockClient client = WrapClient(new MockClient()); + AsyncCollectionResult coll = client.ResultCollectionAsync(num, increment); + + Assert.IsNotNull(coll); + Assert.That(coll.GetRawResponse(), Is.Not.Null); + Assert.That(coll.GetRawResponse().Status, Is.EqualTo(200)); + Assert.That(coll.GetRawResponse().ReasonPhrase, Is.EqualTo("OK")); + + int numResults = 0; + await foreach (int i in coll) + { + Assert.That(i, Is.EqualTo(numResults * increment)); + numResults++; + } + + Assert.That(numResults, Is.EqualTo(num)); + AssertCorrectFunctionCalled(client); + } + + [Test] + public void FailedResultCollection() + { + MockClient client = WrapClient(new MockClient()); + + // For now we mimic how the OpenAI and Azure OpenAI libraries work in that no service requests are sent + // until we try to enumerate the async collections. So exceptions aren't expected initially + AsyncCollectionResult coll = client.FailResultCollectionAsync(EX_MSG); + Assert.That(coll, Is.Not.Null); + + IAsyncEnumerator enumerator = coll.GetAsyncEnumerator(); + Assert.That(enumerator, Is.Not.Null); + ArgumentException? ex = Assert.ThrowsAsync(() => enumerator.MoveNextAsync().AsTask()); + Assert.That(ex, Is.Not.Null); + Assert.That(ex!.Message, Is.EqualTo(EX_MSG)); + AssertCorrectFunctionCalled(client); + } + + [Test] + public async Task PageableCollectionWorks() + { + const int num = 50; + const int increment = 1; + const int itemsPerPage = 20; + int expectedPages = (int)Math.Ceiling((double)num / itemsPerPage); + + MockClient client = WrapClient(new MockClient()); + AsyncPageCollection coll = client.PageableCollectionAsync(num, increment, itemsPerPage); + Assert.IsNotNull(coll); + + int numPages = 0; + int numResults = 0; + await foreach(PageResult page in coll) + { + Assert.That(page.GetRawResponse(), Is.Not.Null); + Assert.That(page.GetRawResponse().Status, Is.EqualTo(200)); + Assert.That(page.GetRawResponse().ReasonPhrase, Is.EqualTo("OK")); + + numPages++; + foreach (int actual in page.Values) + { + Assert.That(actual, Is.EqualTo(numResults * increment)); + numResults++; + } + } + + Assert.That(numResults, Is.EqualTo(num)); + Assert.That(numPages, Is.EqualTo(expectedPages)); + AssertCorrectFunctionCalled(client); + } + + [Test] + public void FailedPageableCollection() + { + MockClient client = WrapClient(new MockClient()); + + // For now we mimic how the OpenAI and Azure OpenAI libraries work in that no service requests are sent + // until we try to enumerate the async collections. So exceptions aren't expected initially + AsyncPageCollection coll = client.FailPageableCollectionAsync(EX_MSG); + Assert.That(coll, Is.Not.Null); + + IAsyncEnumerator> enumerator = ((IAsyncEnumerable>)coll).GetAsyncEnumerator(); + Assert.That(enumerator, Is.Not.Null); + ArgumentException? ex = Assert.ThrowsAsync(() => enumerator.MoveNextAsync().AsTask()); + Assert.That(ex, Is.Not.Null); + Assert.That(ex!.Message, Is.EqualTo(EX_MSG)); + AssertCorrectFunctionCalled(client); + } + + private void AssertCorrectFunctionCalled(MockClient client, int expectedCalls = 1) + { + if (IsAsync) + { + Assert.That(client.AsyncHit, Is.EqualTo(expectedCalls)); + Assert.That(client.SyncHit, Is.EqualTo(0)); + } + else + { + Assert.That(client.AsyncHit, Is.EqualTo(0)); + Assert.That(client.SyncHit, Is.EqualTo(expectedCalls)); + } + } +} diff --git a/sdk/openai/tools/TestFramework/tests/Helpers/MockClient.cs b/sdk/openai/tools/TestFramework/tests/Helpers/MockClient.cs new file mode 100644 index 0000000000000..9eac6054d6f0d --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/Helpers/MockClient.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.Runtime.CompilerServices; +using OpenAI.TestFramework.Mocks; + +namespace OpenAI.TestFramework.Tests.Helpers; + +public class MockClient +{ + private int _asyncHit; + private int _syncHit; + + public virtual int AsyncHit => _asyncHit; + public virtual int SyncHit => _syncHit; + + public virtual Task DoAsync() + { + Interlocked.Increment(ref _asyncHit); + return Task.Delay(200); + } + + public virtual void Do() + { + Interlocked.Increment(ref _syncHit); + } + + public virtual Task FailAsync(string message) + { + Interlocked.Increment(ref _asyncHit); + return Task.FromException(new ArgumentException(message)); + } + + public virtual void Fail(string message) + { + Interlocked.Increment(ref _syncHit); + throw new ArgumentException(message); + } + + public virtual async Task CountAsync() + { + Interlocked.Increment(ref _asyncHit); + await Task.Delay(100).ConfigureAwait(false); + return 12; + } + + public virtual int Count() + { + Interlocked.Increment(ref _syncHit); + return 5; + } + + public virtual Task FailWithResultAsync(string message) + { + Interlocked.Increment(ref _asyncHit); + return Task.FromException(new ArgumentException(message)); + } + + public virtual int FailWithResult(string message) + { + Interlocked.Increment(ref _syncHit); + throw new ArgumentException(message); + } + + public virtual AsyncCollectionResult ResultCollectionAsync(int num, int increment = 5) + { + Interlocked.Increment(ref _asyncHit); + return new MockAsyncCollectionResult(() => EnumerateAsync(num, increment)); + } + + public virtual CollectionResult ResultCollection(int num, int increment = 5) + { + Interlocked.Increment(ref _syncHit); + return new MockCollectionResult(() => Enumerate(num, increment)); + } + + public virtual AsyncCollectionResult FailResultCollectionAsync(string message) + { + Interlocked.Increment(ref _asyncHit); + return new MockAsyncCollectionResult(() => FailEnumerateAsync(message)); + } + + public virtual CollectionResult FailResultCollection(string message) + { + Interlocked.Increment(ref _syncHit); + return new MockCollectionResult(() => FailEnumerate(message)); + } + + public virtual AsyncPageCollection PageableCollectionAsync(int num, int increment, int itemsPerPage) + { + Interlocked.Increment(ref _asyncHit); + return new MockAsyncPageCollection(() => EnumerateAsync(num, increment), new MockPipelineResponse(), itemsPerPage); + } + + public virtual PageCollection PageableCollection(int num, int increment, int itemsPerPage) + { + Interlocked.Increment(ref _syncHit); + return new MockPageCollection(() => Enumerate(num, increment), new MockPipelineResponse(), itemsPerPage); + } + + public virtual AsyncPageCollection FailPageableCollectionAsync(string message) + { + Interlocked.Increment(ref _asyncHit); + return new MockAsyncPageCollection(() => FailEnumerateAsync(message), new MockPipelineResponse()); + } + + public virtual PageCollection FailPageableCollection(string message) + { + Interlocked.Increment(ref _syncHit); + return new MockPageCollection(() => FailEnumerate(message), new MockPipelineResponse()); + } + + private async IAsyncEnumerable EnumerateAsync(int num, int increment, [EnumeratorCancellation] CancellationToken token = default) + { + int running = 0; + for (int i = 0; i < num; i++, running += increment) + { + await Task.Delay(100); + yield return running; + } + } + + private IEnumerable Enumerate(int num, int increment) + { + int running = 0; + for (int i = 0; i < num; i++, running += increment) + { + yield return running; + } + } + + private async IAsyncEnumerable FailEnumerateAsync(string message, [EnumeratorCancellation] CancellationToken token = default) + { + bool c = true; + await Task.Delay(100).ConfigureAwait(false); + if (c) + { + throw new ArgumentException(message); + } + + yield break; + } + + private IEnumerable FailEnumerate(string message) + { + throw new ArgumentException(message); + } +} diff --git a/sdk/openai/tools/TestFramework/tests/Helpers/MockClientContext.cs b/sdk/openai/tools/TestFramework/tests/Helpers/MockClientContext.cs new file mode 100644 index 0000000000000..e36ed1e1f458b --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/Helpers/MockClientContext.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Tests.Helpers; + +public class MockClientContext +{ + public string Id { get; } = Guid.NewGuid().ToString(); +} diff --git a/sdk/openai/tools/TestFramework/tests/MockStringServiceTests.cs b/sdk/openai/tools/TestFramework/tests/MockStringServiceTests.cs new file mode 100644 index 0000000000000..d5d3edff45f01 --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/MockStringServiceTests.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Reflection; +using NUnit.Framework; +using OpenAI.TestFramework.Mocks; +using OpenAI.TestFramework.Recording.Proxy; +using OpenAI.TestFramework.Recording.Proxy.Service; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Tests; + +public class MockStringServiceTests : RecordedClientTestBase +{ + private const string c_basePath = "data"; + + public MockStringServiceTests(bool isAsync) + : base(isAsync, null) + { + RecordingOptions.SanitizersToRemove.Add("AZSDK3430"); // $..id + } + + public DirectoryInfo RepositoryRoot { get; } = FindRepoRoot(); + + [Test] + public async Task AddAndGet() + { + const string id = "first.one"; + const string expected = "The first value goes here"; + + using MockRestService service = new(c_basePath); + var options = ConfigureClientOptions(new ClientPipelineOptions()); + using var client = WrapClient(new MockRestServiceClient(service.HttpEndpoint, options)); + + ClientResult add = await client.AddAsync(id, expected, Token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + + string? retrieved = await client.GetAsync("first.one", Token); + Assert.That(retrieved, Is.EqualTo(expected)); + } + + [Test] + public async Task AddAndDelete() + { + const string id = "first.one"; + const string expected = "The first value goes here"; + + using MockRestService service = new(c_basePath); + var options = ConfigureClientOptions(new ClientPipelineOptions()); + using var client = WrapClient(new MockRestServiceClient(service.HttpEndpoint, options)); + + ClientResult add = await client.AddAsync(id, expected, Token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + + bool deleted = await client.RemoveAsync(id, Token); + Assert.That(deleted, Is.True); + + string? retrieved = await client.GetAsync("first.one", Token); + Assert.That(retrieved, Is.Null); + } + + #region overrides + + protected override ProxyServiceOptions CreateProxyServiceOptions() + => new() + { + DotnetExecutable = AssemblyHelper.GetDotnetExecutable()?.FullName!, + TestProxyDll = AssemblyHelper.GetAssemblyMetadata("TestProxyPath")!, + DevCertFile = Path.Combine( + RepositoryRoot.FullName, + "eng", + "common", + "testproxy", + "dotnet-devcert.pfx"), + DevCertPassword = "password", + StorageLocationDir = RepositoryRoot.FullName, + }; + + protected override RecordingStartInformation CreateRecordingSessionStartInfo() + => new() + { + RecordingFile = GetRecordingFile(), + AssetsFile = GetAssetsFile() + }; + + #endregion + + #region helper methods + + private static DirectoryInfo FindRepoRoot() + { + /** + * This code assumes that we are running in the standard Azure .Net SDK repository layout. With this in mind, + * we generally assume that we are running our test code from + * /artifacts/bin/// + * So to find the root we keep navigating up until we find a folder with a .git subfolder + * + * Another alternative would be to call: git rev-parse --show-toplevel + */ + + DirectoryInfo? current = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory; + while (current != null && !current.EnumerateDirectories(".git").Any()) + { + current = current.Parent; + } + + return current + ?? throw new InvalidOperationException("Could not determine the root folder for this repository"); + } + + private string GetRecordingFile() + { + DirectoryInfo sourceDir = AssemblyHelper.GetAssemblySourceDir() + ?? throw new InvalidOperationException("Could not determine the source path for this assembly"); + string relativeDir = PathHelpers.GetRelativePath(RepositoryRoot.FullName, sourceDir.FullName); + return Path.Combine( + relativeDir, + "SessionRecords", + GetType().Name, + GetRecordedTestFileName()); + } + + private string? GetAssetsFile() + { + DirectoryInfo? sourceDir = AssemblyHelper.GetAssemblySourceDir() + ?? throw new InvalidOperationException("Could not determine the source path for this assembly"); + + // walk up the tree until we hit either the repository root, or found a folder with an "assets.json" file + for (; sourceDir != null && sourceDir?.FullName != RepositoryRoot.FullName; sourceDir = sourceDir.Parent) + { + string assetsFile = Path.Combine(sourceDir!.FullName, "assets.json"); + if (File.Exists(assetsFile)) + { + return assetsFile; + } + } + + return null; + } + + #endregion +} diff --git a/sdk/openai/tools/TestFramework/tests/OpenAI.TestFramework.Tests.csproj b/sdk/openai/tools/TestFramework/tests/OpenAI.TestFramework.Tests.csproj new file mode 100644 index 0000000000000..e6934e2923ce4 --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/OpenAI.TestFramework.Tests.csproj @@ -0,0 +1,21 @@ + + + + $(RequiredTargetFrameworks);net8.0 + enable + enable + latest + + + + + + + + + + + + + + diff --git a/sdk/openai/tools/TestFramework/tests/ProxyServiceTests.cs b/sdk/openai/tools/TestFramework/tests/ProxyServiceTests.cs new file mode 100644 index 0000000000000..496afbc6dc501 --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/ProxyServiceTests.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; +using NUnit.Framework; +using OpenAI.TestFramework.Mocks; +using OpenAI.TestFramework.Recording; +using OpenAI.TestFramework.Recording.Matchers; +using OpenAI.TestFramework.Recording.Proxy; +using OpenAI.TestFramework.Recording.Proxy.Service; +using OpenAI.TestFramework.Recording.RecordingProxy; +using OpenAI.TestFramework.Recording.Sanitizers; +using OpenAI.TestFramework.Recording.Transforms; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Tests +{ + [NonParallelizable] + public class ProxyServiceTests(bool isAsync) : ClientTestBase(isAsync) + { + #region Properties and setup/teardown methods + + public DirectoryInfo? RecordingDir { get; private set; } + + public FileInfo? RecordingFile { get; private set; } + + [SetUp] + public void CreateRecordingFile() + { + RecordingDir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), "RecordingTests", Guid.NewGuid().ToString())); + if (!RecordingDir.Exists) + { + RecordingDir.Create(); + } + + RecordingFile = new FileInfo(Path.Combine(RecordingDir.FullName, Path.GetRandomFileName() + ".json")); + } + + [TearDown] + public void DeleteRecordingFile() + { + if (RecordingFile != null) + { + RecordingFile.Delete(); + } + + if (RecordingDir != null) + { + RecordingDir.Delete(true); + } + } + + #endregion + + [Test] + public async Task StartProxy() + { + using ProxyService proxy = await CreateProxyServiceAsync(); + + Assert.That(proxy.HttpEndpoint, Is.Not.Null); + Assert.That(proxy.HttpEndpoint.Port, Is.GreaterThan(0).And.LessThanOrEqualTo(ushort.MaxValue)); + Assert.That(proxy.HttpsEndpoint, Is.Not.Null); + Assert.That(proxy.HttpsEndpoint.Port, Is.GreaterThan(0).And.LessThanOrEqualTo(ushort.MaxValue)); + + ProxyClientResult available = await proxy.Client.ListAvailableAsync(Token); + Assert.That(available, Is.Not.Null); + Assert.That(available.GetRawResponse(), Is.Not.Null); + Assert.That(available.GetRawResponse().Status, Is.EqualTo(200)); + Assert.That(available.Value, Is.Not.Null); + Assert.That(available.Value, Does.Contain("BodilessMatcher")); + } + + [Test] + public async Task AddSanitizers() + { + using ProxyService proxy = await CreateProxyServiceAsync(); + + List sanitizers = + [ + new BodyKeySanitizer("body.key"), + new BodyRegexSanitizer("(.*)") + { + GroupForReplace = "1", + Condition = new Recording.Condition() + { + ResponseHeader = new() + { + Key = "Content-Type", + ValueRegex = "json$" + }, + UriRegex = "https://[^/]+/sub" + } + }, + new HeaderRegexSanitizer("Authentication") + { + Value = "replacement", + GroupForReplace = "1", + Regex = "^Bearer " + }, + new UriRegexSanitizer("https://[^/]+/sub") + { + GroupForReplace = "1", + Value = "replacement" + } + ]; + + ProxyClientResult> result = await proxy.Client.AddSanitizersAsync(sanitizers, token: Token); + Assert.That(result, Is.Not.Null); + Assert.That(result.GetRawResponse(), Is.Not.Null); + Assert.That(result.GetRawResponse().Status, Is.EqualTo(200)); + Assert.That(result.Value, Is.Not.Null); + Assert.That(result.Value, Has.Count.EqualTo(sanitizers.Count)); + } + + [Test] + public async Task SetMatcher() + { + using ProxyService proxy = await CreateProxyServiceAsync(); + + BaseMatcher[] matchers = + [ + ExistingMatcher.Headerless, + ExistingMatcher.Bodiless, + new CustomMatcher() + { + CompareBodies = false, + ExcludedHeaders = "Authorization", + IgnoredHeaders = "Content-Length,Content-Type", + IgnoredQueryParameters = "page,version", + IgnoreQueryOrdering = true, + } + ]; + + foreach (var matcher in matchers) + { + ProxyClientResult result = await proxy.Client.SetMatcherAsync(matcher, token: Token); + Assert.That(result, Is.Not.Null); + Assert.That(result.GetRawResponse(), Is.Not.Null); + Assert.That(result.GetRawResponse().Status, Is.EqualTo(200)); + } + } + + [Test] + public async Task SetTransform() + { + using ProxyService proxy = await CreateProxyServiceAsync(); + + HeaderTransform transform = new("X-Client-RequestId") + { + Value = "replacement", + Condition = new() + { + UriRegex = "http.*://[^/]+/(.*)" + } + }; + + ProxyClientResult result = await proxy.Client.AddTransformAsync(transform, token: Token); + Assert.That(result, Is.Not.Null); + Assert.That(result.GetRawResponse(), Is.Not.Null); + Assert.That(result.GetRawResponse().Status, Is.EqualTo(200)); + } + + [Test] + public async Task StartStopRecording() + { + const string key1 = "key1"; + string value1 = Guid.NewGuid().ToString(); + const string key2 = "the.others"; + string value2 = "value"; + + using ProxyService proxy = await CreateProxyServiceAsync(); + + RecordingStartInformation startInfo = new() + { + RecordingFile = RecordingFile!.FullName, + }; + + ProxyClientResult result = await proxy.Client.StartRecordingAsync(startInfo, token: Token); + Assert.That(result, Is.Not.Null); + Assert.That(result.GetRawResponse(), Is.Not.Null); + Assert.That(result.GetRawResponse().Status, Is.EqualTo(200)); + + string recordingId = result.RecordingId!; + Assert.That(recordingId, Is.Not.Null); + + Dictionary additional = new() + { + [key1] = value1, + [key2] = value2, + }; + + result = await proxy.Client.StopRecordingAsync(recordingId, additional, false, Token); + + // At this point we should have a recording file + string recordedJson = File.ReadAllText(RecordingFile.FullName); + Assert.That(recordedJson, Does.Contain(key1) + .And.Contain(value1) + .And.Contain(key2) + .And.Contain(value2)); + } + + [Test] + public async Task RecordAndPlayback() + { + using ProxyService recordingProxyService = await CreateProxyServiceAsync(); + RecordingStartInformation startInfo = new() { RecordingFile = RecordingFile!.FullName }; + + using MockRestService mockRestService = new(); + TestRecordingOptions recordingOptions = new() + { + SanitizersToRemove = + { + "AZSDK3430", // $..id + } + }; + + string id1; + string id2; + + // Start recording, and capture some requests + { + ProxyClientResult result = await recordingProxyService.Client.StartRecordingAsync(startInfo, Token); + Assert.That(result, Is.Not.Null); + Assert.That(result.RecordingId, !Is.Null.Or.Empty); + string recordingId = result.RecordingId!; + + await using TestRecording recording = new(recordingId, RecordedTestMode.Record, recordingProxyService); + await recording.ApplyOptions(recordingOptions, Token); + + id1 = recording.Random.NewGuid().ToString(); + id2 = recording.Random.NewGuid().ToString(); + + await SendRequestsAsync(recording, mockRestService.HttpEndpoint, id1, id2, Token); + } + + // validate the service has what we expect + var serviceIds = mockRestService.GetAll() + .Select(e => e.id) + .ToArray(); + Assert.That(serviceIds, Is.EquivalentTo(new[] { id1, id2 })); + + mockRestService.Reset(); + + // Playback the recording + { + ProxyClientResult> result = await recordingProxyService.Client.StartPlaybackAsync(startInfo, Token); + Assert.That(result, Is.Not.Null); + Assert.That(result.RecordingId, !Is.Null.Or.Empty); + string recordingId = result.RecordingId!; + + await using TestRecording playback = new(recordingId, RecordedTestMode.Playback, recordingProxyService, result.Value); + await playback.ApplyOptions(recordingOptions, Token); + + string id = playback.Random.NewGuid().ToString(); + Assert.That(id, Is.EqualTo(id1)); + id = playback.Random.NewGuid().ToString(); + Assert.That(id, Is.EqualTo(id2)); + + await SendRequestsAsync(playback, mockRestService.HttpEndpoint, id1, id2, Token); + } + + // since we are playing back, the service should not have been called + Assert.That(mockRestService.GetAll().Count(), Is.EqualTo(0)); + + static async Task SendRequestsAsync(TestRecording recording, Uri restEndpoint, string id1, string id2, CancellationToken token) + { + const string value1 = "The value for the first item"; + const string value2 = "The secondary value goes here"; + const string id3 = "random"; + const string value3 = "Sure why not"; + + ClientPipelineOptions options = new(); + options.RetryPolicy = new TestClientRetryPolicy(0, TimeSpan.FromMilliseconds(100)); + options.Transport = new ProxyTransport(recording.GetProxyTransportOptions()); + + using MockRestServiceClient client = new(restEndpoint, options); + + ClientResult add = await client.AddAsync(id1, value1, token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + + add = await client.AddAsync(id2, value2, token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + + add = await client.AddAsync(id3, value3, token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + + ClientResult get = await client.GetAsync(id2, token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + Assert.That(get.Value, Is.EqualTo(value2)); + + get = await client.GetAsync(id3, token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + Assert.That(get.Value, Is.EqualTo(value3)); + + ClientResult remove = await client.RemoveAsync(id3, token); + Assert.That(remove.Value, Is.True); + + remove = await client.RemoveAsync("does.not.exist", token); + Assert.That(remove.Value, Is.False); + + get = await client.GetAsync(id3, token); + Assert.That(get, Is.Not.Null); + Assert.That(get.GetRawResponse().Status, Is.EqualTo(404)); + Assert.That(get.Value, Is.Null); + } + } + + #region helper methods + + private async Task CreateProxyServiceAsync() + { + ProxyService? proxy = null; + try + { + proxy = await ProxyService.CreateNewAsync( + new ProxyServiceOptions() + { + DotnetExecutable = AssemblyHelper.GetDotnetExecutable()?.FullName!, + TestProxyDll = AssemblyHelper.GetAssemblyMetadata("TestProxyPath")!, + StorageLocationDir = RecordingDir!.FullName + }, + Token); + + Assert.That(proxy, Is.Not.Null); + Assert.DoesNotThrow(proxy.ThrowOnErrors); + Assert.That(proxy.Client, Is.Not.Null); + + var wrappedClient = WrapClient(proxy.Client); + var setter = typeof(ProxyService).GetMethod("SetClient", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance) + ?? throw new InvalidOperationException("Could not find the ProxyService.SetClient method"); + setter.Invoke(proxy, [wrappedClient]); + + var ret = proxy; + proxy = null; + return ret; + } + finally + { + proxy?.Dispose(); + } + } + + #endregion + } +} From 517e7594c757753e66cbfa1c4cb4f92bbe5cc9fa Mon Sep 17 00:00:00 2001 From: Ralph <18542438+ralph-msft@users.noreply.github.com> Date: Mon, 26 Aug 2024 19:30:49 -0700 Subject: [PATCH 31/71] Migrate Azure OpenAI tests to use the streamlined test framework (#45680) - Uses `OpenAI.TestFramework` which is built on top of `System.ClientModel`, instead of `Azure.Core.TestFramework` which is built on top of `Azure.Core` - Nullable is now enabled at the project level for the test code, and the necessary updates have been made --- .../Azure.AI.OpenAI/Azure.AI.OpenAI.sln | 10 +- .../Azure.AI.OpenAI/tests/AssistantTests.cs | 55 +-- .../Azure.AI.OpenAI/tests/AudioTests.cs | 12 +- .../tests/Azure.AI.OpenAI.Tests.csproj | 3 +- .../Azure.AI.OpenAI/tests/BatchTests.cs | 23 +- .../tests/ChatTests.Functions.cs | 24 +- .../Azure.AI.OpenAI/tests/ChatTests.Tools.cs | 30 +- .../Azure.AI.OpenAI/tests/ChatTests.Vision.cs | 11 +- sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs | 63 ++-- .../Azure.AI.OpenAI/tests/EmbeddingTests.cs | 2 +- sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs | 4 +- .../Azure.AI.OpenAI/tests/FineTuningTests.cs | 11 +- .../Azure.AI.OpenAI/tests/ImageTests.cs | 12 +- .../tests/Models/AzureDeploymentClient.cs | 15 +- .../tests/Models/BatchObject.cs | 4 +- .../tests/Models/BatchOptions.cs | 5 +- .../tests/Models/BatchResult.cs | 4 +- .../tests/Models/FineTuningOptions.cs | 5 +- .../tests/Samples/00_ClientConfiguration.cs | 7 - .../Azure.AI.OpenAI/tests/Samples/01_Chat.cs | 5 - .../Azure.AI.OpenAI/tests/Samples/02_Oyd.cs | 9 - .../tests/Utils/AoaiTestBase.cs | 314 +++++++++--------- .../tests/Utils/AoaiTestEnvironment.cs | 25 -- .../Azure.AI.OpenAI/tests/Utils/Assets.cs | 31 +- .../tests/Utils/AzureTestEnvironment.cs | 230 +++++++++++++ .../tests/Utils/Config/FlattenedConfig.cs | 3 +- .../tests/Utils/Config/IConfiguration.cs | 33 +- .../tests/Utils/Config/JsonConfig.cs | 7 +- .../tests/Utils/Config/SanitizedJsonConfig.cs | 3 +- .../Utils/DisableRecordingInterceptor.cs | 77 ----- .../Azure.AI.OpenAI/tests/Utils/Extensions.cs | 183 +++------- .../Utils/{JsonHelpers.cs => JsonOptions.cs} | 82 +---- .../tests/Utils/MockTokenCredential.cs | 33 ++ .../tests/Utils/Pipeline/CapturedMessage.cs | 33 -- .../Pipeline/ClientRetryPolicyAdapter.cs | 62 ---- .../tests/Utils/Pipeline/MockPipeline.cs | 245 -------------- .../tests/Utils/Pipeline/ProxyTransport.cs | 254 -------------- .../Utils/SyncToAsyncCollectionResult.cs | 88 ----- .../tests/Utils/SyncToAsyncEnumerator.cs | 73 ---- .../tests/Utils/SyncToAsyncPageCollection.cs | 73 ---- .../Azure.AI.OpenAI/tests/Utils/TestConfig.cs | 6 +- .../tests/Utils/TestPipelinePolicy.cs | 35 -- .../Azure.AI.OpenAI/tests/VectorStoreTests.cs | 18 +- .../TestFramework/src/Utils/Extensions.cs | 18 + 44 files changed, 647 insertions(+), 1593 deletions(-) delete mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestEnvironment.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/AzureTestEnvironment.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/DisableRecordingInterceptor.cs rename sdk/openai/Azure.AI.OpenAI/tests/Utils/{JsonHelpers.cs => JsonOptions.cs} (67%) create mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/MockTokenCredential.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/CapturedMessage.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ClientRetryPolicyAdapter.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/MockPipeline.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ProxyTransport.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncCollectionResult.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncEnumerator.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageCollection.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Utils/TestPipelinePolicy.cs diff --git a/sdk/openai/Azure.AI.OpenAI/Azure.AI.OpenAI.sln b/sdk/openai/Azure.AI.OpenAI/Azure.AI.OpenAI.sln index a3254137c6dad..61c110a928cd8 100644 --- a/sdk/openai/Azure.AI.OpenAI/Azure.AI.OpenAI.sln +++ b/sdk/openai/Azure.AI.OpenAI/Azure.AI.OpenAI.sln @@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.AI.OpenAI", "src\Azur EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.AI.OpenAI.Tests", "tests\Azure.AI.OpenAI.Tests.csproj", "{4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{439F1494-8E96-4931-AB0A-5BBA7EBA15D2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenAI.TestFramework", "..\tools\TestFramework\src\OpenAI.TestFramework.csproj", "{2D90AB0E-E458-4B28-97F7-33A70136EA2B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,10 +23,10 @@ Global {4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}.Debug|Any CPU.Build.0 = Debug|Any CPU {4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}.Release|Any CPU.ActiveCfg = Release|Any CPU {4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}.Release|Any CPU.Build.0 = Release|Any CPU - {439F1494-8E96-4931-AB0A-5BBA7EBA15D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {439F1494-8E96-4931-AB0A-5BBA7EBA15D2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {439F1494-8E96-4931-AB0A-5BBA7EBA15D2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {439F1494-8E96-4931-AB0A-5BBA7EBA15D2}.Release|Any CPU.Build.0 = Release|Any CPU + {2D90AB0E-E458-4B28-97F7-33A70136EA2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D90AB0E-E458-4B28-97F7-33A70136EA2B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D90AB0E-E458-4B28-97F7-33A70136EA2B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D90AB0E-E458-4B28-97F7-33A70136EA2B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs index 409d311c9dbd4..209beccedb8ad 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs @@ -11,10 +11,11 @@ using System.Text; using System.Threading.Tasks; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.Core.TestFramework; using OpenAI; using OpenAI.Assistants; using OpenAI.Files; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Utils; using OpenAI.VectorStores; namespace Azure.AI.OpenAI.Tests; @@ -79,8 +80,7 @@ public async Task BasicAssistantOperationsWork() }, }); Assert.That(modifiedAssistant.Id, Is.EqualTo(assistant.Id)); - AsyncPageCollection recentAssistants = SyncOrAsync( - client, c => c.GetAssistants(), c => c.GetAssistantsAsync()); + AsyncPageCollection recentAssistants = client.GetAssistantsAsync(); Assistant recentAssistant = null; await foreach (Assistant asyncAssistant in recentAssistants.GetAllValuesAsync()) { @@ -173,9 +173,7 @@ public async Task StreamingToolCall() { InitialMessages = { new(MessageRole.User, ["What should I wear outside right now?"]), }, }; - AsyncCollectionResult asyncResults = SyncOrAsync(client, - c => c.CreateThreadAndRunStreaming(assistant, thrdOpt), - c => c.CreateThreadAndRunStreamingAsync(assistant, thrdOpt)); + AsyncCollectionResult asyncResults = client.CreateThreadAndRunStreamingAsync(assistant, thrdOpt); Print(" >>> Starting enumeration ..."); @@ -209,9 +207,7 @@ public async Task StreamingToolCall() } if (toolOutputs.Count > 0) { - asyncResults = SyncOrAsync(client, - c => c.SubmitToolOutputsToRunStreaming(run, toolOutputs), - c => c.SubmitToolOutputsToRunStreamingAsync(run, toolOutputs)); + asyncResults = client.SubmitToolOutputsToRunStreamingAsync(run, toolOutputs); } } while (run?.Status.IsTerminal == false); } @@ -260,9 +256,7 @@ public async Task BasicMessageOperationsWork() }); Assert.That(message.Metadata.TryGetValue("messageMetadata", out metadataValue) && metadataValue == "newValue"); - var messagePage = await SyncOrAsyncList(client, - c => c.GetMessages(thread), - c => c.GetMessagesAsync(thread)); + var messagePage = await client.GetMessagesAsync(thread).ToListAsync(); if (aoaiDeleteBugFixed) { Assert.That(messagePage.Count, Is.EqualTo(1)); @@ -299,9 +293,7 @@ public async Task ThreadWithInitialMessagesWorks() }; AssistantThread thread = await client.CreateThreadAsync(options); Validate(thread); - List messageList = await SyncOrAsyncList(client, - c => c.GetMessages(thread, new() { Order = ListOrder.OldestFirst }), - c => c.GetMessagesAsync(thread, new() { Order = ListOrder.OldestFirst })); + List messageList = await client.GetMessagesAsync(thread, new() { Order = ListOrder.OldestFirst }).ToListAsync(); Assert.That(messageList.Count, Is.EqualTo(2)); Assert.That(messageList[0].Role, Is.EqualTo(MessageRole.User)); Assert.That(messageList[0].Content?.Count, Is.EqualTo(1)); @@ -319,9 +311,7 @@ public async Task BasicRunOperationsWork() Validate(assistant); AssistantThread thread = await client.CreateThreadAsync(); Validate(thread); - List runPage = await SyncOrAsyncList(client, - c => c.GetRuns(thread.Id), - c => c.GetRunsAsync(thread.Id)); + List runPage = await client.GetRunsAsync(thread.Id).ToListAsync(); Assert.That(runPage.Count, Is.EqualTo(0)); ThreadMessage message = await client.CreateMessageAsync(thread.Id, MessageRole.User, ["Hello, assistant!"]); Validate(message); @@ -331,15 +321,11 @@ public async Task BasicRunOperationsWork() Assert.That(run.CreatedAt, Is.GreaterThan(s_2024)); ThreadRun retrievedRun = await client.GetRunAsync(thread.Id, run.Id); Assert.That(retrievedRun.Id, Is.EqualTo(run.Id)); - runPage = await SyncOrAsyncList(client, - c => c.GetRuns(thread.Id), - c => c.GetRunsAsync(thread.Id)); + runPage = await client.GetRunsAsync(thread.Id).ToListAsync(); Assert.That(runPage.Count, Is.EqualTo(1)); Assert.That(runPage.ElementAt(0).Id, Is.EqualTo(run.Id)); - List messages = await SyncOrAsyncList(client, - c => c.GetMessages(thread), - c => c.GetMessagesAsync(thread)); + List messages = await client.GetMessagesAsync(thread).ToListAsync(); Assert.That(messages.Count, Is.GreaterThanOrEqualTo(1)); run = await WaitUntilReturnLast( @@ -357,9 +343,7 @@ public async Task BasicRunOperationsWork() Assert.That(run.FailedAt, Is.Null); Assert.That(run.IncompleteDetails, Is.Null); }); - messages = await SyncOrAsyncList(client, - c => c.GetMessages(thread), - c => c.GetMessagesAsync(thread)); + messages = await client.GetMessagesAsync(thread).ToListAsync(); Assert.That(messages.Count, Is.EqualTo(2)); Assert.That(messages.ElementAt(0).Role, Is.EqualTo(MessageRole.Assistant)); @@ -395,9 +379,7 @@ public async Task BasicRunStepFunctionalityWorks() Assert.That(run.Status, Is.EqualTo(RunStatus.Completed)); Assert.That(run.Usage?.TotalTokens, Is.GreaterThan(0)); - List runSteps = await SyncOrAsyncList(client, - c => c.GetRunSteps(run), - c => c.GetRunStepsAsync(run)); + List runSteps = await client.GetRunStepsAsync(run).ToListAsync(); Assert.That(runSteps.Count(), Is.GreaterThan(1)); Assert.Multiple(() => { @@ -492,9 +474,8 @@ public async Task FunctionToolsWork() r => r.Status.IsTerminal); Assert.That(run.Status, Is.EqualTo(RunStatus.Completed)); - List messages = await SyncOrAsyncList(client, - c => c.GetMessages(run.ThreadId, new() { Order = ListOrder.NewestFirst }), - c => c.GetMessagesAsync(run.ThreadId, new() { Order = ListOrder.NewestFirst })); + List messages = await client.GetMessagesAsync(run.ThreadId, new() { Order = ListOrder.NewestFirst }) + .ToListAsync(); Assert.That(messages.Count, Is.GreaterThan(1)); Assert.That(messages.ElementAt(0).Role, Is.EqualTo(MessageRole.Assistant)); Assert.That(messages.ElementAt(0).Content?[0], Is.Not.Null); @@ -597,9 +578,7 @@ This file describes the favorite foods of several people. r => r.Status.IsTerminal); Assert.That(run.Status, Is.EqualTo(RunStatus.Completed)); - AsyncPageCollection messages = SyncOrAsync(client, - c => c.GetMessages(thread, new() { Order = ListOrder.NewestFirst }), - c => c.GetMessagesAsync(thread, new() { Order = ListOrder.NewestFirst })); + AsyncPageCollection messages = client.GetMessagesAsync(thread, new() { Order = ListOrder.NewestFirst }); bool hasAtLeastOne = false; bool hasCake = false; await foreach (ThreadMessage message in messages.GetAllValuesAsync()) @@ -633,9 +612,7 @@ public async Task StreamingRunWorks() }); Validate(thread); - AsyncCollectionResult streamingResult = SyncOrAsync(client, - c => c.CreateRunStreaming(thread.Id, assistant.Id), - c => c.CreateRunStreamingAsync(thread.Id, assistant.Id)); + AsyncCollectionResult streamingResult = client.CreateRunStreamingAsync(thread.Id, assistant.Id); StringBuilder content = new(); DateTimeOffset? lastUpdate = null; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs index e968a879a3f61..12640a4f968a1 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs @@ -1,26 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.ClientModel; using System.ClientModel.Primitives; using System.IO; using System.Threading.Tasks; -using Azure.Core.TestFramework; using OpenAI.Audio; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests; -public class AudioTests : AoaiTestBase +public class AudioTests(bool isAsync) : AoaiTestBase(isAsync) { - public AudioTests(bool isAsync) : base(isAsync) - { - DisableRequestBodyRecording(nameof(AudioClient.TranscribeAudioAsync)); - DisableRequestBodyRecording(nameof(AudioClient.TranslateAudioAsync)); - } - [Test] [Category("Smoke")] public void CanCreateClient() => Assert.That(GetTestClient(), Is.InstanceOf()); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj b/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj index ca24c8445771d..fc2b869f8b415 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj +++ b/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj @@ -6,6 +6,7 @@ $(NoWarn);CS1591;CS8002;SA1402;SA1507;SA1508;SA1633;SA1028;SA1505;OPENAI001;AOAI001 preview + enable @@ -20,7 +21,7 @@ - + diff --git a/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs index 4bd58e716ffb0..357c022d1c1ea 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.ClientModel; using System.ClientModel.Primitives; @@ -15,12 +13,13 @@ using Azure.AI.OpenAI.Tests.Models; using Azure.AI.OpenAI.Tests.Utils; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.AI.OpenAI.Tests.Utils.Pipeline; -using Azure.Core.TestFramework; using OpenAI.Batch; using OpenAI.Chat; using OpenAI.Embeddings; using OpenAI.Files; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Mocks; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests; @@ -93,7 +92,7 @@ private BinaryData ValidateHasRawJsonResponse(ClientResult result) PipelineResponse response = result.GetRawResponse(); Assert.That(response, Is.Not.Null); Assert.That(response.Status, Is.GreaterThanOrEqualTo(200).And.LessThan(300)); - Assert.That(response.Headers.GetFirstValueOrDefault("Content-Type"), Does.StartWith("application/json")); + Assert.That(response.Headers.GetFirstOrDefault("Content-Type"), Does.StartWith("application/json")); return response.Content; } @@ -120,15 +119,15 @@ private BatchObject ExtractAndValidateBatchObj(ClientResult result) private class BatchOperations : IAsyncDisposable { - private MockPipeline _pipeline; + private MockHttpMessageHandler _handler; private List _operations; private string? _uploadId; private FileClient _fileClient; public BatchOperations(AoaiTestBase testBase, BatchClient batchClient) { - _pipeline = new MockPipeline(MockPipeline.ReturnEmptyJson); - _pipeline.OnRequest += HandleRequest; + _handler = new(MockHttpMessageHandler.ReturnEmptyJson); + _handler.OnRequest += HandleRequest; _operations = new(); BatchFileName = "batch-" + Guid.NewGuid().ToString("D") + ".json"; @@ -139,7 +138,7 @@ public BatchOperations(AoaiTestBase testBase, BatchClient batchClie AzureOpenAIClient fakeTopLevel = new AzureOpenAIClient( new Uri("https://not.a.real.endpoint.fake"), new ApiKeyCredential("not.a.real.key"), - new() { Transport = _pipeline.Transport }); + new() { Transport = _handler.Transport }); ChatClient = fakeTopLevel.GetChatClient(testBase.TestConfig.GetConfig().DeploymentOrThrow("chat client")); EmbeddingClient = fakeTopLevel.GetEmbeddingClient(testBase.TestConfig.GetConfig().DeploymentOrThrow("embedding client")); @@ -158,7 +157,7 @@ public async Task UploadBatchFileAsync() } using MemoryStream stream = new MemoryStream(); - JsonHelpers.Serialize(stream, _operations, JsonHelpers.OpenAIJsonOptions); + JsonHelpers.Serialize(stream, _operations, JsonOptions.OpenAIJsonOptions); stream.Seek(0, SeekOrigin.Begin); var data = BinaryData.FromStream(stream); @@ -186,8 +185,8 @@ public async ValueTask DisposeAsync() await _fileClient.DeleteFileAsync(_uploadId); } - _pipeline.OnRequest -= HandleRequest; - _pipeline.Dispose(); + _handler.OnRequest -= HandleRequest; + _handler.Dispose(); _operations.Clear(); } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Functions.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Functions.cs index acbc2223a879b..ebe881c6acef1 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Functions.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Functions.cs @@ -1,13 +1,15 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text; using System.Text.Json; using System.Threading.Tasks; -using Azure.AI.OpenAI.Chat; -using Azure.Core.TestFramework; using OpenAI.Chat; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests; @@ -113,7 +115,8 @@ public async Task SimpleFunctionCallWorks(FunctionCallTestType functionCallType) Assert.That(completion.FunctionCall, Is.Not.Null); Assert.That(completion.FunctionCall.FunctionName, Is.EqualTo(FUNCTION_TEMPERATURE.FunctionName)); Assert.That(completion.FunctionCall.FunctionArguments, Is.Not.Null); - var parsedArgs = JsonSerializer.Deserialize(completion.FunctionCall.FunctionArguments, SERIALIZER_OPTIONS); + var parsedArgs = JsonSerializer.Deserialize(completion.FunctionCall.FunctionArguments, SERIALIZER_OPTIONS)!; + Assert.That(parsedArgs, Is.Not.Null); Assert.That(parsedArgs.LocationName, Is.Not.Null.Or.Empty); Assert.That(parsedArgs.Date, Is.Not.Null.Or.Empty); @@ -157,7 +160,7 @@ public async Task SimpleFunctionCallWorksStreaming(FunctionCallTestType function StringBuilder content = new(); bool foundPromptFilter = false; bool foundResponseFilter = false; - string functionName = null; + string? functionName = null; StringBuilder functionArgs = new(); ChatClient client = GetTestClient(); @@ -219,9 +222,7 @@ public async Task SimpleFunctionCallWorksStreaming(FunctionCallTestType function } }; - AsyncCollectionResult response = SyncOrAsync(client, - c => c.CompleteChatStreaming(messages, requestOptions), - c => c.CompleteChatStreamingAsync(messages, requestOptions)); + AsyncCollectionResult response = client.CompleteChatStreamingAsync(messages, requestOptions); Assert.That(response, Is.Not.Null); await foreach (StreamingChatCompletionUpdate update in response) @@ -234,7 +235,8 @@ public async Task SimpleFunctionCallWorksStreaming(FunctionCallTestType function if (functionCallType != FunctionCallTestType.None) { Assert.That(functionName, Is.Not.Null); - var parsedArgs = JsonSerializer.Deserialize(functionArgs.ToString(), SERIALIZER_OPTIONS); + var parsedArgs = JsonSerializer.Deserialize(functionArgs.ToString(), SERIALIZER_OPTIONS)!; + Assert.That(parsedArgs, Is.Not.Null); Assert.That(parsedArgs.LocationName, Is.Not.Null.Or.Empty); Assert.That(parsedArgs.Date, Is.Not.Null.Or.Empty); @@ -260,9 +262,7 @@ public async Task SimpleFunctionCallWorksStreaming(FunctionCallTestType function functionName = null; functionArgs.Clear(); - response = SyncOrAsync(client, - c => c.CompleteChatStreaming(messages, requestOptions), - c => c.CompleteChatStreamingAsync(messages, requestOptions)); + response = client.CompleteChatStreamingAsync(messages, requestOptions); Assert.That(response, Is.Not.Null); await foreach (StreamingChatCompletionUpdate update in response) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs index 3f6e9617df035..77160c89a6266 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs @@ -1,12 +1,14 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.ClientModel; using System.Collections.Generic; using System.Text; using System.Text.Json; using System.Threading.Tasks; -using Azure.AI.OpenAI.Chat; -using Azure.Core.TestFramework; using OpenAI.Chat; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests { @@ -40,8 +42,8 @@ public partial class ChatTests private class TemperatureFunctionRequestArguments { - public string LocationName { get; set; } - public string Date { get; set; } + public string? LocationName { get; set; } + public string? Date { get; set; } } public enum ToolChoiceTestType @@ -129,7 +131,8 @@ public async Task SimpleToolWorks(ToolChoiceTestType toolChoice) Assert.That(toolCall.Kind, Is.EqualTo(ChatToolCallKind.Function)); Assert.That(toolCall.FunctionName, Is.EqualTo(TOOL_TEMPERATURE.FunctionName)); Assert.That(toolCall.FunctionArguments, Is.Not.Null); - var parsedArgs = JsonSerializer.Deserialize(toolCall.FunctionArguments, SERIALIZER_OPTIONS); + var parsedArgs = JsonSerializer.Deserialize(toolCall.FunctionArguments, SERIALIZER_OPTIONS)!; + Assert.That(parsedArgs, Is.Not.Null); Assert.That(parsedArgs.LocationName, Is.Not.Null.Or.Empty); Assert.That(parsedArgs.Date, Is.Not.Null.Or.Empty); @@ -179,8 +182,8 @@ public async Task SimpleToolWorksStreaming(ToolChoiceTestType toolChoice) StringBuilder content = new(); bool foundPromptFilter = false; bool foundResponseFilter = false; - string toolId = null; - string toolName = null; + string? toolId = null; + string? toolName = null; StringBuilder toolArgs = new(); ChatClient client = GetTestClient(); @@ -251,9 +254,7 @@ public async Task SimpleToolWorksStreaming(ToolChoiceTestType toolChoice) } }; - AsyncCollectionResult response = SyncOrAsync(client, - c => c.CompleteChatStreaming(messages, requestOptions), - c => c.CompleteChatStreamingAsync(messages, requestOptions)); + AsyncCollectionResult response = client.CompleteChatStreamingAsync(messages, requestOptions); Assert.That(response, Is.Not.Null); await foreach (StreamingChatCompletionUpdate update in response) @@ -269,7 +270,8 @@ public async Task SimpleToolWorksStreaming(ToolChoiceTestType toolChoice) Assert.That(toolId, Is.Not.Null); Assert.That(toolName, Is.Not.Null); Assert.That(toolArgs, Has.Length.GreaterThan(0)); - var parsedArgs = JsonSerializer.Deserialize(toolArgs.ToString(), SERIALIZER_OPTIONS); + var parsedArgs = JsonSerializer.Deserialize(toolArgs.ToString(), SERIALIZER_OPTIONS)!; + Assert.That(parsedArgs, Is.Not.Null); Assert.That(parsedArgs.LocationName, Is.Not.Null.Or.Empty); Assert.That(parsedArgs.Date, Is.Not.Null.Or.Empty); @@ -304,9 +306,7 @@ public async Task SimpleToolWorksStreaming(ToolChoiceTestType toolChoice) toolName = null; toolArgs.Clear(); - response = SyncOrAsync(client, - c => c.CompleteChatStreaming(messages, requestOptions), - c => c.CompleteChatStreamingAsync(messages, requestOptions)); + response = client.CompleteChatStreamingAsync(messages, requestOptions); Assert.That(response, Is.Not.Null); await foreach (StreamingChatCompletionUpdate update in response) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Vision.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Vision.cs index 6042122ea8370..85399aac41ca8 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Vision.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Vision.cs @@ -1,10 +1,13 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.ClientModel; using System.IO; using System.Text; using System.Threading.Tasks; -using Azure.Core.TestFramework; using OpenAI.Chat; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests { @@ -114,9 +117,7 @@ public async Task ChatWithImagesStreaming(bool useUri) MaxTokens = 2048, }; - AsyncCollectionResult response = SyncOrAsync(client, - c => c.CompleteChatStreaming(messages, options), - c => c.CompleteChatStreamingAsync(messages, options)); + AsyncCollectionResult response = client.CompleteChatStreamingAsync(messages, options); Assert.That(response, Is.Not.Null); await foreach (StreamingChatCompletionUpdate update in response) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs index 7fd32ef440d0e..8e376ecb441d1 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs @@ -13,10 +13,10 @@ using System.Threading.Tasks; using Azure.AI.OpenAI.Chat; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.AI.OpenAI.Tests.Utils.Pipeline; -using Azure.Core.TestFramework; using OpenAI.Chat; -using OpenAI.Tests; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Mocks; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests; @@ -27,11 +27,11 @@ public ChatTests(bool isAsync) : base(isAsync) #region General tests - [TestCase] + [Test] [Category("Smoke")] public async Task DefaultUserAgentStringWorks() { - using MockPipeline pipeline = new(MockPipeline.ReturnEmptyJson); + using MockHttpMessageHandler pipeline = new(MockHttpMessageHandler.ReturnEmptyJson); Uri endpoint = new Uri("https://www.bing.com/"); string apiKey = "not-a-real-one"; @@ -45,7 +45,7 @@ public async Task DefaultUserAgentStringWorks() Transport = pipeline.Transport }); - ChatClient client = InstrumentClient(topLevel.GetChatClient(model)); + ChatClient client = WrapClient(topLevel.GetChatClient(model)); await client.CompleteChatAsync([new UserChatMessage("Hello")]); @@ -53,7 +53,7 @@ public async Task DefaultUserAgentStringWorks() var request = pipeline.Requests[0]; Assert.That(request.Method, Is.EqualTo(HttpMethod.Post)); - Assert.That(request.Uri.GetLeftPart(UriPartial.Authority), Is.EqualTo(endpoint.GetLeftPart(UriPartial.Authority))); + Assert.That(request.Uri?.GetLeftPart(UriPartial.Authority), Is.EqualTo(endpoint.GetLeftPart(UriPartial.Authority))); Assert.That(request.Headers.GetValueOrDefault("api-key")?.FirstOrDefault(), Is.EqualTo(apiKey)); Assert.That(request.Headers.GetValueOrDefault("User-Agent")?.FirstOrDefault(), Does.Contain("azsdk-net-AI.OpenAI/")); Assert.That(request.Content, Is.Not.Null); @@ -108,7 +108,7 @@ public void DataSourceSerializationWorks() IReadOnlyList sourcesFromOptions = options.GetDataSources(); Assert.That(sourcesFromOptions, Has.Count.EqualTo(1)); Assert.That(sourcesFromOptions[0], Is.InstanceOf()); - Assert.That((sourcesFromOptions[0] as ElasticsearchChatDataSource).IndexName, Is.EqualTo("my-index-name")); + Assert.That(((ElasticsearchChatDataSource)sourcesFromOptions[0]).IndexName, Is.EqualTo("my-index-name")); options.AddDataSource(new AzureCosmosDBChatDataSource() { @@ -146,7 +146,7 @@ public async Task ChatCompletionBadKeyGivesHelpfulError() } } - [Test] + [RecordedTest] [Category("Smoke")] public async Task DefaultAzureCredentialWorks() { @@ -158,7 +158,7 @@ public async Task DefaultAzureCredentialWorks() } [RecordedTest] - [LiveOnly(Reason = "Delay behavior not emulated by recordings")] + [Ignore("Delay behavior not emulated by recordings, and needs to be run manually with some time in between iterations due to service throttling behaviour")] [TestCase("x-ms-retry-after-ms", "1000", 1000)] [TestCase("retry-after-ms", "1400", 1400)] [TestCase("Retry-After", "1", 1000)] @@ -167,15 +167,18 @@ public async Task DefaultAzureCredentialWorks() [TestCase("x-fake-test-retry-header", "1400", 800)] public async Task RateLimitedRetryWorks(string headerName, string headerValue, double expectedDelayMilliseconds) { - IConfiguration testConfig = TestConfig.GetConfig("rate_limited_chat"); + const string responseClass = "HttpClientTransportResponse"; + const string responseField = "_httpResponse"; + IConfiguration testConfig = TestConfig.GetConfig("rate_limited_chat")!; + Assert.That(testConfig, Is.Not.Null); int failureCount = 0; - string clientRequestId = null; + string? clientRequestId = null; TestPipelinePolicy replaceHeadersPolicy = new( requestAction: (request) => { - clientRequestId ??= request.Headers.TryGetValue("x-ms-client-request-id", out string id) ? id : null; + clientRequestId ??= request.Headers.GetFirstOrDefault("x-ms-client-request-id"); }, responseAction: (response) => { @@ -183,9 +186,12 @@ public async Task RateLimitedRetryWorks(string headerName, string headerValue, d { failureCount++; - Type httpPipelineResponseType = typeof(HttpClientPipelineTransport).GetNestedType("HttpClientTransportResponse", BindingFlags.NonPublic); - FieldInfo httpResponseField = httpPipelineResponseType.GetField("_httpResponse", BindingFlags.Instance | BindingFlags.NonPublic); - HttpResponseMessage httpResponse = httpResponseField.GetValue(response) as HttpResponseMessage; + Type httpPipelineResponseType = typeof(HttpClientPipelineTransport).GetNestedType(responseClass, BindingFlags.NonPublic) + ?? throw new InvalidOperationException($"Could not the expected {responseClass} inner non public class"); + FieldInfo httpResponseField = httpPipelineResponseType.GetField(responseField, BindingFlags.Instance | BindingFlags.NonPublic) + ?? throw new InvalidOperationException($"Could not find the expected {responseClass}.{responseField} field)"); + HttpResponseMessage httpResponse = httpResponseField.GetValue(response) as HttpResponseMessage + ?? throw new InvalidOperationException($"Could note determine the HttpResponseMessage to modify"); httpResponse.Headers.Remove("x-ms-retry-after-ms"); httpResponse.Headers.Remove("retry-after-ms"); @@ -217,7 +223,7 @@ public async Task RateLimitedRetryWorks(string headerName, string headerValue, d Stopwatch requestWatch = Stopwatch.StartNew(); ClientResult protocolResult = await client.CompleteChatAsync(requestContent, noThrowOptions); PipelineResponse response = protocolResult.GetRawResponse(); - bool responseHasRequestId = response.Headers.TryGetValue("x-ms-client-request-id", out string requestIdFromResponse); + bool responseHasRequestId = response.Headers.TryGetValue("x-ms-client-request-id", out string? requestIdFromResponse); Assert.That(responseHasRequestId, Is.True); Assert.That(requestIdFromResponse, Is.EqualTo(clientRequestId)); switch (response.Status) @@ -238,8 +244,8 @@ public async Task RateLimitedRetryWorks(string headerName, string headerValue, d Assert.That(observed200Delay.HasValue, Is.True); Assert.That(observed429Delay.HasValue, Is.True); Assert.That(failureCount, Is.EqualTo(4)); - Assert.That(observed429Delay.Value.TotalMilliseconds, Is.GreaterThan(expectedDelayMilliseconds)); - Assert.That(observed429Delay.Value.TotalMilliseconds, Is.LessThan(3 * expectedDelayMilliseconds + 2 * observed200Delay.Value.TotalMilliseconds)); + Assert.That(observed429Delay!.Value.TotalMilliseconds, Is.GreaterThan(expectedDelayMilliseconds)); + Assert.That(observed429Delay!.Value.TotalMilliseconds, Is.LessThan(3 * expectedDelayMilliseconds + 2 * observed200Delay!.Value.TotalMilliseconds)); } #endregion @@ -339,7 +345,8 @@ public async Task ChatCompletionContentFilter() [RecordedTest] public async Task SearchExtensionWorks() { - var searchConfig = TestConfig.GetConfig("search"); + var searchConfig = TestConfig.GetConfig("search")!; + Assert.That(searchConfig, Is.Not.Null); string searchIndex = searchConfig.GetValueOrThrow("index"); AzureSearchChatDataSource source = new() @@ -393,10 +400,7 @@ public async Task ChatCompletionBadKeyGivesHelpfulErrorStreaming() ChatClient chatClient = GetTestClient(keyCredential: new ApiKeyCredential(mockKey)); var messages = new[] { new UserChatMessage("oops, this won't work with that key!") }; - AsyncCollectionResult result = SyncOrAsync(chatClient, - c => c.CompleteChatStreaming(messages), - c => c.CompleteChatStreamingAsync(messages)); - + AsyncCollectionResult result = chatClient.CompleteChatStreamingAsync(messages); await foreach (StreamingChatCompletionUpdate update in result) { Assert.Fail("No exception was thrown"); @@ -433,9 +437,7 @@ public async Task ChatCompletionStreaming() TopLogProbabilityCount = 1, }; - AsyncCollectionResult streamingResults = SyncOrAsync(chatClient, - c => c.CompleteChatStreaming(messages, options), - c => c.CompleteChatStreamingAsync(messages, options)); + AsyncCollectionResult streamingResults = chatClient.CompleteChatStreamingAsync(messages, options); Assert.That(streamingResults, Is.Not.Null); await foreach (StreamingChatCompletionUpdate update in streamingResults) @@ -458,7 +460,8 @@ public async Task SearchExtensionWorksStreaming() bool foundResponseFilter = false; List contexts = new(); - var searchConfig = TestConfig.GetConfig("search"); + var searchConfig = TestConfig.GetConfig("search")!; + Assert.That(searchConfig, Is.Not.Null); string searchIndex = searchConfig.GetValueOrThrow("index"); AzureSearchChatDataSource source = new() @@ -477,9 +480,7 @@ public async Task SearchExtensionWorksStreaming() ChatClient client = GetTestClient(); - AsyncCollectionResult chatUpdates = SyncOrAsync(client, - c => c.CompleteChatStreaming(messages, options), - c => c.CompleteChatStreamingAsync(messages, options)); + AsyncCollectionResult chatUpdates = client.CompleteChatStreamingAsync(messages, options); Assert.IsNotNull(chatUpdates); await foreach (StreamingChatCompletionUpdate update in chatUpdates) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/EmbeddingTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/EmbeddingTests.cs index b0d10d301b489..771d59fbb8f4f 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/EmbeddingTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/EmbeddingTests.cs @@ -3,8 +3,8 @@ using System.ClientModel; using System.Threading.Tasks; -using Azure.Core.TestFramework; using OpenAI.Embeddings; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs index f1783bfe6db03..48b5337983929 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs @@ -1,12 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable disable - using System; using System.Threading.Tasks; -using Azure.Core.TestFramework; using OpenAI.Files; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs index 28560a945c12b..fb9ad2a926bc2 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.ClientModel; using System.ClientModel.Primitives; @@ -14,10 +12,11 @@ using Azure.AI.OpenAI.Tests.Models; using Azure.AI.OpenAI.Tests.Utils; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.Core.TestFramework; using OpenAI.Chat; using OpenAI.Files; using OpenAI.FineTuning; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests; @@ -254,7 +253,7 @@ public async Task DeployAndChatWithModel() Assert.That(job!.Status, Is.EqualTo("succeeded")); // Deploy the model and wait for the deployment to finish - deploymentName = "azure-ai-openai-test-" + Recording.Random.NewGuid().ToString(); + deploymentName = "azure-ai-openai-test-" + Recording?.Random.NewGuid().ToString(); AzureDeployedModel deployment = await deploymentClient.CreateDeploymentAsync(deploymentName, fineTunedModel); Assert.That(deployment, Is.Not.Null); Assert.That(deployment.ID, !(Is.Null.Or.Empty)); @@ -393,7 +392,9 @@ private async Task DeleteJobAndVerifyAsync(FineTuningClient client, string ErrorOptions = ClientErrorBehaviors.NoThrow }; - var rawClient = GetOriginal(client); + // Since the DeleteJob and DeleteJobAsync are extensions methods, we need to call them on the unwrapped type, + // instead of the dynamically wrapped type. + var rawClient = UnWrap(client); bool success = false; while (DateTimeOffset.Now < stopTime) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs index e07912bef5910..f82f5762ff47e 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs @@ -1,27 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable disable - using System; using System.ClientModel; using System.Threading.Tasks; -using Azure.Core.TestFramework; -using Azure.Identity; using OpenAI.Images; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests; -public class ImageTests : AoaiTestBase +public class ImageTests(bool isAsync) : AoaiTestBase(isAsync) { - public ImageTests(bool isAsync) : base(isAsync) - { } - [RecordedTest] [Category("Smoke")] public void CanCreateClient() { - ImageClient client = GetTestClient(tokenCredential: new DefaultAzureCredential()); + ImageClient client = GetTestClient(tokenCredential: TestEnvironment.Credential); Assert.That(client, Is.InstanceOf()); } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Models/AzureDeploymentClient.cs b/sdk/openai/Azure.AI.OpenAI/tests/Models/AzureDeploymentClient.cs index 1352ff140bb4b..3b51c441d76ea 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Models/AzureDeploymentClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Models/AzureDeploymentClient.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.ClientModel; using System.ClientModel.Primitives; @@ -16,6 +14,7 @@ using System.Threading.Tasks; using Azure.AI.OpenAI.Tests.Utils; using Azure.AI.OpenAI.Tests.Utils.Config; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests.Models; @@ -35,14 +34,14 @@ internal class AzureDeploymentClient : IDisposable private readonly string _endpointUrl; private readonly string _apiVersion; - protected AzureDeploymentClient() + internal AzureDeploymentClient() { // for mocking _cts = new(); _pipeline = ClientPipeline.Create(); _subscriptionId = _resourceGroup = _resourceName = _endpointUrl = string.Empty; _apiVersion = DEFAULT_API_VERSION; - _credential = new Core.TestFramework.MockCredential(); + _credential = null!; } public AzureDeploymentClient(IConfiguration config, Core.TokenCredential credential, string? apiVersion = null, PipelineTransport? transport = null) @@ -140,7 +139,7 @@ private async ValueTask DeleteDeploymentAsync(bool isAsync, string deploym private static BinaryContent ToJsonContent(T value) { Utf8JsonBinaryContent content = new(); - JsonSerializer.Serialize(content.JsonWriter, value, typeof(T), JsonHelpers.AzureJsonOptions); + JsonSerializer.Serialize(content.JsonWriter, value, typeof(T), JsonOptions.AzureJsonOptions); return content; } @@ -160,10 +159,10 @@ private static void ThrowOnFailed(PipelineResponse response) if (response.IsError) { if (response.Content != null - && response.Headers.GetFirstValueOrDefault("Content-Type")?.StartsWith("application/json") == true) + && response.Headers.GetFirstOrDefault("Content-Type")?.StartsWith("application/json") == true) { using Stream errorStream = response.Content.ToStream(); - ErrorInfo? error = JsonHelpers.Deserialize(errorStream, JsonHelpers.AzureJsonOptions); + ErrorInfo? error = JsonHelpers.Deserialize(errorStream, JsonOptions.AzureJsonOptions); if (error?.Error != null) { throw new ClientResultException($"[{response.Status} - {error.Error.Code}] {error.Error.Message}", response); @@ -179,7 +178,7 @@ private static T FromJsonContent(PipelineResponse response, CancellationToken ThrowOnFailed(response); using Stream stream = response.Content.ToStream(); - return JsonHelpers.Deserialize(stream, JsonHelpers.AzureJsonOptions) + return JsonHelpers.Deserialize(stream, JsonOptions.AzureJsonOptions) ?? throw new InvalidDataException("Service returned a null JSON response body"); } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchObject.cs b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchObject.cs index c9e2253d3c968..0c0e7d517f800 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchObject.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchObject.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Text.Json; using Azure.AI.OpenAI.Tests.Utils; @@ -13,7 +11,7 @@ public class BatchObject { public static BatchObject From(BinaryData data) { - return JsonSerializer.Deserialize(data, JsonHelpers.OpenAIJsonOptions) + return JsonSerializer.Deserialize(data, JsonOptions.OpenAIJsonOptions) ?? throw new InvalidOperationException("Response was null JSON"); } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchOptions.cs b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchOptions.cs index 4768ab3e2fb84..40a5803700659 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchOptions.cs @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.ClientModel; using System.Collections.Generic; using System.IO; using Azure.AI.OpenAI.Tests.Utils; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests.Models; @@ -21,7 +20,7 @@ public class BatchOptions public BinaryContent ToBinaryContent() { using MemoryStream stream = new MemoryStream(); - JsonHelpers.Serialize(stream, this, JsonHelpers.OpenAIJsonOptions); + JsonHelpers.Serialize(stream, this, JsonOptions.OpenAIJsonOptions); stream.Seek(0, SeekOrigin.Begin); var data = BinaryData.FromStream(stream); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchResult.cs b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchResult.cs index c67b91d20e2bf..9d36d8d1884a9 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchResult.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; using System.IO; @@ -31,7 +29,7 @@ public static IReadOnlyList> From(BinaryData data) break; } - var entry = JsonSerializer.Deserialize>(line, JsonHelpers.OpenAIJsonOptions); + var entry = JsonSerializer.Deserialize>(line, JsonOptions.OpenAIJsonOptions); if (entry != null) { list.Add(entry); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Models/FineTuningOptions.cs b/sdk/openai/Azure.AI.OpenAI/tests/Models/FineTuningOptions.cs index d40abfa12dc0a..4c44995f81b64 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Models/FineTuningOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Models/FineTuningOptions.cs @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System.ClientModel; using System.IO; using Azure.AI.OpenAI.Tests.Utils; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests.Models; @@ -20,7 +19,7 @@ public class FineTuningOptions public BinaryContent ToBinaryContent() { MemoryStream stream = new(); - JsonHelpers.Serialize(stream, this, JsonHelpers.OpenAIJsonOptions); + JsonHelpers.Serialize(stream, this, JsonOptions.OpenAIJsonOptions); stream.Seek(0, SeekOrigin.Begin); return BinaryContent.Create(stream); } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Samples/00_ClientConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/tests/Samples/00_ClientConfiguration.cs index ba3aa156baddb..a4ebb8fc1b771 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Samples/00_ClientConfiguration.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Samples/00_ClientConfiguration.cs @@ -4,14 +4,7 @@ #nullable disable using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.IO; -using System.Threading.Tasks; -using Azure.Core.Pipeline; -using Azure.Core.TestFramework; using Azure.Identity; -using OpenAI.Audio; using OpenAI.Chat; namespace Azure.AI.OpenAI.Samples; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs b/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs index ca8fbb03bbc8f..3ad7584e55513 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs @@ -5,15 +5,10 @@ using System; using System.ClientModel; -using System.ClientModel.Primitives; using System.Collections.Generic; -using System.IO; using System.Text; using System.Text.Json; -using System.Threading.Tasks; -using Azure.Core.TestFramework; using Azure.Identity; -using OpenAI.Audio; using OpenAI.Chat; namespace Azure.AI.OpenAI.Samples; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Samples/02_Oyd.cs b/sdk/openai/Azure.AI.OpenAI/tests/Samples/02_Oyd.cs index 1537703f7ba60..1f1a85d69e596 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Samples/02_Oyd.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Samples/02_Oyd.cs @@ -4,17 +4,8 @@ #nullable disable using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Text.Json; -using System.Threading.Tasks; using Azure.AI.OpenAI.Chat; -using Azure.Core.TestFramework; using Azure.Identity; -using OpenAI.Audio; using OpenAI.Chat; namespace Azure.AI.OpenAI.Samples; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs index 5fb0440c0e572..70c178dd271c2 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.ClientModel; using System.ClientModel.Primitives; @@ -11,13 +9,10 @@ using System.Linq; using System.Text; using System.Text.Json; -using System.Threading; using System.Threading.Tasks; using Azure.AI.OpenAI.Tests.Models; using Azure.AI.OpenAI.Tests.Utils; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.Core.TestFramework; -using Azure.Core.TestFramework.Models; using NUnit.Framework.Interfaces; using OpenAI.Assistants; using OpenAI.Audio; @@ -27,15 +22,18 @@ using OpenAI.Files; using OpenAI.FineTuning; using OpenAI.Images; -using OpenAI.Tests; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Recording.Proxy; +using OpenAI.TestFramework.Recording.Proxy.Service; +using OpenAI.TestFramework.Recording.RecordingProxy; +using OpenAI.TestFramework.Recording.Sanitizers; +using OpenAI.TestFramework.Utils; using OpenAI.VectorStores; -using RetryMode = Azure.Core.RetryMode; -using RetryOptions = Azure.Core.RetryOptions; using TokenCredential = Azure.Core.TokenCredential; namespace Azure.AI.OpenAI.Tests; -public class AoaiTestBase : RecordedTestBase +public class AoaiTestBase : RecordedClientTestBase where TClient : class { private const string AZURE_URI_SANITIZER_PATTERN = @"(?<=/(subscriptions|resourceGroups|accounts)/)([^/]+?)(?=(/|$))"; private const string SMALL_1x1_PNG = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiQAABYkAZsVxhQAAAAMSURBVBhXY2BgYAAAAAQAAVzN/2kAAAAASUVORK5CYII="; @@ -49,68 +47,89 @@ public class AoaiTestBase : RecordedTestBase #endif internal TestConfig TestConfig { get; } + internal Assets Assets { get; } - internal DisableRecordingInterceptor RecordingDisabler { get; } + + public AzureTestEnvironment TestEnvironment { get; } + + protected AoaiTestBase(bool isAsync) : this(isAsync, null) + { } protected AoaiTestBase(bool isAsync, RecordedTestMode? mode = null) : base(isAsync, mode) { TestConfig = new TestConfig(Mode); - Assets = new Assets(TestEnvironment); + Assets = new Assets(); + TestEnvironment = new AzureTestEnvironment(Mode); + + // Remove some of the default sanitizers to customize their behaviour + RecordingOptions.SanitizersToRemove.AddRange( + [ + "AZSDK2003", // Location header (we use a less restrictive sanitizer) + "AZSDK4001", // Replaces entire host name in URL. We want to mask only subdomain part to make it easier to distinguish requests + "AZSDK3430", // OpenAI liberally uses "id" in its JSON responses, and we want to keep them in the recordings + "AZSDK3493", // $..name in JSON. OpenAI uses this for things that don't need to be sanitized + ]); + + // Prevent resource names from leaking into recordings + RecordingOptions.Sanitizers.AddRange( + [ + new UriRegexSanitizer(SanitizedJsonConfig.HOST_SUBDOMAIN_PATTERN) + { + Value = SanitizedJsonConfig.MASK_STRING + }, + new UriRegexSanitizer(AZURE_URI_SANITIZER_PATTERN) + { + Value = SanitizedJsonConfig.MASK_STRING + }, + new HeaderRegexSanitizer("Location") + { + Regex = AZURE_URI_SANITIZER_PATTERN, + Value = SanitizedJsonConfig.MASK_STRING + }, + new HeaderRegexSanitizer("Azure-AsyncOperation") + { + Regex = AZURE_URI_SANITIZER_PATTERN, + Value = SanitizedJsonConfig.MASK_STRING + }, + new BodyKeySanitizer("$..endpoint") + { + Regex = SanitizedJsonConfig.HOST_SUBDOMAIN_PATTERN, + Value = SanitizedJsonConfig.MASK_STRING + } + ]); - // Disable additional fluff that is causing issues - TestDiagnostics = false; + // Prevent keys from leaking into our recordings + RecordingOptions.SanitizeJsonBody("*..key", "*..api_key"); - // Add sanitizers to prevent resource names from leaking into recordings - UriRegexSanitizers.Add(new UriRegexSanitizer(SanitizedJsonConfig.HOST_SUBDOMAIN_PATTERN) + // Because the current implementation of multi-part form content data in OpenAI and Azure OpenAI uses random + // to generate boundaries, this causes problems during playback as the boundary will be different each time. + // Longer term, we should find a way to pass the TestRecording.Random to the multi-part form generator in the + // code. The simplest solution for now is to disable recording the body for these mime types + RecordingOptions.RequestOverride = request => { - Value = SanitizedJsonConfig.MASK_STRING - }); - UriRegexSanitizers.Add(new UriRegexSanitizer(AZURE_URI_SANITIZER_PATTERN) - { - Value = SanitizedJsonConfig.MASK_STRING - }); - HeaderRegexSanitizers.Add(new HeaderRegexSanitizer("Azure-AsyncOperation") - { - Regex = AZURE_URI_SANITIZER_PATTERN, - Value = SanitizedJsonConfig.MASK_STRING - }); - HeaderRegexSanitizers.Add(new HeaderRegexSanitizer("Location") - { - Regex = AZURE_URI_SANITIZER_PATTERN, - Value = SanitizedJsonConfig.MASK_STRING - }); - BodyKeySanitizers.Add(new BodyKeySanitizer("$..endpoint") - { - Regex = SanitizedJsonConfig.HOST_SUBDOMAIN_PATTERN, - Value = SanitizedJsonConfig.MASK_STRING - }); - BodyKeySanitizers.Add(new BodyKeySanitizer("$..id") + if (request?.Headers.GetFirstOrDefault("Content-Type")?.StartsWith("multipart/form-data") == true) + { + return RequestRecordMode.RecordWithoutRequestBody; + } + + return RequestRecordMode.Record; + }; + RecordingOptions.Sanitizers.Add(new HeaderRegexSanitizer("Content-Type") { - Regex = AZURE_URI_SANITIZER_PATTERN, - Value = SanitizedJsonConfig.MASK_STRING + Regex = @"multipart/form-data; boundary=[^\s]+", + Value = "multipart/form-data; boundary=***" }); - // Add sanitizers to prevent our keys from leaking into the recordings - JsonPathSanitizers.Add("*..key"); - JsonPathSanitizers.Add("*..api_key"); - - // Multi-part form data gives the test-proxy that is used for recording and playback indigestion (it always thinks it needs - // to re-record the test on playback). So let's add an interceptor that will automatically disable body recording for specific - // client methods calls, and then re-enable it afterwards. - RecordingDisabler = new(() => Recording); - RecordingDisabler.DisableBodyRecordingFor(nameof(FileClient.UploadFileAsync)); - - IgnoredHeaders.Add("x-ms-client-request-id"); - // Data URIs trimmed to prevent the recording from being too large - BodyKeySanitizers.Add(new BodyKeySanitizer("$..url") + RecordingOptions.Sanitizers.Add(new BodyKeySanitizer("$..url") { Regex = @"(?<=data:image/png;base64,)(.+)", Value = SMALL_1x1_PNG }); + // Base64 encoded images in the response are replaced with a 1x1 black pixel PNG image to ensure valid data - BodyKeySanitizers.Add(new BodyKeySanitizer($"..b64_json") + RecordingOptions.Sanitizers.Add(new BodyKeySanitizer($"..b64_json") { Value = SMALL_1x1_PNG }); @@ -150,45 +169,7 @@ public virtual AzureOpenAIClient GetTestTopLevelClient( Action? responseAction = options.ShouldOutputResponses ? DumpResponse : null; options.AddPolicy(new TestPipelinePolicy(requestAction, responseAction), PipelinePosition.PerCall); - // If we are in playback, or record mode we should set the transport to the test proxy transport, except - // in the case where we've explicitly specified the transport ourselves. There are cases where we use a - // mock pipeline and we don't want those to go to the test proxy. - if (options.Transport == null) - { - // TODO FIXME update once test framework code is updated - /* NOTE: - * Normally we would call the base class RecordedTestBase.InstrumentClientOptions. Unfortunately this doesn't - * currently work since the test framework still relies on a version of Azure.Core that has not been updated - * to use the new System.ClientModel types. Thus InstrumentClientOptions expects a type that inherits from - * Azure.Core.ClientOptions, whereas we inherit from System.ClientModel.Primitives.ClientPipelineOptions. For - * now we duplicate the code from InstrumentClientOptions here - */ - - if (Mode == RecordedTestMode.Playback) - { - // You guessed it: the constructor for RetryOptions is internal only. So plan B: - RetryOptions retryOpt = (RetryOptions)Activator.CreateInstance(typeof(RetryOptions), true)!; - - // Not making the timeout zero so retry code still goes async - retryOpt.Delay = TimeSpan.FromMilliseconds(10); - retryOpt.Mode = RetryMode.Fixed; - - options.RetryPolicy = new Utils.Pipeline.ClientRetryPolicyAdapter(retryOpt); - } - - // No need to set the transport if we are in Live mode - if (Mode != RecordedTestMode.Live) - { - // Wait what's this? More private or internal only things I need access to? - var proxyAccess = NonPublic.FromField("_proxy"); - var disableRecordingAccess = NonPublic.FromField>("_disableRecording"); - - options.Transport = new Utils.Pipeline.ProxyTransport( - proxyAccess.Get(this), - Recording, - () => disableRecordingAccess.Get(Recording).Value); - } - } + options = ConfigureClientOptions(options); AzureOpenAIClient topLevelClient; if (tokenCredential != null) @@ -238,7 +219,7 @@ public virtual TClient GetTestClient(string configName, TestClientOptions? optio /// The client instance passed was not instrumented public virtual TExplicitClient GetTestClientFrom(TClient client, string? deploymentName = null) { - AzureOpenAiInstrumented? instrumented = _clientToTopLevel.FirstOrDefault(e => ReferenceEquals(client, e.Client)); + var instrumented = (TopLevelInfo?)GetClientContext(client); if (instrumented?.TopLevelClient != null && instrumented?.Config != null) { @@ -249,12 +230,66 @@ public virtual TExplicitClient GetTestClientFrom(TClient client "instances using the GetTestClient() methods"); } - /// - /// Disables the recording of request bodies for the specified method in the current client. - /// - /// The method name. - public virtual void DisableRequestBodyRecording(string methodName) - => RecordingDisabler.DisableBodyRecordingFor(methodName); + #region overrides + + /// + protected override RecordedTestMode GetDefaultRecordedTestMode() + => AzureTestEnvironment.DefaultRecordMode; + + /// + protected override ProxyServiceOptions CreateProxyServiceOptions() + => new() + { + DotnetExecutable = TestEnvironment.DotNetExe.FullName, + TestProxyDll = TestEnvironment.TestProxyDll.FullName, + DevCertFile = TestEnvironment.TestProxyHttpsCert.FullName, + DevCertPassword = TestEnvironment.TestProxyHttpsCertPassword, + StorageLocationDir = TestEnvironment.RepoRoot.FullName, + }; + + /// + protected override RecordingStartInformation CreateRecordingSessionStartInfo() + { + // This uses the same directory structure as the previous Azure.Core.TestFramework used for an easy drop in replacement. + // For example, suppose your test class is (and your class name matches the file name): + // c:\src\azure-sdk-for-net\sdk\openai\Azure.AI.OpenAI\tests\ChatTests.cs + // Then this would return something like: + // sdk\openai\Azure.AI.OpenAI\tests\SessionRecords\ChatTests\TestName.json + DirectoryInfo? sourceDir = GetType().Assembly.GetAssemblySourceDir(); + string relativeDir = PathHelpers.GetRelativePath( + TestEnvironment.RepoRoot.FullName, + sourceDir?.FullName ?? TestEnvironment.RepoRoot.FullName); + + string recordingFile = Path.Combine( + relativeDir, + "SessionRecords", + GetType().Name, + GetRecordedTestFileName()); + + // Start at the source directory for the current test project, and then walk up the directory structure searching for + // an "assets.json" file. + string? assetsFile = null; + for ( + DirectoryInfo? current = sourceDir; + current != null && current.FullName != TestEnvironment.RepoRoot.FullName; + current = current?.Parent) + { + string file = Path.Combine(current!.FullName, "assets.json"); + if (File.Exists(file)) + { + assetsFile = file; + break; + } + } + + return new() + { + RecordingFile = recordingFile, + AssetsFile = assetsFile + }; + } + + #endregion /// /// Polls until a condition has been met with a maximum wait time. The function will always return the last value even @@ -381,15 +416,15 @@ protected virtual TExplicitClient GetTestClient(AzureOpenAIClie throw new NotImplementedException($"Test client helpers not yet implemented for {typeof(TExplicitClient)}"); }; - object instrumented = InstrumentClient(typeof(TExplicitClient), clientObject, [RecordingDisabler]); - - // Keep track of the corresponding top level client and config - _clientToTopLevel.Add(new AzureOpenAiInstrumented - { - Client = instrumented, - TopLevelClient = topLevelClient, - Config = config, - }); + object instrumented = WrapClient( + typeof(TExplicitClient), + clientObject, + new TopLevelInfo + { + TopLevelClient = topLevelClient, + Config = config, + }, + null); return (TExplicitClient)instrumented; } @@ -416,7 +451,7 @@ private static void DumpRequest(PipelineRequest request) request.Content.WriteTo(stream, default); stream.Position = 0; - string? contentType = request.Headers.GetFirstValueOrDefault("Content-Type"); + string? contentType = request.Headers.GetFirstOrDefault("Content-Type"); if (IsProbableTextContent(contentType)) { DumpText(contentType, stream); @@ -445,7 +480,7 @@ private static void DumpResponse(PipelineResponse response) if (response!.Content is not null) { using Stream stream = response.Content.ToStream(); - string? contentType = response.Headers.GetFirstValueOrDefault("Content-Type"); + string? contentType = response.Headers.GetFirstOrDefault("Content-Type"); if (IsProbableTextContent(contentType)) { DumpText(contentType, stream); @@ -652,7 +687,7 @@ protected static PipelineResponse ValidateClientResultResponse(ClientResult resu PipelineResponse response = result.GetRawResponse(); Assert.That(response.Status, Is.GreaterThanOrEqualTo(200).And.LessThan(300)); Assert.That(response.Headers, Is.Not.Null); - Assert.That(response.Headers.GetFirstValueOrDefault("Content-Type"), Does.StartWith("application/json")); + Assert.That(response.Headers.GetFirstOrDefault("Content-Type"), Does.StartWith("application/json")); Assert.That(response.Content, Is.Not.Null); return response; @@ -674,64 +709,14 @@ protected virtual TModel ValidateAndParse(ClientResult result, JsonSeria using Stream stream = response.Content.ToStream(); Assert.That(stream, Is.Not.Null); - TModel? model = JsonHelpers.Deserialize(stream, options ?? JsonHelpers.OpenAIJsonOptions); + TModel? model = JsonHelpers.Deserialize(stream, options ?? JsonOptions.OpenAIJsonOptions); Assert.That(model, Is.Not.Null); return model!; } - protected AsyncCollectionResult SyncOrAsync(TClient client, Func> sync, Func> async) - { - // TODO FIXME HACK Since the test framework doesn't currently support async result collection, this methods provides - // a simplified way to make explicit calls to the right methods in tests - TClient rawClient = GetOriginal(client); - - if (IsAsync) - { - return async(rawClient); - } - else - { - CollectionResult syncCollection = sync(rawClient); - return new SyncToAsyncCollectionResult(syncCollection); - } - } - - protected AsyncPageCollection SyncOrAsync(TClient client, Func> sync, Func> async) - { - // TODO FIXME HACK Since the test framework doesn't currently support async result collection, this methods provides - // a simplified way to make explicit calls to the right methods in tests - TClient rawClient = GetOriginal(client); - - if (IsAsync) - { - return async(rawClient); - } - else - { - PageCollection syncCollection = sync(rawClient); - return new SyncToAsyncPageCollection(syncCollection); - } - } - - protected Task> SyncOrAsyncList(TClient client, Func> sync, Func> async) - { - // TODO FIXME HACK Since the test framework doesn't currently support async result collection, this methods provides - // a simplified way to make explicit calls to the right methods in tests - TClient rawClient = GetOriginal(client); - - if (IsAsync) - { - return async(rawClient).GetAllValuesAsync().ToEnumerableAsync(); - } - else - { - return Task.FromResult(sync(rawClient).GetAllValues().ToList()); - } - } - - internal class AzureOpenAiInstrumented + internal class TopLevelInfo { - required public object Client { get; init; } + //required public object Client { get; init; } required public AzureOpenAIClient TopLevelClient { get; init; } required public IConfiguration Config { get; init; } } @@ -742,7 +727,6 @@ internal class AzureOpenAiInstrumented private readonly List _fileIdsToDelete = []; private readonly List<(string, string)> _vectorStoreFileAssociationsToRemove = []; private readonly List _vectorStoreIdsToDelete = []; - internal readonly List _clientToTopLevel = new(); } public class TestClientOptions : AzureOpenAIClientOptions diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestEnvironment.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestEnvironment.cs deleted file mode 100644 index 972149209692d..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestEnvironment.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable disable - -using Azure.Core.TestFramework; -using OpenAI.Assistants; -using OpenAI.Audio; -using OpenAI.Batch; -using OpenAI.Chat; -using OpenAI.Embeddings; -using OpenAI.Files; -using OpenAI.FineTuning; -using OpenAI.Images; -using OpenAI.VectorStores; -using System; -using System.ClientModel; -using System.Collections.Generic; -using System.IO; - -namespace Azure.AI.OpenAI.Tests; - -public partial class AoaiTestEnvironment : TestEnvironment -{ -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Assets.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Assets.cs index 617041f9eec94..15590bc9cca6b 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Assets.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Assets.cs @@ -1,16 +1,15 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.IO; -using Azure.Core.TestFramework; namespace Azure.AI.OpenAI.Tests { - internal class Assets + public class Assets { - private readonly TestEnvironment _env; - - public Assets(TestEnvironment env) + public Assets() { - _env = env ?? throw new ArgumentNullException(nameof(env)); HelloWorld = new() { Type = AssetType.Audio, @@ -61,7 +60,7 @@ protected virtual string GetPath(string assetName) } } - internal enum AssetType + public enum AssetType { Text, Audio, @@ -69,14 +68,14 @@ internal enum AssetType Raw } - internal class AssetInfo + public class AssetInfo { - public AssetType Type { get; init; } - public string Language { get; init; } - public string Name { get; init; } - public string RelativePath { get; init; } - public string Description { get; init; } - public string MimeType { get; init; } - public Uri Url { get; init; } + required public AssetType Type { get; init; } + required public string Name { get; init; } + required public string RelativePath { get; init; } + required public string MimeType { get; init; } + public string? Language { get; init; } + public string? Description { get; init; } + public Uri? Url { get; init; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AzureTestEnvironment.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AzureTestEnvironment.cs new file mode 100644 index 0000000000000..a7407e09ae910 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AzureTestEnvironment.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Linq; +using System.Reflection; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Mocks; +using OpenAI.TestFramework.Recording; +using OpenAI.TestFramework.Utils; + +namespace Azure.AI.OpenAI.Tests.Utils; + +/// +/// Represents an Azure test environment. +/// +public class AzureTestEnvironment +{ + private readonly RecordedTestMode _mode; + private readonly string _optionPrefix; + private TokenCredential? _credential; + + /// + /// Initializes a new instance. + /// + /// The recorded test mode to use. + public AzureTestEnvironment(RecordedTestMode mode) + { + _mode = mode; + + RepoRoot = FindRepoRoot(); + + DotNetExe = AssemblyHelper.GetDotnetExecutable() + ?? throw new InvalidOperationException( + "Could not determine the dotnet executable to use. Do you have .Net installed or have your paths correctly configured?"); + + TestProxyDll = new FileInfo( + AssemblyHelper.GetAssemblyMetadata("TestProxyPath") + ?? throw new InvalidOperationException("Could not determine the path to the recording test proxy DLL")); + + TestProxyHttpsCert = new FileInfo(Path.Combine( + RepoRoot.FullName, + "eng", + "common", + "testproxy", + "dotnet-devcert.pfx")); + if (!TestProxyHttpsCert.Exists) + { + throw new InvalidOperationException("Could not find test proxy HTTPS root certificate to use."); + } + + TestProxyHttpsCertPassword = "password"; + + string? serviceName = null; + DirectoryInfo? sourceDir = GetType().Assembly.GetAssemblySourceDir(); + if (sourceDir != null) + { + string relativePath = PathHelpers.GetRelativePath( + Path.Combine(RepoRoot.FullName, "sdk"), + sourceDir.FullName); + serviceName = relativePath + .Split(new char[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault()!; + } + + _optionPrefix = serviceName?.ToUpperInvariant() + "_"; + } + + /// + /// Gets the root Git folder. + /// + public DirectoryInfo RepoRoot { get; } + + /// + /// Gets the path to the dotnet executable. This will be used in combination with to start the + /// recording test proxy service. + /// + public FileInfo DotNetExe { get; } + + /// + /// The path to test proxy DLL that will be used when starting the recording test proxy service. + /// + public FileInfo TestProxyDll { get; } + + /// + /// Gets the HTTPS certificate file to use as the signing certificate for HTTPS connections to the test proxy. + /// + public FileInfo TestProxyHttpsCert { get; } + + /// + /// Gets the password for . + /// + public string TestProxyHttpsCertPassword { get; } + + /// + /// Gets the token credential to use during testing. This will change depending on the record mode. + /// + public TokenCredential Credential => _credential ??= GetCredential(); + + /// + /// Gets the default record mode to use for the test. This will attempt to read from the test context, or environment variables. + /// + public static RecordedTestMode DefaultRecordMode + { + get + { + string? modeString = TestContext.Parameters["TestMode"] + ?? Environment.GetEnvironmentVariable("AZURE_TEST_MODE"); + + if (Enum.TryParse(modeString, true, out RecordedTestMode mode)) + { + return mode; + } + + return RecordedTestMode.Playback; + } + } + + /// + /// Gets an optional value from environment variables. + /// + /// The name of the value to retrieve. + /// The value, or null if it did not exist. + public string? GetOptionalVariable(string name) + { + return new[] + { + _optionPrefix + name, + name, + "AZURE_" + name + } + .Select(Environment.GetEnvironmentVariable) + .FirstOrDefault(value => !string.IsNullOrWhiteSpace(value)); + } + + /// + /// Gets a value from environment variables, or throws an exception if it does not exist. + /// + /// The name of the value to retrieve. + /// The value. + /// If the value did not exist. + public string GetVariable(string name) + { + string? optionalVariable = GetOptionalVariable(name); + return optionalVariable + ?? throw new InvalidOperationException($"Could not find required environment variable '{_optionPrefix + name }' or '{name}'."); + } + + /// + /// Finds the root directory of the Git repository. + /// + /// The root directory of the Git repository. + private static DirectoryInfo FindRepoRoot() + { + /** + * We want to find the folder that is the Git repository root folder. We do this by searching for a directory that contains + * a .git subfolder. + * + * We search up for the .git subfolder from two starting locations: + * - Check the "SourcePath" assembly metadata attribute value. All projects in the Azure C# repo automatically have this attribute + * added as part of the build "magic" (see {repo_root}\Directory.Build.Targets) + * - Where the executing assembly is running from + * + * Side note: an entirely different way to do this would be call: git rev-parse --show-toplevel + */ + + DirectoryInfo?[] startingPoints = + [ + AssemblyHelper.GetAssemblySourceDir(), + new FileInfo(Assembly.GetExecutingAssembly().Location).Directory, + ]; + + foreach (DirectoryInfo? dir in startingPoints) + { + if (dir?.Exists != true) + { + continue; + } + + for (var d = dir; d != null; d = d.Parent) + { + if (d.EnumerateDirectories(".git").Any()) + { + return d; + } + } + } + + throw new InvalidOperationException("Could not determine the root folder for this repository"); + } + + private TokenCredential GetCredential() + { + if (_mode == RecordedTestMode.Playback) + { + return new MockTokenCredential(); + } + + // I'm not sure exactly what the possible combinations to use here are, so I've essentially copied the logic + // TestEnvironment.cs in Azure.Core.TestFramework (though it is a little simplified here) + string? clientSecret = GetOptionalVariable("CLIENT_SECRET"); + string? systemAccessToken = GetOptionalVariable("SYSTEM_ACCESSTOKEN"); + + if (!string.IsNullOrWhiteSpace(clientSecret)) + { + return new ClientSecretCredential( + GetVariable("TENANT_ID"), + GetVariable("CLIENT_ID"), + clientSecret); + } + else if (!string.IsNullOrWhiteSpace(systemAccessToken)) + { + return new AzurePipelinesCredential( + GetVariable("AZURESUBSCRIPTION_TENANT_ID"), + GetVariable("AZURESUBSCRIPTION_CLIENT_ID"), + GetVariable("AZURESUBSCRIPTION_SERVICE_CONNECTION_ID"), + systemAccessToken, + new AzurePipelinesCredentialOptions { AuthorityHost = new Uri(GetVariable("AZURE_AUTHORITY_HOST")) }); + } + else + { + return new DefaultAzureCredential( + new DefaultAzureCredentialOptions() { ExcludeManagedIdentityCredential = true }); + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/FlattenedConfig.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/FlattenedConfig.cs index c0b4025edbaba..205a5d072e66c 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/FlattenedConfig.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/FlattenedConfig.cs @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; using System.Linq; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests.Utils.Config; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/IConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/IConfiguration.cs index 1da15c4c85c38..97511d548e682 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/IConfiguration.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/IConfiguration.cs @@ -1,12 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; -using System.Linq; -using NUnit.Framework.Internal; +using OpenAI.TestFramework.AutoSyncAsync; namespace Azure.AI.OpenAI.Tests.Utils.Config; @@ -82,9 +79,9 @@ public static TVal GetValueOrThrow(this IConfiguration? config, string key /// The client instance. /// The configuration. /// The client did not have a config associated with it. - public static IConfiguration GetConfigOrThrow(this TExplicitClient client) + public static IConfiguration GetConfigOrThrow(this TExplicitClient client) where TExplicitClient : class { - var instrumented = GetInstrumentedData(client); + var instrumented = GetTopLevelClientInfo(client); return instrumented.Config ?? throw new ArgumentException("The client was instrumented with a null configuration"); } @@ -110,31 +107,23 @@ public static string DeploymentOrThrow(this IConfiguration? config, string? clie /// The deployment name used for that client instance. /// The client either was not properly instrumented. /// The client did not have a deployment configured. - public static string DeploymentOrThrow(this TExplicitClient client) + public static string DeploymentOrThrow(this TExplicitClient client) where TExplicitClient : class { - var instrumented = GetInstrumentedData(client); + var instrumented = GetTopLevelClientInfo(client); return instrumented.Config.DeploymentOrThrow(client!.GetType().Name); } - private static AoaiTestBase.AzureOpenAiInstrumented GetInstrumentedData(TExplicitClient? client) + private static AoaiTestBase.TopLevelInfo GetTopLevelClientInfo(TExplicitClient? client) + where TExplicitClient : class { if (client == null) { throw new ArgumentNullException(nameof(client)); } - var testBase = TestExecutionContext.CurrentContext?.TestObject as AoaiTestBase; - if (testBase == null) - { - throw new InvalidOperationException("You are not currently in a NUnit test class that extends " + nameof(AoaiTestBase)); - } - - var instrumented = testBase._clientToTopLevel.FirstOrDefault(e => ReferenceEquals(client, e.Client)); - if (instrumented == null) - { - throw new ArgumentException($"The client was not properly instrumented ({client.GetType().Name})", nameof(client)); - } - - return instrumented; + return ((AoaiTestBase.TopLevelInfo?)(client as IAutoSyncAsync)?.Context) + ?? throw new ArgumentException( + $"The client was not properly wrapped for automatic sync/async ({client.GetType().Name})", + nameof(client)); } } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/JsonConfig.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/JsonConfig.cs index 1cc12b1b441c6..e7334b11fe8cf 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/JsonConfig.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/JsonConfig.cs @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests.Utils.Config; @@ -26,8 +25,8 @@ public class JsonConfig : IConfiguration public static readonly JsonSerializerOptions JSON_OPTIONS = new() { PropertyNameCaseInsensitive = true, - PropertyNamingPolicy = JsonHelpers.SnakeCaseLower, - DictionaryKeyPolicy = JsonHelpers.SnakeCaseLower, + PropertyNamingPolicy = JsonOptions.SnakeCaseLower, + DictionaryKeyPolicy = JsonOptions.SnakeCaseLower, WriteIndented = true, AllowTrailingCommas = true, #if NETFRAMEWORK diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/SanitizedJsonConfig.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/SanitizedJsonConfig.cs index 4d7450d5cf2a8..54e111aa7f8c4 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/SanitizedJsonConfig.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/SanitizedJsonConfig.cs @@ -1,14 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Text.Json; using System.Text.Json.Serialization; using System.Text.RegularExpressions; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests.Utils.Config { diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/DisableRecordingInterceptor.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/DisableRecordingInterceptor.cs deleted file mode 100644 index 61508161c66a2..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/DisableRecordingInterceptor.cs +++ /dev/null @@ -1,77 +0,0 @@ -#nullable enable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core.TestFramework; -using Castle.DynamicProxy; - -namespace Azure.AI.OpenAI.Tests.Utils -{ - public class DisableRecordingInterceptor : IInterceptor - { - private const string AsyncSuffix = "Async"; - private readonly List> _entries = new(); - private readonly Func _getRecording; - - public DisableRecordingInterceptor(Func getRecording) - { - _getRecording = getRecording ?? throw new ArgumentNullException(nameof(getRecording)); - } - - public TestRecording? Recording => _getRecording(); - - public void DisableBodyRecordingFor(string methodName) - { - _entries.Add(new(typeof(TClient), NormalizeMethodName(methodName), EntryRecordModel.RecordWithoutRequestBody)); - } - - public void DisableRecordingFor(string methodName) - { - _entries.Add(new(typeof(TClient), NormalizeMethodName(methodName), EntryRecordModel.RecordWithoutRequestBody)); - } - - public void Intercept(IInvocation invocation) - { - if (_entries.Count == 0) - { - invocation.Proceed(); - return; - } - - IDisposable? scoped = null; - try - { - string normalizedName = NormalizeMethodName(invocation.Method.Name); - var entry = _entries.FirstOrDefault(e => - e.Item1.IsAssignableFrom(invocation.TargetType) - && e.Item2 == normalizedName); - if (entry != null) - { - scoped = new TestRecording.DisableRecordingScope(Recording, entry.Item3); - } - - invocation.Proceed(); - } - finally - { - scoped?.Dispose(); - } - } - - private static string NormalizeMethodName(string methodName) - { - if (string.IsNullOrWhiteSpace(methodName)) - { - throw new ArgumentException("Method name cannot be null, empty, or white space.", nameof(methodName)); - } - - if (methodName.EndsWith(AsyncSuffix)) - { - return methodName.Substring(0, methodName.Length - AsyncSuffix.Length); - } - - return methodName; - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Extensions.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Extensions.cs index 14268277590d0..d25ef06b30cd0 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Extensions.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Extensions.cs @@ -1,155 +1,68 @@ -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; -#nullable enable +namespace Azure.AI.OpenAI.Tests.Utils; -namespace Azure.AI.OpenAI.Tests +/// +/// Helper extension methods. +/// +public static class Extensions { - internal static class Extensions + /// + /// Attempts to fill the buffer as much as possible from a stream. This will try to keep reading + /// until the buffer is filled, or the stream ends. + /// + /// The stream to read from. + /// The buffer to try to fill. + /// The number of bytes read. + public static int FillBuffer(this Stream stream, byte[] buffer) { -#if NETFRAMEWORK - public static TValue? GetValueOrDefault(this IReadOnlyDictionary dictionary, TKey key) - => GetValueOrDefault(dictionary, key, default(TValue)!); + if (stream == null) + throw new ArgumentNullException(nameof(stream)); + else if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); - public static TValue GetValueOrDefault(this IReadOnlyDictionary dictionary, TKey key, TValue defaultValue) + int totalRead = 0; + while (totalRead < buffer.Length) { - if (dictionary == null) - { - throw new ArgumentNullException(nameof(dictionary)); - } - - if (!dictionary.TryGetValue(key, out TValue? value)) + int read = stream.Read(buffer, totalRead, buffer.Length - totalRead); + if (read == 0) { - return defaultValue; + return totalRead; } - return value; + totalRead += read; } -#endif - - public static TValue? GetValueOrDefault(this IDictionary dictionary, TKey key) - => GetValueOrDefault(dictionary, key, default!); - - public static TValue? GetValueOrDefault(this IDictionary dictionary, TKey key, TValue defaultValue) - { - if (dictionary == null) - { - throw new ArgumentNullException(nameof(dictionary)); - } - - if (!dictionary.TryGetValue(key, out TValue? value)) - { - return defaultValue; - } - - return value; - } - - public static TValue? GetValueOrDefault(this Dictionary dictionary, TKey key) where TKey : notnull - => ((IReadOnlyDictionary)dictionary).GetValueOrDefault(key); - - public static TValue? GetValueOrDefault(this Dictionary dictionary, TKey key, TValue defaultValue) where TKey : notnull - => ((IReadOnlyDictionary)dictionary).GetValueOrDefault(key, defaultValue); - - public static TValue GetOrAdd(this IDictionary dictionary, TKey key, Func valueFactory) - { - if (dictionary == null) - { - throw new ArgumentNullException(nameof(dictionary)); - } - - if (!dictionary.TryGetValue(key, out TValue? value)) - { - value = valueFactory(key); - dictionary[key] = value; - } - - return value!; - } - - public static string? GetFirstValueOrDefault(this PipelineRequestHeaders headers, string key) - { - IEnumerable? values = null; - if (key != null) - { - headers?.TryGetValues(key, out values); - } - return values?.FirstOrDefault(v => v != null) - ?? null; - } - - public static string? GetFirstValueOrDefault(this PipelineResponseHeaders headers, string key) - { - IEnumerable? values = null; - if (key != null) - { - headers?.TryGetValues(key, out values); - } - - return values?.FirstOrDefault(v => v != null) - ?? null; - } - - public static ValueTask FirstOrDefaultAsync(this IAsyncEnumerable enumerable) - => FirstOrDefaultAsync(enumerable, _ => true); - - public static async ValueTask FirstOrDefaultAsync(this IAsyncEnumerable enumerable, Predicate predicate) - { - await foreach (T item in enumerable) - { - if (predicate(item)) - { - return item; - } - } + return totalRead; + } - return default!; - } + /// + /// Pads the current instance with the specified character on the left. + /// + /// The string builder instance + /// The total width we want the string builder to be + /// The padding characters + /// The same builder for chaining, with any needed padding. + public static StringBuilder PadRight(this StringBuilder builder, int totalWidth, char paddingChar = ' ') + { + if (builder == null) + throw new ArgumentNullException(nameof(builder)); + else if (totalWidth < 0) + throw new ArgumentOutOfRangeException(nameof(totalWidth), "Total width must be greater than or equal to 0."); + else if (totalWidth == 0) + return builder; - public static int FillBuffer(this Stream stream, byte[] buffer) + int padding = totalWidth - builder.Length; + if (padding > 0) { - if (stream == null) - throw new ArgumentNullException(nameof(stream)); - else if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - int totalRead = 0; - while (totalRead < buffer.Length) - { - int read = stream.Read(buffer, totalRead, buffer.Length - totalRead); - if (read == 0) - { - return totalRead; - } - - totalRead += read; - } - - return totalRead; + builder.Append(paddingChar, padding); } - public static StringBuilder PadRight(this StringBuilder builder, int totalWidth, char paddingChar = ' ') - { - if (builder == null) - throw new ArgumentNullException(nameof(builder)); - else if (totalWidth < 0) - throw new ArgumentOutOfRangeException(nameof(totalWidth), "Total width must be greater than or equal to 0."); - else if (totalWidth == 0) - return builder; - - int padding = totalWidth - builder.Length; - if (padding > 0) - { - builder.Append(paddingChar, padding); - } - - return builder; - } + return builder; } } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/JsonHelpers.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/JsonOptions.cs similarity index 67% rename from sdk/openai/Azure.AI.OpenAI/tests/Utils/JsonHelpers.cs rename to sdk/openai/Azure.AI.OpenAI/tests/Utils/JsonOptions.cs index b77c646eae81e..4489b016922ab 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/JsonHelpers.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/JsonOptions.cs @@ -1,7 +1,9 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.Buffers; using System.Globalization; -using System.IO; using System.Runtime.CompilerServices; using System.Text.Json; @@ -12,7 +14,7 @@ namespace Azure.AI.OpenAI.Tests.Utils; /// /// A helper class to make working with older versions of System.Text.Json simpler /// -internal static class JsonHelpers +public static class JsonOptions { // TODO FIXME once we update to newer versions of System.Text.JSon we should switch to using // JsonNamingPolicy.SnakeCaseLower @@ -46,80 +48,8 @@ internal static class JsonHelpers #endif }; - // TODO FIXME once we move to newer versions of System.Text.Json we can directly call - // JsonSerializer.Serialize(...) with a stream - public static void Serialize(Stream stream, T value, JsonSerializerOptions? options = null) - { -#if NETFRAMEWORK - using Utf8JsonWriter writer = new(stream, new JsonWriterOptions() - { - Encoder = options?.Encoder, - Indented = options?.WriteIndented == true, - SkipValidation = false - }); - - JsonSerializer.Serialize(writer, value, options); -#else - JsonSerializer.Serialize(stream, value, options); -#endif - } - -#if NET6_0_OR_GREATER - // .Net 6 and newer already have the extension method we need defined in JsonsSerializer -#else - // TODO FIXME once we move to newer versions of System.Text.Json we can directly use the - // JsonSerializer extension method for elements - public static T? Deserialize(this JsonElement element, JsonSerializerOptions? options = null) - { - using MemoryStream stream = new(); - using Utf8JsonWriter writer = new(stream, new() - { - Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping, - Indented = false, - SkipValidation = true - }); - element.WriteTo(writer); - writer.Flush(); - - stream.Seek(0, SeekOrigin.Begin); - if (((ulong)stream.Length & 0xffffffff00000000) != 0ul) - { - throw new ArgumentOutOfRangeException("JsonElement is too large"); - } - - ReadOnlySpan span = new(stream.GetBuffer(), 0, (int)stream.Length); - return JsonSerializer.Deserialize(span, options); - } -#endif - - public static T? Deserialize(Stream stream, JsonSerializerOptions? options = null) - { -#if NETFRAMEWORK - // For now let's keep it simple and load entire JSON bytes into memory - using MemoryStream buffer = new(); - stream.CopyTo(buffer); - - ReadOnlySpan jsonBytes = buffer.GetBuffer().AsSpan(0, (int)buffer.Length); - return JsonSerializer.Deserialize(jsonBytes, options); -#else - return JsonSerializer.Deserialize(stream, options); -#endif - } - - public static JsonElement SerializeToElement(T value, JsonSerializerOptions? options = null) - { -#if NET6_0_OR_GREATER - return JsonSerializer.SerializeToElement(value, options); -#else - using MemoryStream stream = new(); - Serialize(stream, value, options); - stream.Seek(0, SeekOrigin.Begin); - return JsonDocument.Parse(stream).RootElement; -#endif - } - // Ported over from the source code for newer versions of System.Text.Json - internal class SnakeCaseNamingPolicy : JsonNamingPolicy + private class SnakeCaseNamingPolicy : JsonNamingPolicy { private enum SeparatorState { diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/MockTokenCredential.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/MockTokenCredential.cs new file mode 100644 index 0000000000000..8615c0f07c00c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/MockTokenCredential.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// A mock token credential to be used for testing. +/// +public class MockTokenCredential : TokenCredential +{ + /// + /// Event raised when a token is requested. + /// + public event EventHandler? TokenRequested; + + /// + public override AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken) + { + TokenRequested?.Invoke(this, requestContext); + return new AccessToken("TEST TOKEN " + string.Join(",", requestContext.Scopes), DateTimeOffset.MaxValue); + } + + /// + public override ValueTask GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken) + { + return new(GetToken(requestContext, cancellationToken)); + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/CapturedMessage.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/CapturedMessage.cs deleted file mode 100644 index e03e7a16bfb40..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/CapturedMessage.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright(c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Http; - -namespace Azure.AI.OpenAI.Tests.Utils.Pipeline -{ - public abstract class CapturedMessage - { - public static readonly IReadOnlyDictionary> EMPTY = - new Dictionary>(); - - public IReadOnlyDictionary> Headers { get; init; } = EMPTY; - public BinaryData? Content { get; init; } - } - - public class CapturedResponse : CapturedMessage - { - public HttpStatusCode Status { get; init; } = HttpStatusCode.OK; - public string? ReasonPhrase { get; init; } = "OK"; - } - - public class CapturedRequest : CapturedMessage - { - public HttpMethod Method { get; init; } = HttpMethod.Get; - public Uri? Uri { get; init; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ClientRetryPolicyAdapter.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ClientRetryPolicyAdapter.cs deleted file mode 100644 index 63588c544f7e4..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ClientRetryPolicyAdapter.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.ClientModel.Primitives; -using System.Diagnostics; -using System.Reflection; -using System.Threading.Tasks; - -namespace Azure.AI.OpenAI.Tests.Utils.Pipeline; - -public class ClientRetryPolicyAdapter : ClientRetryPolicy -{ - private Func _getRetries; - - public ClientRetryPolicyAdapter(Core.RetryOptions options) - : base(options?.MaxRetries ?? 3) - { - Original = options ?? throw new ArgumentNullException(nameof(options)); - - // Of course, even reading the number of retries property on the PipelineMessage is internal only. - // So reflection it is - _getRetries = (Func) - (typeof(PipelineMessage).GetProperty("RetryCount", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance) - ?.GetGetMethod(true) - ?.CreateDelegate(typeof(Func)) - ?? throw new InvalidOperationException("Failed to get RetryCount property")); - } - - public Core.RetryOptions Original { get; } - - protected override TimeSpan GetNextDelay(PipelineMessage message, int tryCount) - { - TimeSpan delay = Original.Mode switch - { - Core.RetryMode.Fixed => Original.Delay, - Core.RetryMode.Exponential => TimeSpan.FromMilliseconds((1 << tryCount - 1) * Original.Delay.TotalMilliseconds), - _ => throw new InvalidOperationException("Unknown retry mode") - }; - - return delay <= Original.MaxDelay ? delay : Original.MaxDelay; - } - - protected override bool ShouldRetry(PipelineMessage message, Exception exception) - { - if (_getRetries(message) >= Original.MaxRetries) - { - return false; - } - - if (!message.ResponseClassifier.TryClassify(message, exception, out bool isRetriable) - && !PipelineMessageClassifier.Default.TryClassify(message, exception, out isRetriable)) - { - Debug.Assert(false, "Failed to classify message"); - } - - return isRetriable; - } - - protected override ValueTask ShouldRetryAsync(PipelineMessage message, Exception exception) - => new ValueTask(ShouldRetry(message, exception)); -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/MockPipeline.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/MockPipeline.cs deleted file mode 100644 index 11f60e5589d10..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/MockPipeline.cs +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright(c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Threading; -using System.Threading.Tasks; - -namespace Azure.AI.OpenAI.Tests.Utils.Pipeline -{ - /// - /// A pipeline that doesn't use the network. This captures all received requests, and allows you to specify a handler - /// that hand craft response messages. Can be useful for unit testing - /// - public class MockPipeline : IDisposable - { - public delegate CapturedResponse MessageHandlerAsyncDelegate(CapturedRequest request); - - private MessageHandlerAsyncDelegate _requestHandler; - private HttpClient _client; - private PipelineTransport _transport; - private List _requests; - private List _responses; - - /// - /// Creates a new instance - /// - /// (Optional) The handler to use to generate responses. Default returns an empty - /// response body with HTTP 204 - public MockPipeline(MessageHandlerAsyncDelegate? requestHandler = null) - { - _requestHandler = requestHandler ?? ReturnEmpty; - _client = new HttpClient(new DelegateMessageHandler(HandleRequest), true); - _transport = new HttpClientPipelineTransport(_client); - _requests = new List(); - _responses = new List(); - } - - /// - /// Event raised when a request is received - /// - public event EventHandler? OnRequest; - - /// - /// Event raised whena response is generated - /// - public event EventHandler? OnResponse; - - /// - /// The transport to pass to the your Azure clients - /// - public PipelineTransport Transport => _transport; - - /// - /// All received requests - /// - public IReadOnlyList Requests => _requests; - - /// - /// All generated responses - /// - public IReadOnlyList Responses => _responses; - - /// - /// Default handler that always returns an empty JSON payload as the response with the correct headers set - /// - /// The request - /// An empty successful JSON response - public static CapturedResponse ReturnEmptyJson(CapturedRequest request) - => new() - { - Status = HttpStatusCode.OK, - ReasonPhrase = "OK", - Content = BinaryData.FromString("{}"), - Headers = new Dictionary>() - { - [ "Content-Type" ] = [ "application/json" ], - [ "Content-Length"] = [ "2" ] - } - }; - - /// - /// Default handler that returns an empty HTTP 204 payload - /// - /// The request - /// An HTTP 204 empty response - public static CapturedResponse ReturnEmpty(CapturedRequest request) - => new() { Status = HttpStatusCode.NoContent }; - - /// - public void Dispose() - { - _client?.Dispose(); - } - - private CapturedResponse HandleRequest(CapturedRequest request) - { - List caught = new(); - - try - { - OnRequest?.Invoke(this, request); - } - catch (Exception ex) { caught.Add(ex); } - - _requests.Add(request); - - CapturedResponse? response = null; - try - { - response = _requestHandler(request); - } - catch (Exception ex) { caught.Add(ex); } - - if (response == null) - { - caught.Add(new ApplicationException("Got a null response to return")); - } - else try - { - OnResponse?.Invoke(this, response); - } - catch (Exception ex) { caught.Add(ex); } - - _responses.Add(response!); - - if (caught.Count > 0) - { - throw new AggregateException("Failed to process the request", caught); - } - - return response!; - } - - private class DelegateMessageHandler : HttpMessageHandler - { - private const string CONTENT_PREFIX = "Content-"; - private MessageHandlerAsyncDelegate _handler; - - public DelegateMessageHandler(MessageHandlerAsyncDelegate handler) - { - _handler = handler ?? throw new ArgumentNullException(nameof(handler)); - } - - protected -#if NET - override -#endif - HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) - { - CapturedRequest req = new() - { - Method = request.Method, - Uri = request.RequestUri!, - Headers = CopyHeaders(request.Headers, request.Content?.Headers), - Content = CopyContent(request.Content) - }; - - CapturedResponse res = _handler(req); - HttpResponseMessage response = new() - { - RequestMessage = request, - StatusCode = res.Status, - ReasonPhrase = res.ReasonPhrase, - Content = ToContent(res.Content, res.Headers), - }; - - foreach (var kvp in res.Headers.Where(h => h.Key?.StartsWith(CONTENT_PREFIX) == false)) - { - response.Headers.TryAddWithoutValidation(kvp.Key, kvp.Value); - } - - return response; - } - - protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) - => Task.FromResult(Send(request, cancellationToken)); - - private static IReadOnlyDictionary> CopyHeaders( - HttpHeaders header, HttpContentHeaders? contentHeaders) - { - Dictionary> dict = new(StringComparer.OrdinalIgnoreCase); - - foreach (var kvp in header) - { - dict[kvp.Key] = new List(kvp.Value); - } - - if (contentHeaders != null) - { - foreach (var kvp in contentHeaders) - { - var list = (List?)dict.GetValueOrDefault(kvp.Key); - if (list == null) - { - list = new List(); - dict[kvp.Key] = list; - } - - list.AddRange(kvp.Value); - } - } - - return dict; - } - - private static BinaryData CopyContent(HttpContent? content) - { - if (content == null) - { - return new BinaryData(Array.Empty()); - } - - using Stream stream = content.ReadAsStreamAsync().Result; - return BinaryData.FromStream(stream); - } - - private static HttpContent? ToContent(BinaryData? data, IReadOnlyDictionary> headers) - { - if (data == null) - { - return null; - } - - byte[] arr = data.ToArray(); - ByteArrayContent content = new(arr); - content.Headers.ContentLength = arr.LongLength; - foreach (var contentHeader in headers.Where(kvp => kvp.Key?.StartsWith(CONTENT_PREFIX) == true)) - { - content.Headers.TryAddWithoutValidation(contentHeader.Key, contentHeader.Value); - } - - return content; - } - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ProxyTransport.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ProxyTransport.cs deleted file mode 100644 index 277050956d419..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ProxyTransport.cs +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.ClientModel.Primitives; -using System.Net; -using System.Net.Http; -using System.Text.Json; -using System.Threading.Tasks; -using Azure.Core.TestFramework; - -namespace Azure.AI.OpenAI.Tests.Utils.Pipeline; - -/// -/// A re-implementation of Azure.Core.TestFramework.ProxyTransport but for the new System.ClientModel pipeline types -/// -public class ProxyTransport : PipelineTransport -{ - private const string DevCertIssuer = "CN=localhost"; - private const string FiddlerCertIssuer = "CN=DO_NOT_TRUST_FiddlerRoot, O=DO_NOT_TRUST, OU=Created by http://www.fiddler2.com"; - - private readonly Func _filter; - private readonly string _proxyHost; - - // The common test code makes liberal use of internals in several places. That will not stop me... - private readonly NonPublic.Accessor _recordingHasRequests = - NonPublic.FromProperty(nameof(TestRecording.HasRequests)); - private readonly NonPublic.Accessor _recordingMismatch = - NonPublic.FromField("MismatchException"); - - public ProxyTransport(TestProxy proxy, TestRecording recording, Func filter) - { - Proxy = proxy ?? throw new ArgumentNullException(nameof(proxy)); - Recording = recording ?? throw new ArgumentNullException(nameof(recording)); - _filter = filter ?? throw new ArgumentNullException(nameof(filter)); - - string certIssuer; - if (UseFiddler()) - { - certIssuer = FiddlerCertIssuer; - _proxyHost = "ipv4.fiddler"; - } - else - { - certIssuer = DevCertIssuer; - _proxyHost = TestProxy.IpAddress; - } - - HttpClientHandler handler = new() - { - ServerCertificateCustomValidationCallback = (_, certificate, _, _) => certificate?.Issuer == certIssuer, - UseCookies = false, - AllowAutoRedirect = false - }; - - InnerTransport = new HttpClientPipelineTransport(new HttpClient(handler)); - } - - protected PipelineTransport InnerTransport { get; } - - protected TestProxy Proxy { get; } - - protected TestRecording Recording { get; } - - protected override PipelineMessage CreateMessageCore() - { - Exception? ex = _recordingMismatch.Get(Recording); - if (ex != null) - { - throw ex; - } - - PipelineMessage message = InnerTransport.CreateMessage(); - PipelineRequest request = message.Request; - _recordingHasRequests.Set(Recording, true); - - string requestId; - lock (Recording.Random) - { - if (Recording.UseDefaultGuidFormatForClientRequestId) - { - // User want the client format to use the default format - requestId = Recording.Random.NewGuid().ToString(); - } - else - { - // Make sure ClientRequestId are the same across request and response - requestId = Recording.Random.NewGuid().ToString("N"); - } - } - - // PipelineRequest no longer has a ClientRequestId property, so we need to set it on the headers directly - request.Headers.Add("x-ms-client-request-id", requestId); - - return message; - } - - protected override void ProcessCore(PipelineMessage message) - => ProcessCoreSyncOrAsync(message, async: false).GetAwaiter().GetResult(); - - protected override ValueTask ProcessCoreAsync(PipelineMessage message) - => ProcessCoreSyncOrAsync(message, async: true); - - protected virtual async ValueTask ProcessCoreSyncOrAsync(PipelineMessage message, bool async) - { - if (Recording.Mode == RecordedTestMode.Playback && _filter() == EntryRecordModel.DoNotRecord) - { - throw new InvalidOperationException( - "Operations that are enclosed in a 'TestRecording.DisableRecordingScope' created with the 'DisableRecording' method should not be executed in Playback mode." + - "Instead, update the test to skip the operation when in Playback mode by checking the 'Mode' property of 'RecordedTestBase'."); - } - try - { - RedirectToTestProxy(message); - if (async) - { - await InnerTransport.ProcessAsync(message).ConfigureAwait(false); - } - else - { - InnerTransport.Process(message); - } - - await ProcessResponseSyncAsync(message, true).ConfigureAwait(false); - } - finally - { - // revert the original URI - this is important for tests that rely on aspects of the URI in the pipeline - // e.g. KeyVault caches tokens based on URI - message.Request.Headers.TryGetValue("x-recording-upstream-base-uri", out string? original); - if (message.Request.Uri is null) - { - throw new InvalidOperationException("The request cannot have a null URI"); - } - if (original == null) - { - throw new InvalidOperationException("The TestProxy response did not contain the expected \"x-recording-upstream-base-uri\" header"); - } - - var originalBaseUri = new Uri(original); - var builder = new UriBuilder(message.Request.Uri); - builder.Scheme = originalBaseUri.Scheme; - builder.Host = originalBaseUri.Host; - builder.Port = originalBaseUri.Port; - - message.Request.Uri = builder.Uri; - } - } - - protected virtual async ValueTask ProcessResponseSyncAsync(PipelineMessage message, bool async) - { - if (message.Response?.Headers.TryGetValues("x-request-mismatch", out _) == true) - { - if (message.Response.ContentStream == null) - { - throw new TestRecordingMismatchException("Detected a mismatch but the response had no body"); - } - - using var doc = async - ? await JsonDocument.ParseAsync(message.Response.ContentStream).ConfigureAwait(false) - : JsonDocument.Parse(message.Response.ContentStream); - throw new TestRecordingMismatchException(doc.RootElement.GetProperty("Message").GetString()); - } - } - - // copied from https://github.com/Azure/azure-sdk-for-net/blob/main/common/Perf/Azure.Test.Perf/TestProxyPolicy.cs - protected virtual void RedirectToTestProxy(PipelineMessage message) - { - if (Recording.Mode == RecordedTestMode.Record) - { - switch (_filter()) - { - case EntryRecordModel.Record: - break; - case EntryRecordModel.RecordWithoutRequestBody: - message.Request.Headers.Set("x-recording-skip", "request-body"); - break; - case EntryRecordModel.DoNotRecord: - message.Request.Headers.Set("x-recording-skip", "request-response"); - break; - } - } - else if (Recording.Mode == RecordedTestMode.Playback) - { - if (_filter() == EntryRecordModel.RecordWithoutRequestBody) - { - message.Request.Content = null; - } - } - - var request = message.Request; - request.Headers.Set("x-recording-id", Recording.RecordingId); - request.Headers.Set("x-recording-mode", Recording.Mode.ToString().ToLower()); - - if (request.Uri is null) - { - throw new InvalidOperationException("Request URI cannot be null"); - } - - // Intentionally reset the upstream URI in case the request URI changes between retries - e.g. when using GeoRedundant secondary Storage - var builder = new UriBuilder() - { - Scheme = request.Uri.Scheme, - Host = request.Uri.Host, - Port = request.Uri.Port, - }; - - request.Headers.Set("x-recording-upstream-base-uri", builder.ToString()); - - builder = new(request.Uri); - builder.Host = _proxyHost; - builder.Port = request.Uri.Scheme == "https" ? Proxy.ProxyPortHttps!.Value : Proxy.ProxyPortHttp!.Value; - - request.Uri = builder.Uri; - } - - private static bool UseFiddler() - { - // Of course TestEnvironment.EnableFiddler is internal only so reproduce the code here - string? enableFiddlerStr = TestContext.Parameters["EnableFiddler"] - ?? Environment.GetEnvironmentVariable("AZURE_ENABLE_FIDDLER"); - - if (bool.TryParse(enableFiddlerStr, out bool enableFiddler)) - { - return enableFiddler; - } - - // Try to detect if there is a current proxy set and it is Fiddler - try - { - Uri dummyUri = new("https://not.a.real.uri.com"); - - IWebProxy webProxy = WebRequest.GetSystemWebProxy(); - Uri? proxyUri = webProxy?.GetProxy(dummyUri); - if (proxyUri == null || proxyUri == dummyUri) - { - return false; - } - - // assume default of 127.0.0.1:8888 with no credentials - var cred = webProxy?.Credentials?.GetCredential(dummyUri, string.Empty); - return proxyUri.Host == "127.0.0.1" - && proxyUri.Port == 8888 - && string.IsNullOrWhiteSpace(cred?.UserName) - && string.IsNullOrWhiteSpace(cred?.Password); - } - catch - { - return false; - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncCollectionResult.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncCollectionResult.cs deleted file mode 100644 index 3b0d4c799deb7..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncCollectionResult.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.ClientModel; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Runtime.ExceptionServices; -using System.Threading; - -namespace Azure.AI.OpenAI.Tests.Utils; - -/// -/// An adapter to make a look and work like a . This -/// simplifies writing test cases -/// -/// The type of the items the enumerator returns -public class SyncToAsyncCollectionResult : AsyncCollectionResult -{ - private bool _responseSet; - private CollectionResult? _syncCollection; - private Exception? _ex; - - /// - /// Creates a new instance - /// - /// The synchronous collection to wrap - /// If the collection was null - public SyncToAsyncCollectionResult(CollectionResult syncCollection) - { - _syncCollection = syncCollection ?? throw new ArgumentNullException(nameof(syncCollection)); - TrySetRawResponse(); - } - - /// - /// Creates a new instance. - /// - /// The exception to throw. - /// If the exception was null. - public SyncToAsyncCollectionResult(Exception ex) - { - _ex = ex ?? throw new ArgumentNullException(nameof(ex)); - _syncCollection = null; - } - - /// - public override IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) - { - return InnerEnumerable(cancellationToken).GetAsyncEnumerator(); - } - - private async IAsyncEnumerable InnerEnumerable([EnumeratorCancellation] CancellationToken cancellationToken = default) - { - if (_ex != null) - { - ExceptionDispatchInfo.Capture(_ex).Throw(); - } - - var asyncWrapper = new SyncToAsyncEnumerator(_syncCollection?.GetEnumerator()!, cancellationToken); - while (await asyncWrapper.MoveNextAsync().ConfigureAwait(false)) - { - TrySetRawResponse(); - yield return asyncWrapper.Current; - } - } - - private void TrySetRawResponse() - { - if (_responseSet) - { - return; - } - - // Client result doesn't provide virtual methods so we have to manually set it ourselves here - try - { - var raw = _syncCollection?.GetRawResponse(); - if (raw != null) - { - SetRawResponse(raw); - _responseSet = true; - } - } - catch (Exception) { /* dont' care */ } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncEnumerator.cs deleted file mode 100644 index 64ab0d6d63027..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncEnumerator.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.ExceptionServices; -using System.Threading; -using System.Threading.Tasks; - -namespace Azure.AI.OpenAI.Tests.Utils -{ - /// - /// Wraps an as an - /// - /// The type of items being enumerated. - public class SyncToAsyncEnumerator : IAsyncEnumerator - { - private IEnumerator _sync; - private CancellationToken _token; - private Exception? _ex; - - /// - /// Creates a new instance. - /// - /// The synchronous enumerator to wrap. - /// (Optional) The cancellation token to use. - /// If the enumerator was null. - public SyncToAsyncEnumerator(IEnumerator sync, CancellationToken token = default) - { - _sync = sync ?? throw new ArgumentNullException(nameof(sync)); - _token = token; - } - - /// - /// Creates a new instance. - /// - /// The exception to throw. - /// If the exception was null. - public SyncToAsyncEnumerator(Exception ex) - { - _sync = Enumerable.Empty().GetEnumerator(); - _token = default; - _ex = ex ?? throw new ArgumentNullException(nameof(ex)); - } - - /// - public T Current => _sync.Current; - - /// - public ValueTask DisposeAsync() - { - _sync.Dispose(); - return default; - } - - /// - public ValueTask MoveNextAsync() - { - if (_ex != null) - { - ExceptionDispatchInfo.Capture(_ex).Throw(); - } - - _token.ThrowIfCancellationRequested(); - bool ret = _sync.MoveNext(); - return new ValueTask(ret); - } - } - -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageCollection.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageCollection.cs deleted file mode 100644 index 9f73b587f267e..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageCollection.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.ClientModel; -using System.Collections.Generic; -using System.Runtime.ExceptionServices; -using System.Threading.Tasks; -using System.Threading; - -namespace Azure.AI.OpenAI.Tests.Utils; - -/// -/// An adapter to make a look and work like a . This -/// simplifies writing test cases. -/// -/// The type of the items the enumerator returns. -public class SyncToAsyncPageCollection : AsyncPageCollection -{ - private PageCollection? _syncCollection; - private Exception? _ex; - - /// - /// Creates a new instance. - /// - /// The synchronous collection to wrap. - /// If the collection was null. - public SyncToAsyncPageCollection(PageCollection syncCollection) - { - _syncCollection = syncCollection ?? throw new ArgumentNullException(nameof(syncCollection)); - } - - /// - /// Creates a new instance. - /// - /// The exception to throw. - /// If the exception was null. - public SyncToAsyncPageCollection(Exception ex) - { - _ex = ex ?? throw new ArgumentNullException(nameof(ex)); - _syncCollection = null; - } - - /// - protected override Task> GetCurrentPageAsyncCore() - { - if (_ex != null) - { - return Task.FromException>(_ex); - } - else - { - return Task.FromResult(_syncCollection!.GetCurrentPage()); - } - } - - /// - protected override async IAsyncEnumerator> GetAsyncEnumeratorCore(CancellationToken cancellationToken = default) - { - if (_ex != null) - { - ExceptionDispatchInfo.Capture(_ex).Throw(); - } - - foreach (PageResult page in _syncCollection!) - { - await Task.Delay(0).ConfigureAwait(false); - yield return page; - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestConfig.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestConfig.cs index fd90099744d2a..5b999e1182ec8 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestConfig.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestConfig.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; using System.IO; @@ -10,9 +8,9 @@ using System.Reflection; using System.Text; using System.Text.Json; -using Azure.AI.OpenAI.Tests.Utils; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.Core.TestFramework; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestPipelinePolicy.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestPipelinePolicy.cs deleted file mode 100644 index 66f8ffd3294f5..0000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestPipelinePolicy.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace OpenAI.Tests; - -internal partial class TestPipelinePolicy : PipelinePolicy -{ - private readonly Action _processRequestAction; - private readonly Action _processResponseAction; - - public TestPipelinePolicy(Action requestAction, Action responseAction) - { - _processRequestAction = requestAction; - _processResponseAction = responseAction; - } - - public override void Process(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) - { - _processRequestAction?.Invoke(message?.Request); - ProcessNext(message, pipeline, currentIndex); - _processResponseAction?.Invoke(message?.Response); - } - - public override async ValueTask ProcessAsync(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) - { - _processRequestAction?.Invoke(message?.Request); - await ProcessNextAsync(message, pipeline, currentIndex); - _processResponseAction?.Invoke(message?.Response); - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs index 770a1cd253997..cb6dc8e17ead8 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs @@ -10,15 +10,14 @@ using System.Threading; using System.Threading.Tasks; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.Core.TestFramework; +using NUnit.Framework; using OpenAI; using OpenAI.Files; +using OpenAI.TestFramework; using OpenAI.VectorStores; namespace Azure.AI.OpenAI.Tests; -#pragma warning disable OPENAI001 - public class VectorStoreTests : AoaiTestBase { public VectorStoreTests(bool isAsync) : base(isAsync) @@ -111,10 +110,7 @@ public async Task CanEnumerateVectorStores() Assert.That(vectorStore.Name, Is.EqualTo($"Test Vector Store {i}")); } - - AsyncPageCollection response = SyncOrAsync(client, - c => c.GetVectorStores(new VectorStoreCollectionOptions() { Order = ListOrder.NewestFirst }), - c => c.GetVectorStoresAsync(new VectorStoreCollectionOptions() { Order = ListOrder.NewestFirst })); + AsyncPageCollection response = client.GetVectorStoresAsync(new VectorStoreCollectionOptions() { Order = ListOrder.NewestFirst }); Assert.That(response, Is.Not.Null); int lastIdSeen = int.MaxValue; @@ -169,9 +165,7 @@ public async Task CanAssociateFiles() Thread.Sleep(1000); int count = 0; - AsyncPageCollection response = SyncOrAsync(client, - c => c.GetFileAssociations(vectorStore), - c => c.GetFileAssociationsAsync(vectorStore)); + AsyncPageCollection response = client.GetFileAssociationsAsync(vectorStore); await foreach (VectorStoreFileAssociation association in response.GetAllValuesAsync()) { count++; @@ -205,9 +199,7 @@ public async Task CanUseBatchIngestion() b => b.Status != VectorStoreBatchFileJobStatus.InProgress); Assert.That(batchJob.Status, Is.EqualTo(VectorStoreBatchFileJobStatus.Completed)); - AsyncPageCollection response = SyncOrAsync(client, - c => c.GetFileAssociations(batchJob), - c => c.GetFileAssociationsAsync(batchJob)); + AsyncPageCollection response = client.GetFileAssociationsAsync(batchJob); await foreach (VectorStoreFileAssociation association in response.GetAllValuesAsync()) { Assert.Multiple(() => diff --git a/sdk/openai/tools/TestFramework/src/Utils/Extensions.cs b/sdk/openai/tools/TestFramework/src/Utils/Extensions.cs index 333febdafad3a..437e8dc05b7a7 100644 --- a/sdk/openai/tools/TestFramework/src/Utils/Extensions.cs +++ b/sdk/openai/tools/TestFramework/src/Utils/Extensions.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.ClientModel; using System.ClientModel.Primitives; using System.Diagnostics; @@ -300,6 +301,23 @@ public static async Task> ToListAsync(this IAsyncEnumerable asyncE } return list; } + + /// + /// Converts an async enumerable of pages to a asynchronously. + /// + /// The type of the elements in the enumerable. + /// The to convert. + /// The cancellation token. + /// Asynchronous task to do the conversion. + public static async Task> ToListAsync(this IAsyncEnumerable> pageAsyncEnumerable, CancellationToken token = default) + { + List list = new List(); + await foreach(PageResult page in pageAsyncEnumerable.WithCancellation(token)) + { + list.AddRange(page.Values); + } + return list; + } } /// From 2c537d32f7182c193a1589d43cb1c6cbdcddc47f Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Mon, 26 Aug 2024 23:48:27 -0400 Subject: [PATCH 32/71] Compute update with 2024-03-02 DiskRP and 2024-07-01 ComputeRP updates (#45150) * update autorest * Revert "update autorest" This reverts commit 42ddf54dab7c3e58ad864cdd6fc4605f671dea1d. * update autorest * generated code and samples * export api * test and changelog * changelog CI failure * update commit ID to include 2024-07-01, * push * customizations * export api * new test recordings * changelog --------- Co-authored-by: Theodore Chang --- .../CHANGELOG.md | 12 +- ....ResourceManager.Compute.netstandard2.0.cs | 102 +++++- .../Azure.ResourceManager.Compute/assets.json | 2 +- .../Sample_AvailabilitySetCollection.cs | 58 ++- .../Samples/Sample_AvailabilitySetResource.cs | 18 +- .../Sample_CapacityReservationCollection.cs | 10 +- ...mple_CapacityReservationGroupCollection.cs | 10 +- ...Sample_CapacityReservationGroupResource.cs | 14 +- .../Sample_CapacityReservationResource.cs | 10 +- ...putePrivateEndpointConnectionCollection.cs | 10 +- ...omputePrivateEndpointConnectionResource.cs | 6 +- .../Samples/Sample_DedicatedHostCollection.cs | 12 +- .../Sample_DedicatedHostGroupCollection.cs | 20 +- .../Sample_DedicatedHostGroupResource.cs | 16 +- .../Samples/Sample_DedicatedHostResource.cs | 18 +- .../Samples/Sample_DiskAccessCollection.cs | 16 +- .../Samples/Sample_DiskAccessResource.cs | 12 +- .../Sample_DiskEncryptionSetCollection.cs | 20 +- .../Sample_DiskEncryptionSetResource.cs | 16 +- .../Samples/Sample_DiskImageCollection.cs | 28 +- .../Samples/Sample_DiskImageResource.cs | 10 +- .../Sample_DiskRestorePointCollection.cs | 14 +- .../Sample_DiskRestorePointResource.cs | 8 +- .../Samples/Sample_ManagedDiskCollection.cs | 58 +-- .../Samples/Sample_ManagedDiskResource.cs | 32 +- ...ample_ProximityPlacementGroupCollection.cs | 10 +- .../Sample_ProximityPlacementGroupResource.cs | 8 +- .../Samples/Sample_RestorePointCollection.cs | 16 +- .../Sample_RestorePointGroupCollection.cs | 18 +- .../Sample_RestorePointGroupResource.cs | 14 +- .../Samples/Sample_RestorePointResource.cs | 12 +- .../Samples/Sample_SnapshotCollection.cs | 26 +- .../Samples/Sample_SnapshotResource.cs | 16 +- .../Samples/Sample_SshPublicKeyCollection.cs | 12 +- .../Samples/Sample_SshPublicKeyResource.cs | 22 +- .../Sample_SubscriptionResourceExtensions.cs | 56 +-- .../Sample_VirtualMachineCollection.cs | 126 +++---- ...ample_VirtualMachineExtensionCollection.cs | 20 +- ..._VirtualMachineExtensionImageCollection.cs | 20 +- ...le_VirtualMachineExtensionImageResource.cs | 4 +- .../Sample_VirtualMachineExtensionResource.cs | 10 +- .../Samples/Sample_VirtualMachineResource.cs | 80 ++-- ...mple_VirtualMachineRunCommandCollection.cs | 10 +- ...Sample_VirtualMachineRunCommandResource.cs | 10 +- ...Sample_VirtualMachineScaleSetCollection.cs | 342 ++++++++++++++---- ...rtualMachineScaleSetExtensionCollection.cs | 20 +- ...VirtualMachineScaleSetExtensionResource.cs | 12 +- .../Sample_VirtualMachineScaleSetResource.cs | 104 +++--- ...alMachineScaleSetRollingUpgradeResource.cs | 4 +- ...mple_VirtualMachineScaleSetVmCollection.cs | 20 +- ...ualMachineScaleSetVmExtensionCollection.cs | 10 +- ...rtualMachineScaleSetVmExtensionResource.cs | 6 +- ...Sample_VirtualMachineScaleSetVmResource.cs | 56 +-- ...alMachineScaleSetVmRunCommandCollection.cs | 10 +- ...tualMachineScaleSetVmRunCommandResource.cs | 6 +- .../src/Azure.ResourceManager.Compute.csproj | 2 +- .../ComputeSecurityPostureReference.cs.cs | 32 ++ .../Customize/Models/WindowsConfiguration.cs | 3 + .../src/Generated/ArmComputeModelFactory.cs | 266 ++++++++++---- .../Generated/AvailabilitySetCollection.cs | 20 +- .../AvailabilitySetData.Serialization.cs | 16 + .../src/Generated/AvailabilitySetData.cs | 6 +- .../src/Generated/AvailabilitySetResource.cs | 28 +- .../CapacityReservationCollection.cs | 20 +- .../CapacityReservationGroupCollection.cs | 20 +- .../Generated/CapacityReservationGroupData.cs | 6 +- .../CapacityReservationGroupResource.cs | 28 +- .../Generated/CapacityReservationResource.cs | 24 +- ...putePrivateEndpointConnectionCollection.cs | 20 +- ...omputePrivateEndpointConnectionResource.cs | 12 +- .../src/Generated/DedicatedHostCollection.cs | 20 +- .../Generated/DedicatedHostGroupCollection.cs | 20 +- .../Generated/DedicatedHostGroupResource.cs | 28 +- .../src/Generated/DedicatedHostResource.cs | 36 +- .../src/Generated/DiskAccessCollection.cs | 20 +- .../src/Generated/DiskAccessResource.cs | 32 +- .../Generated/DiskEncryptionSetCollection.cs | 20 +- .../Generated/DiskEncryptionSetResource.cs | 28 +- .../src/Generated/DiskImageCollection.cs | 20 +- .../src/Generated/DiskImageResource.cs | 24 +- .../Generated/DiskRestorePointCollection.cs | 16 +- .../DiskRestorePointData.Serialization.cs | 16 + .../src/Generated/DiskRestorePointData.cs | 6 +- .../src/Generated/DiskRestorePointResource.cs | 12 +- .../Generated/Extensions/ComputeExtensions.cs | 184 +++++----- .../MockableComputeResourceGroupResource.cs | 52 +-- .../MockableComputeSubscriptionResource.cs | 132 +++---- .../src/Generated/ManagedDiskCollection.cs | 20 +- .../src/Generated/ManagedDiskResource.cs | 32 +- .../AvailabilitySetPatch.Serialization.cs | 18 +- .../Generated/Models/AvailabilitySetPatch.cs | 6 +- .../CapacityReservationGroupInstanceView.cs | 4 +- .../Models/CapacityReservationGroupPatch.cs | 6 +- .../Models/ComputeAllocationStrategy.cs | 51 +++ ...eSecurityPostureReference.Serialization.cs | 40 +- .../Models/ComputeSecurityPostureReference.cs | 29 +- .../Models/ComputeSkuProfile.Serialization.cs | 151 ++++++++ .../src/Generated/Models/ComputeSkuProfile.cs | 70 ++++ .../ComputeSkuProfileVmSize.Serialization.cs | 122 +++++++ .../Models/ComputeSkuProfileVmSize.cs | 65 ++++ .../Generated/Models/DiskDetachOptionType.cs | 2 +- .../Generated/Models/ProxyAgentSettings.cs | 2 +- .../Models/ResourceSharingProfile.cs | 4 +- ...ityPostureReferenceUpdate.Serialization.cs | 162 +++++++++ .../Models/SecurityPostureReferenceUpdate.cs | 74 ++++ .../src/Generated/Models/SecurityProfile.cs | 4 +- ...rtualMachineScaleSetPatch.Serialization.cs | 60 ++- .../Models/VirtualMachineScaleSetPatch.cs | 15 +- ...neScaleSetUpdateVmProfile.Serialization.cs | 16 + .../VirtualMachineScaleSetUpdateVmProfile.cs | 6 +- .../Models/VirtualMachineScaleSetVmProfile.cs | 8 +- .../WindowsConfiguration.Serialization.cs | 2 +- .../Generated/Models/WindowsConfiguration.cs | 5 +- .../ZonalPlatformFaultDomainAlignMode.cs | 51 +++ .../ProximityPlacementGroupCollection.cs | 20 +- .../ProximityPlacementGroupResource.cs | 24 +- .../AvailabilitySetsRestOperations.cs | 2 +- ...CapacityReservationGroupsRestOperations.cs | 2 +- .../CapacityReservationsRestOperations.cs | 2 +- .../DedicatedHostGroupsRestOperations.cs | 2 +- .../DedicatedHostsRestOperations.cs | 2 +- .../DiskAccessesRestOperations.cs | 2 +- .../DiskEncryptionSetsRestOperations.cs | 2 +- .../DiskRestorePointRestOperations.cs | 2 +- .../RestOperations/DisksRestOperations.cs | 2 +- .../RestOperations/ImagesRestOperations.cs | 2 +- .../LogAnalyticsRestOperations.cs | 2 +- .../ProximityPlacementGroupsRestOperations.cs | 2 +- .../RestorePointCollectionsRestOperations.cs | 2 +- .../RestorePointsRestOperations.cs | 2 +- .../RestOperations/SnapshotsRestOperations.cs | 2 +- .../SshPublicKeysRestOperations.cs | 2 +- .../RestOperations/UsageRestOperations.cs | 2 +- ...ualMachineExtensionImagesRestOperations.cs | 2 +- .../VirtualMachineExtensionsRestOperations.cs | 2 +- ...tualMachineImagesEdgeZoneRestOperations.cs | 2 +- .../VirtualMachineImagesRestOperations.cs | 2 +- ...VirtualMachineRunCommandsRestOperations.cs | 2 +- ...MachineScaleSetExtensionsRestOperations.cs | 2 +- ...neScaleSetRollingUpgradesRestOperations.cs | 2 +- ...chineScaleSetVMExtensionsRestOperations.cs | 2 +- ...hineScaleSetVMRunCommandsRestOperations.cs | 2 +- ...VirtualMachineScaleSetVMsRestOperations.cs | 2 +- .../VirtualMachineScaleSetsRestOperations.cs | 2 +- .../VirtualMachineSizesRestOperations.cs | 2 +- .../VirtualMachinesRestOperations.cs | 6 +- .../src/Generated/RestorePointCollection.cs | 16 +- .../Generated/RestorePointGroupCollection.cs | 20 +- .../Generated/RestorePointGroupResource.cs | 28 +- .../src/Generated/RestorePointResource.cs | 16 +- .../src/Generated/SnapshotCollection.cs | 20 +- .../src/Generated/SnapshotResource.cs | 32 +- .../src/Generated/SshPublicKeyCollection.cs | 20 +- .../src/Generated/SshPublicKeyResource.cs | 28 +- .../src/Generated/VirtualMachineCollection.cs | 20 +- .../VirtualMachineExtensionCollection.cs | 20 +- .../VirtualMachineExtensionImageCollection.cs | 20 +- .../VirtualMachineExtensionImageResource.cs | 4 +- .../VirtualMachineExtensionResource.cs | 24 +- .../src/Generated/VirtualMachineResource.cs | 112 +++--- .../VirtualMachineRunCommandCollection.cs | 20 +- .../VirtualMachineRunCommandResource.cs | 24 +- .../VirtualMachineScaleSetCollection.cs | 20 +- ...irtualMachineScaleSetData.Serialization.cs | 32 ++ .../Generated/VirtualMachineScaleSetData.cs | 14 +- ...rtualMachineScaleSetExtensionCollection.cs | 20 +- ...VirtualMachineScaleSetExtensionResource.cs | 12 +- .../VirtualMachineScaleSetResource.cs | 116 +++--- ...alMachineScaleSetRollingUpgradeResource.cs | 4 +- .../VirtualMachineScaleSetVmCollection.cs | 20 +- .../Generated/VirtualMachineScaleSetVmData.cs | 8 +- ...ualMachineScaleSetVmExtensionCollection.cs | 20 +- ...rtualMachineScaleSetVmExtensionResource.cs | 12 +- .../VirtualMachineScaleSetVmResource.cs | 88 ++--- ...alMachineScaleSetVmRunCommandCollection.cs | 20 +- ...tualMachineScaleSetVmRunCommandResource.cs | 24 +- .../src/autorest.md | 8 +- .../Scenario/ManagedDiskCollectionTests.cs | 2 +- .../Scenario/ManagedDiskOperationsTests.cs | 2 +- 179 files changed, 3123 insertions(+), 1637 deletions(-) create mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/ComputeSecurityPostureReference.cs.cs create mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeAllocationStrategy.cs create mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.Serialization.cs create mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.cs create mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.Serialization.cs create mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.cs create mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.Serialization.cs create mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.cs create mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ZonalPlatformFaultDomainAlignMode.cs diff --git a/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md b/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md index 5cc92772446aa..85ac476801721 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md +++ b/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md @@ -1,14 +1,18 @@ # Release History -## 1.6.0-beta.1 (Unreleased) +## 1.6.0 (2024-08-26) ### Features Added -### Breaking Changes +- Added a new read-only property `LogicalSectorSize` to `DiskRestorePointData` class. +- Added new properties `SkuProfile` and `ZonalPlatformFaultDomainAlignMode` to `VirtualMachineScaleSetData` class. +- Added new properties `Zones`, `ZonalPlatformFaultDomainAlignMode`, and `SkuProfile` to `VirtualMachineScaleSetPatch` class. +- Added a new property `ScheduledEventsPolicy` to `AvailabilitySetPatch` and `AvailabilitySetData` class. -### Bugs Fixed +### Breaking Changes -### Other Changes +- `ExcludeExtensions` property in `ComputeSecurityPostureReference` is replaced by `ExcludeExtensionNames` property which takes in a list of strings. +- `IsVmAgentPlatformUpdatesEnabled` property in `WindowsConfiguration` class is now read-only. ## 1.5.0 (2024-05-10) diff --git a/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs b/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs index 44e614e1003da..903d9f114b7b1 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs @@ -23,6 +23,7 @@ public AvailabilitySetData(Azure.Core.AzureLocation location) { } public int? PlatformFaultDomainCount { get { throw null; } set { } } public int? PlatformUpdateDomainCount { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ProximityPlacementGroupId { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy ScheduledEventsPolicy { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.ComputeSku Sku { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList Statuses { get { throw null; } } public System.Collections.Generic.IList VirtualMachines { get { throw null; } } @@ -1189,6 +1190,7 @@ internal DiskRestorePointData() { } public Azure.ResourceManager.Compute.Models.DiskEncryption Encryption { get { throw null; } } public string FamilyId { get { throw null; } } public Azure.ResourceManager.Compute.Models.HyperVGeneration? HyperVGeneration { get { throw null; } } + public int? LogicalSectorSize { get { throw null; } } public Azure.ResourceManager.Compute.Models.NetworkAccessPolicy? NetworkAccessPolicy { get { throw null; } } public Azure.ResourceManager.Compute.Models.SupportedOperatingSystemType? OSType { get { throw null; } } public Azure.ResourceManager.Compute.Models.DiskPublicNetworkAccess? PublicNetworkAccess { get { throw null; } } @@ -2459,11 +2461,13 @@ public VirtualMachineScaleSetData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy ScheduledEventsPolicy { get { throw null; } set { } } public bool? SinglePlacementGroup { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.ComputeSku Sku { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ComputeSkuProfile SkuProfile { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.SpotRestorePolicy SpotRestorePolicy { get { throw null; } set { } } public System.DateTimeOffset? TimeCreated { get { throw null; } } public string UniqueId { get { throw null; } } public Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy UpgradePolicy { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile VirtualMachineProfile { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode? ZonalPlatformFaultDomainAlignMode { get { throw null; } set { } } public bool? ZoneBalance { get { throw null; } set { } } public System.Collections.Generic.IList Zones { get { throw null; } } Azure.ResourceManager.Compute.VirtualMachineScaleSetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3180,8 +3184,12 @@ public AdditionalUnattendContent() { } public static partial class ArmComputeModelFactory { public static Azure.ResourceManager.Compute.Models.AccessUri AccessUri(string accessSas = null, string securityDataAccessSas = null) { throw null; } - public static Azure.ResourceManager.Compute.AvailabilitySetData AvailabilitySetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Compute.Models.ComputeSku sku = null, int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IEnumerable virtualMachines = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, System.Collections.Generic.IEnumerable statuses = null) { throw null; } - public static Azure.ResourceManager.Compute.Models.AvailabilitySetPatch AvailabilitySetPatch(System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Compute.Models.ComputeSku sku = null, int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IEnumerable virtualMachines = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, System.Collections.Generic.IEnumerable statuses = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Compute.AvailabilitySetData AvailabilitySetData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Compute.Models.ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, System.Collections.Generic.IEnumerable virtualMachines, Azure.Core.ResourceIdentifier proximityPlacementGroupId, System.Collections.Generic.IEnumerable statuses) { throw null; } + public static Azure.ResourceManager.Compute.AvailabilitySetData AvailabilitySetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Compute.Models.ComputeSku sku = null, int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IEnumerable virtualMachines = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, System.Collections.Generic.IEnumerable statuses = null, Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy scheduledEventsPolicy = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Compute.Models.AvailabilitySetPatch AvailabilitySetPatch(System.Collections.Generic.IDictionary tags, Azure.ResourceManager.Compute.Models.ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, System.Collections.Generic.IEnumerable virtualMachines, Azure.Core.ResourceIdentifier proximityPlacementGroupId, System.Collections.Generic.IEnumerable statuses) { throw null; } + public static Azure.ResourceManager.Compute.Models.AvailabilitySetPatch AvailabilitySetPatch(System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Compute.Models.ComputeSku sku = null, int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IEnumerable virtualMachines = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, System.Collections.Generic.IEnumerable statuses = null, Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy scheduledEventsPolicy = null) { throw null; } public static Azure.ResourceManager.Compute.Models.AvailablePatchSummary AvailablePatchSummary(Azure.ResourceManager.Compute.Models.PatchOperationStatus? status = default(Azure.ResourceManager.Compute.Models.PatchOperationStatus?), string assessmentActivityId = null, bool? rebootPending = default(bool?), int? criticalAndSecurityPatchCount = default(int?), int? otherPatchCount = default(int?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Compute.Models.ComputeApiError error = null) { throw null; } public static Azure.ResourceManager.Compute.Models.BootDiagnosticsInstanceView BootDiagnosticsInstanceView(System.Uri consoleScreenshotBlobUri = null, System.Uri serialConsoleLogBlobUri = null, Azure.ResourceManager.Compute.Models.InstanceViewStatus status = null) { throw null; } public static Azure.ResourceManager.Compute.CapacityReservationData CapacityReservationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Compute.Models.ComputeSku sku = null, System.Collections.Generic.IEnumerable zones = null, string reservationId = null, int? platformFaultDomainCount = default(int?), System.Collections.Generic.IEnumerable virtualMachinesAssociated = null, System.DateTimeOffset? provisioningOn = default(System.DateTimeOffset?), string provisioningState = null, Azure.ResourceManager.Compute.Models.CapacityReservationInstanceView instanceView = null, System.DateTimeOffset? timeCreated = default(System.DateTimeOffset?)) { throw null; } @@ -3250,7 +3258,9 @@ public static partial class ArmComputeModelFactory public static Azure.ResourceManager.Compute.Models.DiskImagePatch DiskImagePatch(System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier sourceVirtualMachineId = null, Azure.ResourceManager.Compute.Models.ImageStorageProfile storageProfile = null, string provisioningState = null, Azure.ResourceManager.Compute.Models.HyperVGeneration? hyperVGeneration = default(Azure.ResourceManager.Compute.Models.HyperVGeneration?)) { throw null; } public static Azure.ResourceManager.Compute.Models.DiskInstanceView DiskInstanceView(string name = null, System.Collections.Generic.IEnumerable encryptionSettings = null, System.Collections.Generic.IEnumerable statuses = null) { throw null; } public static Azure.ResourceManager.Compute.Models.DiskRestorePointAttributes DiskRestorePointAttributes(Azure.Core.ResourceIdentifier id = null, Azure.ResourceManager.Compute.Models.RestorePointEncryption encryption = null, Azure.Core.ResourceIdentifier sourceDiskRestorePointId = null) { throw null; } - public static Azure.ResourceManager.Compute.DiskRestorePointData DiskRestorePointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? timeCreated = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.Compute.Models.SupportedOperatingSystemType? osType = default(Azure.ResourceManager.Compute.Models.SupportedOperatingSystemType?), Azure.ResourceManager.Compute.Models.HyperVGeneration? hyperVGeneration = default(Azure.ResourceManager.Compute.Models.HyperVGeneration?), Azure.ResourceManager.Compute.Models.DiskPurchasePlan purchasePlan = null, Azure.ResourceManager.Compute.Models.SupportedCapabilities supportedCapabilities = null, string familyId = null, string sourceUniqueId = null, Azure.ResourceManager.Compute.Models.DiskEncryption encryption = null, bool? supportsHibernation = default(bool?), Azure.ResourceManager.Compute.Models.NetworkAccessPolicy? networkAccessPolicy = default(Azure.ResourceManager.Compute.Models.NetworkAccessPolicy?), Azure.ResourceManager.Compute.Models.DiskPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Compute.Models.DiskPublicNetworkAccess?), Azure.Core.ResourceIdentifier diskAccessId = null, float? completionPercent = default(float?), string replicationState = null, Azure.Core.AzureLocation? sourceResourceLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Compute.Models.DiskSecurityProfile securityProfile = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Compute.DiskRestorePointData DiskRestorePointData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.DateTimeOffset? timeCreated, Azure.Core.ResourceIdentifier sourceResourceId, Azure.ResourceManager.Compute.Models.SupportedOperatingSystemType? osType, Azure.ResourceManager.Compute.Models.HyperVGeneration? hyperVGeneration, Azure.ResourceManager.Compute.Models.DiskPurchasePlan purchasePlan, Azure.ResourceManager.Compute.Models.SupportedCapabilities supportedCapabilities, string familyId, string sourceUniqueId, Azure.ResourceManager.Compute.Models.DiskEncryption encryption, bool? supportsHibernation, Azure.ResourceManager.Compute.Models.NetworkAccessPolicy? networkAccessPolicy, Azure.ResourceManager.Compute.Models.DiskPublicNetworkAccess? publicNetworkAccess, Azure.Core.ResourceIdentifier diskAccessId, float? completionPercent, string replicationState, Azure.Core.AzureLocation? sourceResourceLocation, Azure.ResourceManager.Compute.Models.DiskSecurityProfile securityProfile) { throw null; } + public static Azure.ResourceManager.Compute.DiskRestorePointData DiskRestorePointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? timeCreated = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.Compute.Models.SupportedOperatingSystemType? osType = default(Azure.ResourceManager.Compute.Models.SupportedOperatingSystemType?), Azure.ResourceManager.Compute.Models.HyperVGeneration? hyperVGeneration = default(Azure.ResourceManager.Compute.Models.HyperVGeneration?), Azure.ResourceManager.Compute.Models.DiskPurchasePlan purchasePlan = null, Azure.ResourceManager.Compute.Models.SupportedCapabilities supportedCapabilities = null, string familyId = null, string sourceUniqueId = null, Azure.ResourceManager.Compute.Models.DiskEncryption encryption = null, bool? supportsHibernation = default(bool?), Azure.ResourceManager.Compute.Models.NetworkAccessPolicy? networkAccessPolicy = default(Azure.ResourceManager.Compute.Models.NetworkAccessPolicy?), Azure.ResourceManager.Compute.Models.DiskPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Compute.Models.DiskPublicNetworkAccess?), Azure.Core.ResourceIdentifier diskAccessId = null, float? completionPercent = default(float?), string replicationState = null, Azure.Core.AzureLocation? sourceResourceLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Compute.Models.DiskSecurityProfile securityProfile = null, int? logicalSectorSize = default(int?)) { throw null; } public static Azure.ResourceManager.Compute.Models.DiskRestorePointInstanceView DiskRestorePointInstanceView(string id = null, Azure.ResourceManager.Compute.Models.DiskRestorePointReplicationStatus replicationStatus = null) { throw null; } public static Azure.ResourceManager.Compute.Models.DiskRestorePointReplicationStatus DiskRestorePointReplicationStatus(Azure.ResourceManager.Compute.Models.InstanceViewStatus status = null, int? completionPercent = default(int?)) { throw null; } public static Azure.ResourceManager.Compute.Models.DiskSku DiskSku(Azure.ResourceManager.Compute.Models.DiskStorageAccountType? name = default(Azure.ResourceManager.Compute.Models.DiskStorageAccountType?), string tier = null) { throw null; } @@ -3373,7 +3383,9 @@ public static partial class ArmComputeModelFactory public static Azure.ResourceManager.Compute.VirtualMachineScaleSetData VirtualMachineScaleSetData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Compute.Models.ComputeSku sku, Azure.ResourceManager.Compute.Models.ComputePlan plan, Azure.ResourceManager.Models.ManagedServiceIdentity identity, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy upgradePolicy, Azure.ResourceManager.Compute.Models.AutomaticRepairsPolicy automaticRepairsPolicy, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, Azure.Core.ResourceIdentifier proximityPlacementGroupId, Azure.Core.ResourceIdentifier hostGroupId, Azure.ResourceManager.Compute.Models.AdditionalCapabilities additionalCapabilities, Azure.ResourceManager.Compute.Models.ScaleInPolicy scaleInPolicy, Azure.ResourceManager.Compute.Models.OrchestrationMode? orchestrationMode, Azure.ResourceManager.Compute.Models.SpotRestorePolicy spotRestorePolicy, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, System.DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Compute.VirtualMachineScaleSetData VirtualMachineScaleSetData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Compute.Models.ComputeSku sku, Azure.ResourceManager.Compute.Models.ComputePlan plan, Azure.ResourceManager.Models.ManagedServiceIdentity identity, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation, string etag, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy upgradePolicy, Azure.ResourceManager.Compute.Models.AutomaticRepairsPolicy automaticRepairsPolicy, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, Azure.Core.ResourceIdentifier proximityPlacementGroupId, Azure.Core.ResourceIdentifier hostGroupId, Azure.ResourceManager.Compute.Models.AdditionalCapabilities additionalCapabilities, Azure.ResourceManager.Compute.Models.ScaleInPolicy scaleInPolicy, Azure.ResourceManager.Compute.Models.OrchestrationMode? orchestrationMode, Azure.ResourceManager.Compute.Models.SpotRestorePolicy spotRestorePolicy, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, System.DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained, Azure.ResourceManager.Compute.Models.ResiliencyPolicy resiliencyPolicy) { throw null; } - public static Azure.ResourceManager.Compute.VirtualMachineScaleSetData VirtualMachineScaleSetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Compute.Models.ComputeSku sku = null, Azure.ResourceManager.Compute.Models.ComputePlan plan = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation = null, string etag = null, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy upgradePolicy = null, Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy scheduledEventsPolicy = null, Azure.ResourceManager.Compute.Models.AutomaticRepairsPolicy automaticRepairsPolicy = null, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile virtualMachineProfile = null, string provisioningState = null, bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVms = default(bool?), string uniqueId = null, bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, Azure.Core.ResourceIdentifier hostGroupId = null, Azure.ResourceManager.Compute.Models.AdditionalCapabilities additionalCapabilities = null, Azure.ResourceManager.Compute.Models.ScaleInPolicy scaleInPolicy = null, Azure.ResourceManager.Compute.Models.OrchestrationMode? orchestrationMode = default(Azure.ResourceManager.Compute.Models.OrchestrationMode?), Azure.ResourceManager.Compute.Models.SpotRestorePolicy spotRestorePolicy = null, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy = null, System.DateTimeOffset? timeCreated = default(System.DateTimeOffset?), bool? isMaximumCapacityConstrained = default(bool?), Azure.ResourceManager.Compute.Models.ResiliencyPolicy resiliencyPolicy = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Compute.VirtualMachineScaleSetData VirtualMachineScaleSetData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Compute.Models.ComputeSku sku, Azure.ResourceManager.Compute.Models.ComputePlan plan, Azure.ResourceManager.Models.ManagedServiceIdentity identity, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation, string etag, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy upgradePolicy, Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy scheduledEventsPolicy, Azure.ResourceManager.Compute.Models.AutomaticRepairsPolicy automaticRepairsPolicy, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, Azure.Core.ResourceIdentifier proximityPlacementGroupId, Azure.Core.ResourceIdentifier hostGroupId, Azure.ResourceManager.Compute.Models.AdditionalCapabilities additionalCapabilities, Azure.ResourceManager.Compute.Models.ScaleInPolicy scaleInPolicy, Azure.ResourceManager.Compute.Models.OrchestrationMode? orchestrationMode, Azure.ResourceManager.Compute.Models.SpotRestorePolicy spotRestorePolicy, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, System.DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained, Azure.ResourceManager.Compute.Models.ResiliencyPolicy resiliencyPolicy) { throw null; } + public static Azure.ResourceManager.Compute.VirtualMachineScaleSetData VirtualMachineScaleSetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Compute.Models.ComputeSku sku = null, Azure.ResourceManager.Compute.Models.ComputePlan plan = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation = null, string etag = null, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy upgradePolicy = null, Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy scheduledEventsPolicy = null, Azure.ResourceManager.Compute.Models.AutomaticRepairsPolicy automaticRepairsPolicy = null, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile virtualMachineProfile = null, string provisioningState = null, bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVms = default(bool?), string uniqueId = null, bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, Azure.Core.ResourceIdentifier hostGroupId = null, Azure.ResourceManager.Compute.Models.AdditionalCapabilities additionalCapabilities = null, Azure.ResourceManager.Compute.Models.ScaleInPolicy scaleInPolicy = null, Azure.ResourceManager.Compute.Models.OrchestrationMode? orchestrationMode = default(Azure.ResourceManager.Compute.Models.OrchestrationMode?), Azure.ResourceManager.Compute.Models.SpotRestorePolicy spotRestorePolicy = null, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy = null, System.DateTimeOffset? timeCreated = default(System.DateTimeOffset?), bool? isMaximumCapacityConstrained = default(bool?), Azure.ResourceManager.Compute.Models.ResiliencyPolicy resiliencyPolicy = null, Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode? zonalPlatformFaultDomainAlignMode = default(Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode?), Azure.ResourceManager.Compute.Models.ComputeSkuProfile skuProfile = null) { throw null; } public static Azure.ResourceManager.Compute.VirtualMachineScaleSetExtensionData VirtualMachineScaleSetExtensionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), System.BinaryData settings = null, System.BinaryData protectedSettings = null, string provisioningState = null, System.Collections.Generic.IEnumerable provisionAfterExtensions = null, bool? suppressFailures = default(bool?), Azure.ResourceManager.Compute.Models.KeyVaultSecretReference keyVaultProtectedSettings = null) { throw null; } public static Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetExtensionPatch VirtualMachineScaleSetExtensionPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), System.BinaryData settings = null, System.BinaryData protectedSettings = null, string provisioningState = null, System.Collections.Generic.IEnumerable provisionAfterExtensions = null, bool? suppressFailures = default(bool?), Azure.ResourceManager.Compute.Models.KeyVaultSecretReference keyVaultProtectedSettings = null) { throw null; } public static Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetInstanceView VirtualMachineScaleSetInstanceView(System.Collections.Generic.IEnumerable virtualMachineStatusesSummary = null, System.Collections.Generic.IEnumerable extensions = null, System.Collections.Generic.IEnumerable statuses = null, System.Collections.Generic.IEnumerable orchestrationServices = null) { throw null; } @@ -3391,6 +3403,7 @@ public static partial class ArmComputeModelFactory public static Azure.ResourceManager.Compute.Models.VirtualMachineSize VirtualMachineSize(string name = null, int? numberOfCores = default(int?), int? osDiskSizeInMB = default(int?), int? resourceDiskSizeInMB = default(int?), int? memoryInMB = default(int?), int? maxDataDiskCount = default(int?)) { throw null; } public static Azure.ResourceManager.Compute.Models.VirtualMachineSoftwarePatchProperties VirtualMachineSoftwarePatchProperties(string patchId = null, string name = null, string version = null, string kbId = null, System.Collections.Generic.IEnumerable classifications = null, Azure.ResourceManager.Compute.Models.VmGuestPatchRebootBehavior? rebootBehavior = default(Azure.ResourceManager.Compute.Models.VmGuestPatchRebootBehavior?), string activityId = null, System.DateTimeOffset? publishedOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Compute.Models.PatchAssessmentState? assessmentState = default(Azure.ResourceManager.Compute.Models.PatchAssessmentState?)) { throw null; } public static Azure.ResourceManager.Compute.Models.VirtualMachineStatusCodeCount VirtualMachineStatusCodeCount(string code = null, int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.Compute.Models.WindowsConfiguration WindowsConfiguration(bool? provisionVmAgent = default(bool?), bool? isAutomaticUpdatesEnabled = default(bool?), string timeZone = null, System.Collections.Generic.IEnumerable additionalUnattendContent = null, Azure.ResourceManager.Compute.Models.PatchSettings patchSettings = null, System.Collections.Generic.IEnumerable winRMListeners = null, bool? isVmAgentPlatformUpdatesEnabled = default(bool?)) { throw null; } } public partial class AttachDetachDataDisksRequest : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -3434,6 +3447,7 @@ public AvailabilitySetPatch() { } public int? PlatformFaultDomainCount { get { throw null; } set { } } public int? PlatformUpdateDomainCount { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ProximityPlacementGroupId { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy ScheduledEventsPolicy { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.ComputeSku Sku { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList Statuses { get { throw null; } } public System.Collections.Generic.IList VirtualMachines { get { throw null; } } @@ -3837,6 +3851,24 @@ internal CommunityGalleryMetadata() { } public static bool operator !=(Azure.ResourceManager.Compute.Models.ComponentName left, Azure.ResourceManager.Compute.Models.ComponentName right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeAllocationStrategy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeAllocationStrategy(string value) { throw null; } + public static Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy CapacityOptimized { get { throw null; } } + public static Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy LowestPrice { get { throw null; } } + public bool Equals(Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy left, Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy right) { throw null; } + public static implicit operator Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy left, Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy right) { throw null; } + public override string ToString() { throw null; } + } public partial class ComputeApiError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ComputeApiError() { } @@ -4197,9 +4229,14 @@ public ComputeScheduledEventsProfile() { } } public partial class ComputeSecurityPostureReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public ComputeSecurityPostureReference() { } + public ComputeSecurityPostureReference(Azure.Core.ResourceIdentifier id) { } + public System.Collections.Generic.IList ExcludeExtensionNames { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public System.Collections.Generic.IList ExcludeExtensions { get { throw null; } } public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } + public bool? IsOverridable { get { throw null; } set { } } Azure.ResourceManager.Compute.Models.ComputeSecurityPostureReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Compute.Models.ComputeSecurityPostureReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4218,6 +4255,27 @@ public ComputeSku() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ComputeSkuProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeSkuProfile() { } + public Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy? AllocationStrategy { get { throw null; } set { } } + public System.Collections.Generic.IList VmSizes { get { throw null; } } + Azure.ResourceManager.Compute.Models.ComputeSkuProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Compute.Models.ComputeSkuProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeSkuProfileVmSize : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeSkuProfileVmSize() { } + public string Name { get { throw null; } set { } } + Azure.ResourceManager.Compute.Models.ComputeSkuProfileVmSize System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Compute.Models.ComputeSkuProfileVmSize System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public enum ComputeStatusLevelType { Info = 0, @@ -7113,6 +7171,18 @@ public ScheduledEventsPolicy() { } public static bool operator !=(Azure.ResourceManager.Compute.Models.SecurityEncryptionType left, Azure.ResourceManager.Compute.Models.SecurityEncryptionType right) { throw null; } public override string ToString() { throw null; } } + public partial class SecurityPostureReferenceUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecurityPostureReferenceUpdate() { } + public System.Collections.Generic.IList ExcludeExtensions { get { throw null; } } + public string Id { get { throw null; } set { } } + public bool? IsOverridable { get { throw null; } set { } } + Azure.ResourceManager.Compute.Models.SecurityPostureReferenceUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Compute.Models.SecurityPostureReferenceUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SecurityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SecurityProfile() { } @@ -8625,9 +8695,12 @@ public VirtualMachineScaleSetPatch() { } public Azure.ResourceManager.Compute.Models.ScaleInPolicy ScaleInPolicy { get { throw null; } set { } } public bool? SinglePlacementGroup { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.ComputeSku Sku { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ComputeSkuProfile SkuProfile { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.SpotRestorePolicy SpotRestorePolicy { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy UpgradePolicy { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpdateVmProfile VirtualMachineProfile { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode? ZonalPlatformFaultDomainAlignMode { get { throw null; } set { } } + public System.Collections.Generic.IList Zones { get { throw null; } } Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -8874,6 +8947,7 @@ public VirtualMachineScaleSetUpdateVmProfile() { } public Azure.ResourceManager.Compute.Models.ComputeScheduledEventsProfile ScheduledEventsProfile { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Compute.Models.TerminateNotificationProfile ScheduledEventsTerminateNotificationProfile { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.SecurityPostureReferenceUpdate SecurityPostureReference { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.SecurityProfile SecurityProfile { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpdateStorageProfile StorageProfile { get { throw null; } set { } } public string UserData { get { throw null; } set { } } @@ -9390,7 +9464,7 @@ public WindowsConfiguration() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool? EnableAutomaticUpdates { get { throw null; } set { } } public bool? IsAutomaticUpdatesEnabled { get { throw null; } set { } } - public bool? IsVmAgentPlatformUpdatesEnabled { get { throw null; } set { } } + public bool? IsVmAgentPlatformUpdatesEnabled { get { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] set { } } public Azure.ResourceManager.Compute.Models.PatchSettings PatchSettings { get { throw null; } set { } } public bool? ProvisionVmAgent { get { throw null; } set { } } public string TimeZone { get { throw null; } set { } } @@ -9499,4 +9573,22 @@ public enum WinRMListenerProtocolType Http = 0, Https = 1, } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ZonalPlatformFaultDomainAlignMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ZonalPlatformFaultDomainAlignMode(string value) { throw null; } + public static Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode Aligned { get { throw null; } } + public static Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode Unaligned { get { throw null; } } + public bool Equals(Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode left, Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode left, Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode right) { throw null; } + public override string ToString() { throw null; } + } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/assets.json b/sdk/compute/Azure.ResourceManager.Compute/assets.json index a20dd911a9156..0389918c4ce86 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/assets.json +++ b/sdk/compute/Azure.ResourceManager.Compute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/compute/Azure.ResourceManager.Compute", - "Tag": "net/compute/Azure.ResourceManager.Compute_4ea075e9ca" + "Tag": "net/compute/Azure.ResourceManager.Compute_d32ee065f6" } diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetCollection.cs index 1212fd7bfed84..7c3ad3e4d59e8 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetCollection.cs @@ -15,12 +15,52 @@ namespace Azure.ResourceManager.Compute.Samples { public partial class Sample_AvailabilitySetCollection { + // Create an availability set with Scheduled Event Policy. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAnAvailabilitySetWithScheduledEventPolicy() + { + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Create_WithScheduledEventProfile.json + // this example is just showing the usage of "AvailabilitySets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "{subscription-id}"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvailabilitySetResource + AvailabilitySetCollection collection = resourceGroupResource.GetAvailabilitySets(); + + // invoke the operation + string availabilitySetName = "myAvailabilitySet"; + AvailabilitySetData data = new AvailabilitySetData(new AzureLocation("westus")) + { + PlatformUpdateDomainCount = 20, + PlatformFaultDomainCount = 2, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, availabilitySetName, data); + AvailabilitySetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvailabilitySetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Create an availability set. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnAvailabilitySet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Create.json // this example is just showing the usage of "AvailabilitySets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +100,7 @@ public async Task CreateOrUpdate_CreateAnAvailabilitySet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_AvailabilitySetGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +134,7 @@ public async Task Get_AvailabilitySetGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_AvailabilitySetGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +164,7 @@ public async Task Exists_AvailabilitySetGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_AvailabilitySetGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +206,7 @@ public async Task GetIfExists_AvailabilitySetGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_AvailabilitySetGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -200,7 +240,7 @@ public async Task Get_AvailabilitySetGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_AvailabilitySetGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -230,7 +270,7 @@ public async Task Exists_AvailabilitySetGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_AvailabilitySetGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -272,7 +312,7 @@ public async Task GetIfExists_AvailabilitySetGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_AvailabilitySetListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -308,7 +348,7 @@ public async Task GetAll_AvailabilitySetListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_AvailabilitySetListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetResource.cs index 761ba5a020267..91c711f85ab94 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetResource.cs @@ -22,7 +22,7 @@ public partial class Sample_AvailabilitySetResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_AvailabilitySetUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Update_AvailabilitySetUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_AvailabilitySetUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +108,7 @@ public async Task Update_AvailabilitySetUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_AvailabilitySetDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task Delete_AvailabilitySetDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_AvailabilitySetDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,7 +162,7 @@ public async Task Delete_AvailabilitySetDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_AvailabilitySetGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -193,7 +193,7 @@ public async Task Get_AvailabilitySetGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_AvailabilitySetGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -224,7 +224,7 @@ public async Task Get_AvailabilitySetGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAvailabilitySets_ListAvailabilitySetsInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json // this example is just showing the usage of "AvailabilitySets_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -257,7 +257,7 @@ public async Task GetAvailabilitySets_ListAvailabilitySetsInASubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAvailableSizes_AvailabilitySetListAvailableSizesMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_ListAvailableSizes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -287,7 +287,7 @@ public async Task GetAvailableSizes_AvailabilitySetListAvailableSizesMaximumSetG [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAvailableSizes_AvailabilitySetListAvailableSizesMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_ListAvailableSizes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationCollection.cs index 85e049c2e4d2d..226fdb6ba18ae 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CapacityReservationCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateACapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json // this example is just showing the usage of "CapacityReservations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -71,7 +71,7 @@ public async Task CreateOrUpdate_CreateOrUpdateACapacityReservation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetACapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Get.json // this example is just showing the usage of "CapacityReservations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -107,7 +107,7 @@ public async Task Get_GetACapacityReservation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetACapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Get.json // this example is just showing the usage of "CapacityReservations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -139,7 +139,7 @@ public async Task Exists_GetACapacityReservation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetACapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Get.json // this example is just showing the usage of "CapacityReservations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -183,7 +183,7 @@ public async Task GetIfExists_GetACapacityReservation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListCapacityReservationsInReservationGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json // this example is just showing the usage of "CapacityReservations_ListByCapacityReservationGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupCollection.cs index 6ff8b25544a92..0a48cac0834b6 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_CapacityReservationGroupCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateACapacityReservationGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json // this example is just showing the usage of "CapacityReservationGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task CreateOrUpdate_CreateOrUpdateACapacityReservationGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetACapacityReservationGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json // this example is just showing the usage of "CapacityReservationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task Get_GetACapacityReservationGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetACapacityReservationGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json // this example is just showing the usage of "CapacityReservationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,7 +144,7 @@ public async Task Exists_GetACapacityReservationGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetACapacityReservationGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json // this example is just showing the usage of "CapacityReservationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -187,7 +187,7 @@ public async Task GetIfExists_GetACapacityReservationGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListCapacityReservationGroupsInResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json // this example is just showing the usage of "CapacityReservationGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupResource.cs index e33b25617b678..a7784c4c86814 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupResource.cs @@ -21,7 +21,7 @@ public partial class Sample_CapacityReservationGroupResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CapacityReservationGroupUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json // this example is just showing the usage of "CapacityReservationGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task Update_CapacityReservationGroupUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CapacityReservationGroupUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json // this example is just showing the usage of "CapacityReservationGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task Update_CapacityReservationGroupUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CapacityReservationGroupDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json // this example is just showing the usage of "CapacityReservationGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -118,7 +118,7 @@ public async Task Delete_CapacityReservationGroupDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CapacityReservationGroupDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json // this example is just showing the usage of "CapacityReservationGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -145,7 +145,7 @@ public async Task Delete_CapacityReservationGroupDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetACapacityReservationGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json // this example is just showing the usage of "CapacityReservationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -177,7 +177,7 @@ public async Task Get_GetACapacityReservationGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCapacityReservationGroups_ListCapacityReservationGroupsInSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json // this example is just showing the usage of "CapacityReservationGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +210,7 @@ public async Task GetCapacityReservationGroups_ListCapacityReservationGroupsInSu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCapacityReservationGroups_ListCapacityReservationGroupsWithResourceIdsOnlyInSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscriptionWithResourceIdsQuery.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscriptionWithResourceIdsQuery.json // this example is just showing the usage of "CapacityReservationGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationResource.cs index 98c70fa457232..0b29fa0361659 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CapacityReservationResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CapacityReservationUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json // this example is just showing the usage of "CapacityReservations_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task Update_CapacityReservationUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CapacityReservationUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json // this example is just showing the usage of "CapacityReservations_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Update_CapacityReservationUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CapacityReservationDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json // this example is just showing the usage of "CapacityReservations_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task Delete_CapacityReservationDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CapacityReservationDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json // this example is just showing the usage of "CapacityReservations_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task Delete_CapacityReservationDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetACapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Get.json // this example is just showing the usage of "CapacityReservations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionCollection.cs index ba93e5962e9b6..7bac8aa9b062b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ComputePrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApproveAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json // this example is just showing the usage of "DiskAccesses_UpdateAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_ApproveAPrivateEndpointConnectionUnderADiskAcce [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json // this example is just showing the usage of "DiskAccesses_GetAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task Get_GetInformationAboutAPrivateEndpointConnectionUnderADiskAcc [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json // this example is just showing the usage of "DiskAccesses_GetAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task Exists_GetInformationAboutAPrivateEndpointConnectionUnderADisk [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json // this example is just showing the usage of "DiskAccesses_GetAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +173,7 @@ public async Task GetIfExists_GetInformationAboutAPrivateEndpointConnectionUnder [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json // this example is just showing the usage of "DiskAccesses_ListPrivateEndpointConnections" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionResource.cs index d1bbf96ccaa3c..c5a61688bba2a 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ComputePrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApproveAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json // this example is just showing the usage of "DiskAccesses_UpdateAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task Update_ApproveAPrivateEndpointConnectionUnderADiskAccessResour [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json // this example is just showing the usage of "DiskAccesses_GetAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_GetInformationAboutAPrivateEndpointConnectionUnderADiskAcc [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json // this example is just showing the usage of "DiskAccesses_DeleteAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostCollection.cs index 51a6dd3d239c4..ef901137f1ff5 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DedicatedHostCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateADedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json // this example is just showing the usage of "DedicatedHosts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -67,7 +67,7 @@ public async Task CreateOrUpdate_CreateOrUpdateADedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetADedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Get.json // this example is just showing the usage of "DedicatedHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -103,7 +103,7 @@ public async Task Get_GetADedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetADedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Get.json // this example is just showing the usage of "DedicatedHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task Exists_GetADedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetADedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Get.json // this example is just showing the usage of "DedicatedHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -179,7 +179,7 @@ public async Task GetIfExists_GetADedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_DedicatedHostListByHostGroupMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHosts_ListByHostGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -216,7 +216,7 @@ public async Task GetAll_DedicatedHostListByHostGroupMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_DedicatedHostListByHostGroupMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHosts_ListByHostGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupCollection.cs index 4662d129c9fb3..820f7175c4700 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DedicatedHostGroupCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateADedicatedHostGroupWithUltraSSDSupport() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json // this example is just showing the usage of "DedicatedHostGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -69,7 +69,7 @@ public async Task CreateOrUpdate_CreateOrUpdateADedicatedHostGroupWithUltraSSDSu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateADedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json // this example is just showing the usage of "DedicatedHostGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task CreateOrUpdate_CreateOrUpdateADedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CreateADedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -151,7 +151,7 @@ public async Task Get_CreateADedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CreateADedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -181,7 +181,7 @@ public async Task Exists_CreateADedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CreateADedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -223,7 +223,7 @@ public async Task GetIfExists_CreateADedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CreateAnUltraSSDEnabledDedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -257,7 +257,7 @@ public async Task Get_CreateAnUltraSSDEnabledDedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CreateAnUltraSSDEnabledDedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -287,7 +287,7 @@ public async Task Exists_CreateAnUltraSSDEnabledDedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CreateAnUltraSSDEnabledDedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -329,7 +329,7 @@ public async Task GetIfExists_CreateAnUltraSSDEnabledDedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_DedicatedHostGroupListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -365,7 +365,7 @@ public async Task GetAll_DedicatedHostGroupListByResourceGroupMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_DedicatedHostGroupListByResourceGroupMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupResource.cs index b846ae205c089..e392947354bc4 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupResource.cs @@ -21,7 +21,7 @@ public partial class Sample_DedicatedHostGroupResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DedicatedHostGroupUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -65,7 +65,7 @@ public async Task Update_DedicatedHostGroupUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DedicatedHostGroupUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Update_DedicatedHostGroupUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DedicatedHostGroupDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Delete_DedicatedHostGroupDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DedicatedHostGroupDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -151,7 +151,7 @@ public async Task Delete_DedicatedHostGroupDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CreateADedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -182,7 +182,7 @@ public async Task Get_CreateADedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CreateAnUltraSSDEnabledDedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -213,7 +213,7 @@ public async Task Get_CreateAnUltraSSDEnabledDedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDedicatedHostGroups_DedicatedHostGroupListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -245,7 +245,7 @@ public async Task GetDedicatedHostGroups_DedicatedHostGroupListBySubscriptionMax [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDedicatedHostGroups_DedicatedHostGroupListBySubscriptionMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostResource.cs index 3d9b4a0c9d5a0..c06bd27dd5669 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DedicatedHostResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DedicatedHostUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHosts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task Update_DedicatedHostUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DedicatedHostUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHosts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Update_DedicatedHostUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DedicatedHostUpdateResize() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_Resize.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Update_Resize.json // this example is just showing the usage of "DedicatedHosts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,7 +137,7 @@ public async Task Update_DedicatedHostUpdateResize() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DedicatedHostDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHosts_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task Delete_DedicatedHostDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DedicatedHostDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHosts_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -193,7 +193,7 @@ public async Task Delete_DedicatedHostDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetADedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Get.json // this example is just showing the usage of "DedicatedHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -226,7 +226,7 @@ public async Task Get_GetADedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_RestartDedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Restart.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Restart.json // this example is just showing the usage of "DedicatedHosts_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -254,7 +254,7 @@ public async Task Restart_RestartDedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_RedeployDedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Redeploy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Redeploy.json // this example is just showing the usage of "DedicatedHosts_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -282,7 +282,7 @@ public async Task Redeploy_RedeployDedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAvailableSizes_GetAvailableDedicatedHostSizes() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json // this example is just showing the usage of "DedicatedHosts_ListAvailableSizes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessCollection.cs index 4dac2c6438824..4813a47a7efed 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DiskAccessCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Create.json // this example is just showing the usage of "DiskAccesses_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task CreateOrUpdate_CreateADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskAccessResourceWithPrivateEndpoints() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task Get_GetInformationAboutADiskAccessResourceWithPrivateEndpoints [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutADiskAccessResourceWithPrivateEndpoints() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +120,7 @@ public async Task Exists_GetInformationAboutADiskAccessResourceWithPrivateEndpoi [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutADiskAccessResourceWithPrivateEndpoints() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,7 +162,7 @@ public async Task GetIfExists_GetInformationAboutADiskAccessResourceWithPrivateE [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,7 +196,7 @@ public async Task Get_GetInformationAboutADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -226,7 +226,7 @@ public async Task Exists_GetInformationAboutADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -268,7 +268,7 @@ public async Task GetIfExists_GetInformationAboutADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAllDiskAccessResourcesInAResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json // this example is just showing the usage of "DiskAccesses_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessResource.cs index 6a2912480098e..b1b8a5e113f8e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessResource.cs @@ -21,7 +21,7 @@ public partial class Sample_DiskAccessResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Update.json // this example is just showing the usage of "DiskAccesses_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task Update_UpdateADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskAccessResourceWithPrivateEndpoints() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetInformationAboutADiskAccessResourceWithPrivateEndpoints [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Get_GetInformationAboutADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Delete.json // this example is just showing the usage of "DiskAccesses_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -150,7 +150,7 @@ public async Task Delete_DeleteADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDiskAccesses_ListAllDiskAccessResourcesInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json // this example is just showing the usage of "DiskAccesses_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -182,7 +182,7 @@ public async Task GetDiskAccesses_ListAllDiskAccessResourcesInASubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetPrivateLinkResources_ListAllPossiblePrivateLinkResourcesUnderDiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json // this example is just showing the usage of "DiskAccesses_GetPrivateLinkResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetCollection.cs index 11fcd188062f3..2fc438e848cfb 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_DiskEncryptionSetCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateADiskEncryptionSetWithKeyVaultFromADifferentSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json // this example is just showing the usage of "DiskEncryptionSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_CreateADiskEncryptionSetWithKeyVaultFromADiffer [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateADiskEncryptionSetWithKeyVaultFromADifferentTenant() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json // this example is just showing the usage of "DiskEncryptionSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -111,7 +111,7 @@ public async Task CreateOrUpdate_CreateADiskEncryptionSetWithKeyVaultFromADiffer [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create.json // this example is just showing the usage of "DiskEncryptionSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,7 +155,7 @@ public async Task CreateOrUpdate_CreateADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -189,7 +189,7 @@ public async Task Get_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFa [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -219,7 +219,7 @@ public async Task Exists_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotatio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -261,7 +261,7 @@ public async Task GetIfExists_GetInformationAboutADiskEncryptionSetWhenAutoKeyRo [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -295,7 +295,7 @@ public async Task Get_GetInformationAboutADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -325,7 +325,7 @@ public async Task Exists_GetInformationAboutADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -367,7 +367,7 @@ public async Task GetIfExists_GetInformationAboutADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAllDiskEncryptionSetsInAResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json // this example is just showing the usage of "DiskEncryptionSets_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetResource.cs index 29667fb503e41..57e882b728757 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetResource.cs @@ -22,7 +22,7 @@ public partial class Sample_DiskEncryptionSetResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json // this example is just showing the usage of "DiskEncryptionSets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task Update_UpdateADiskEncryptionSetWithRotationToLatestKeyVersionE [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json // this example is just showing the usage of "DiskEncryptionSets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Update_UpdateADiskEncryptionSetWithRotationToLatestKeyVersionE [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update.json // this example is just showing the usage of "DiskEncryptionSets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -145,7 +145,7 @@ public async Task Update_UpdateADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -176,7 +176,7 @@ public async Task Get_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFa [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -207,7 +207,7 @@ public async Task Get_GetInformationAboutADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json // this example is just showing the usage of "DiskEncryptionSets_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -234,7 +234,7 @@ public async Task Delete_DeleteADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDiskEncryptionSets_ListAllDiskEncryptionSetsInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json // this example is just showing the usage of "DiskEncryptionSets_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -266,7 +266,7 @@ public async Task GetDiskEncryptionSets_ListAllDiskEncryptionSetsInASubscription [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAssociatedResources_ListAllResourcesThatAreEncryptedWithThisDiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json // this example is just showing the usage of "DiskEncryptionSets_ListAssociatedResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageCollection.cs index 3e4fde7c14496..197b9c69fcc2d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_DiskImageCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromABlobWithDiskEncryptionSetResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -67,7 +67,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromABlobWithDiskEncr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromABlob() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromABlob.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromABlob.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromABlob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromAManagedDiskWithD [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromAManagedDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromAManagedDisk.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -205,7 +205,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -251,7 +251,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromASnapshotWithDisk [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromASnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromASnapshot.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -297,7 +297,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromAnExistingVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromAVM.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromAVM.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -336,7 +336,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromAnExistingVirtual [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageThatIncludesADataDiskFromABlob() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Create_DataDiskFromABlobIncluded.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Create_DataDiskFromABlobIncluded.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -389,7 +389,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageThatIncludesADataDisk [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -442,7 +442,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageThatIncludesADataDisk [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageThatIncludesADataDiskFromASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -495,7 +495,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageThatIncludesADataDisk [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAVirtualMachineImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Get.json // this example is just showing the usage of "Images_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -529,7 +529,7 @@ public async Task Get_GetInformationAboutAVirtualMachineImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutAVirtualMachineImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Get.json // this example is just showing the usage of "Images_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -559,7 +559,7 @@ public async Task Exists_GetInformationAboutAVirtualMachineImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutAVirtualMachineImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Get.json // this example is just showing the usage of "Images_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -601,7 +601,7 @@ public async Task GetIfExists_GetInformationAboutAVirtualMachineImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAllVirtualMachineImagesInAResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_ListByResourceGroup.json // this example is just showing the usage of "Images_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageResource.cs index 38c47436abfa0..f61afb36162f2 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageResource.cs @@ -21,7 +21,7 @@ public partial class Sample_DiskImageResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdatesTagsOfAnImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Update.json // this example is just showing the usage of "Images_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task Update_UpdatesTagsOfAnImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ImageDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json // this example is just showing the usage of "Images_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Delete_ImageDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ImageDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Images_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Images_Delete_MinimumSet_Gen.json // this example is just showing the usage of "Images_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,7 +116,7 @@ public async Task Delete_ImageDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAVirtualMachineImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Get.json // this example is just showing the usage of "Images_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -147,7 +147,7 @@ public async Task Get_GetInformationAboutAVirtualMachineImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDiskImages_ListAllVirtualMachineImagesInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_ListBySubscription.json // this example is just showing the usage of "Images_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointCollection.cs index 3c9bb934a58d4..dfd22e80d1aee 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_DiskRestorePointCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnIncrementalDiskRestorePointResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetAnIncrementalDiskRestorePointResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAnIncrementalDiskRestorePointResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Exists_GetAnIncrementalDiskRestorePointResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAnIncrementalDiskRestorePointResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task GetIfExists_GetAnIncrementalDiskRestorePointResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task Get_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromAD [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -199,7 +199,7 @@ public async Task Exists_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFro [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -243,7 +243,7 @@ public async Task GetIfExists_GetAnIncrementalDiskRestorePointWhenSourceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetAnIncrementalDiskRestorePointResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json // this example is just showing the usage of "DiskRestorePoint_ListByRestorePoint" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointResource.cs index f48a97fb28ccf..fea879c3541c4 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DiskRestorePointResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnIncrementalDiskRestorePointResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetAnIncrementalDiskRestorePointResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Get_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromAD [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GrantAccess_GrantsAccessToADiskRestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json // this example is just showing the usage of "DiskRestorePoint_GrantAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +120,7 @@ public async Task GrantAccess_GrantsAccessToADiskRestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RevokeAccess_RevokesAccessToADiskRestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json // this example is just showing the usage of "DiskRestorePoint_RevokeAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskCollection.cs index 9622a9ba9380f..3d4754fdd7857 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_ManagedDiskCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -73,7 +73,7 @@ public async Task CreateOrUpdate_CreateAConfidentialVMSupportedDiskEncryptedWith [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskAndAssociateWithDiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithDiskAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithDiskAccess.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskAndAssociateWithDiskAccessRes [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskAndAssociateWithDiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithDiskEncryptionSet.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithDiskEncryptionSet.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskAndAssociateWithDiskEncryptio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskByCopyingASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_ByCopyingASnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_ByCopyingASnapshot.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -201,7 +201,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskByCopyingASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -244,7 +244,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskByImportingAnUnmanagedBlobFro [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -286,7 +286,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskByImportingAnUnmanagedBlobFro [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromImportSecureCreateOption() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromImportSecure.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromImportSecure.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -335,7 +335,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromImportSecureCreateOption( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromUploadPreparedSecureCreateOption() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromUploadPreparedSecure.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromUploadPreparedSecure.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -382,7 +382,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromUploadPreparedSecureCreat [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromAPlatformImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAPlatformImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAPlatformImage.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -428,7 +428,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromAPlatformImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromAnAzureComputeGalleryCommunityImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -474,7 +474,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromAnAzureComputeGalleryComm [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromAnAzureComputeGalleryDirectSharedImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -520,7 +520,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromAnAzureComputeGalleryDire [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromAnAzureComputeGalleryImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -566,7 +566,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromAnAzureComputeGalleryImag [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnExistingManagedDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnExistingManagedDisk.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -608,7 +608,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromAnExistingManagedDiskInTh [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromElasticSanVolumeSnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnElasticSanVolumeSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnElasticSanVolumeSnapshot.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -650,7 +650,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromElasticSanVolumeSnapshot( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithDataAccessAuthMode() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithDataAccessAuthMode.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithDataAccessAuthMode.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -691,7 +691,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithDataAccessAuthMode() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithOptimizedForFrequentAttach() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -732,7 +732,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithOptimizedForFrequentAttac [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithPerformancePlus() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_PerformancePlus.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_PerformancePlus.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -774,7 +774,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithPerformancePlus() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithPremiumV2AccountType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -820,7 +820,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithPremiumV2AccountType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithSecurityProfile() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithSecurityProfile.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithSecurityProfile.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -870,7 +870,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithSecurityProfile() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithSsdZrsAccountType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithSSDZRSAccountType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithSSDZRSAccountType.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -914,7 +914,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithSsdZrsAccountType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -967,7 +967,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithUltraAccountTypeWithReadO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedUploadDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_UploadDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_UploadDisk.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1009,7 +1009,7 @@ public async Task CreateOrUpdate_CreateAManagedUploadDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnEmptyManagedDiskInExtendedLocation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_InExtendedLocation.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_InExtendedLocation.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1053,7 +1053,7 @@ public async Task CreateOrUpdate_CreateAnEmptyManagedDiskInExtendedLocation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnEmptyManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_Empty.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_Empty.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1093,7 +1093,7 @@ public async Task CreateOrUpdate_CreateAnEmptyManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnUltraManagedDiskWithLogicalSectorSize512E() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithLogicalSectorSize.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithLogicalSectorSize.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1140,7 +1140,7 @@ public async Task CreateOrUpdate_CreateAnUltraManagedDiskWithLogicalSectorSize51 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Get.json // this example is just showing the usage of "Disks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1174,7 +1174,7 @@ public async Task Get_GetInformationAboutAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Get.json // this example is just showing the usage of "Disks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1204,7 +1204,7 @@ public async Task Exists_GetInformationAboutAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Get.json // this example is just showing the usage of "Disks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1246,7 +1246,7 @@ public async Task GetIfExists_GetInformationAboutAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAllManagedDisksInAResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_ListByResourceGroup.json // this example is just showing the usage of "Disks_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskResource.cs index d572806803d3d..419ba7de9bdae 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskResource.cs @@ -21,7 +21,7 @@ public partial class Sample_ManagedDiskResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateABurstingEnabledManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task Update_CreateOrUpdateABurstingEnabledManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToAddAcceleratedNetworking() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Update_UpdateAManagedDiskToAddAcceleratedNetworking() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToAddArchitecture() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,7 +136,7 @@ public async Task Update_UpdateAManagedDiskToAddArchitecture() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToAddPurchasePlan() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -175,7 +175,7 @@ public async Task Update_UpdateAManagedDiskToAddPurchasePlan() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToAddSupportsHibernation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -211,7 +211,7 @@ public async Task Update_UpdateAManagedDiskToAddSupportsHibernation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToChangeTier() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_ChangeTier.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ChangeTier.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -247,7 +247,7 @@ public async Task Update_UpdateAManagedDiskToChangeTier() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToDisableBursting() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_DisableBursting.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableBursting.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -283,7 +283,7 @@ public async Task Update_UpdateAManagedDiskToDisableBursting() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToDisableOptimizedForFrequentAttach() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -319,7 +319,7 @@ public async Task Update_UpdateAManagedDiskToDisableOptimizedForFrequentAttach() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskWithDiskControllerTypes() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -358,7 +358,7 @@ public async Task Update_UpdateAManagedDiskWithDiskControllerTypes() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateManagedDiskToRemoveDiskAccessResourceAssociation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -394,7 +394,7 @@ public async Task Update_UpdateManagedDiskToRemoveDiskAccessResourceAssociation( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Get.json // this example is just showing the usage of "Disks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -425,7 +425,7 @@ public async Task Get_GetInformationAboutAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Delete.json // this example is just showing the usage of "Disks_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -452,7 +452,7 @@ public async Task Delete_DeleteAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetManagedDisks_ListAllManagedDisksInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_ListBySubscription.json // this example is just showing the usage of "Disks_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -484,7 +484,7 @@ public async Task GetManagedDisks_ListAllManagedDisksInASubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GrantAccess_GetASasOnAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_BeginGetAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_BeginGetAccess.json // this example is just showing the usage of "Disks_GrantAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -516,7 +516,7 @@ public async Task GrantAccess_GetASasOnAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GrantAccess_GetSasOnManagedDiskAndVMGuestState() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json // this example is just showing the usage of "Disks_GrantAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -548,7 +548,7 @@ public async Task GrantAccess_GetSasOnManagedDiskAndVMGuestState() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RevokeAccess_RevokeAccessToAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_EndGetAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_EndGetAccess.json // this example is just showing the usage of "Disks_RevokeAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupCollection.cs index f748329831efc..48462229016b3 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ProximityPlacementGroupCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAProximityPlacementGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json // this example is just showing the usage of "ProximityPlacementGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAProximityPlacementGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetProximityPlacementGroups() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json // this example is just showing the usage of "ProximityPlacementGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Get_GetProximityPlacementGroups() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetProximityPlacementGroups() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json // this example is just showing the usage of "ProximityPlacementGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +132,7 @@ public async Task Exists_GetProximityPlacementGroups() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetProximityPlacementGroups() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json // this example is just showing the usage of "ProximityPlacementGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task GetIfExists_GetProximityPlacementGroups() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListProximityPlacementGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json // this example is just showing the usage of "ProximityPlacementGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupResource.cs index fd2910e1b341a..73f9e5600c5fb 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupResource.cs @@ -21,7 +21,7 @@ public partial class Sample_ProximityPlacementGroupResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAProximityPlacementGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json // this example is just showing the usage of "ProximityPlacementGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task Update_UpdateAProximityPlacementGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAProximityPlacementGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json // this example is just showing the usage of "ProximityPlacementGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Delete_DeleteAProximityPlacementGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetProximityPlacementGroups() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json // this example is just showing the usage of "ProximityPlacementGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Get_GetProximityPlacementGroups() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetProximityPlacementGroups_ListProximityPlacementGroups() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json // this example is just showing the usage of "ProximityPlacementGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointCollection.cs index b1c2d6815157d..a626baa023fd8 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_RestorePointCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CopyARestorePointToADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json // this example is just showing the usage of "RestorePoints_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CopyARestorePointToADifferentRegion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateARestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Create.json // this example is just showing the usage of "RestorePoints_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +106,7 @@ public async Task CreateOrUpdate_CreateARestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -141,7 +141,7 @@ public async Task Get_GetARestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetARestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +172,7 @@ public async Task Exists_GetARestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetARestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -215,7 +215,7 @@ public async Task GetIfExists_GetARestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRestorePointWithInstanceView() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -250,7 +250,7 @@ public async Task Get_GetRestorePointWithInstanceView() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRestorePointWithInstanceView() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -281,7 +281,7 @@ public async Task Exists_GetRestorePointWithInstanceView() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRestorePointWithInstanceView() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupCollection.cs index 278e49e1ce45e..90f19542dd5ff 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_RestorePointGroupCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateARestorePointCollectionForCrossRegionCopy() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json // this example is just showing the usage of "RestorePointCollections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -67,7 +67,7 @@ public async Task CreateOrUpdate_CreateOrUpdateARestorePointCollectionForCrossRe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateARestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate.json // this example is just showing the usage of "RestorePointCollections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task CreateOrUpdate_CreateOrUpdateARestorePointCollection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -147,7 +147,7 @@ public async Task Get_GetARestorePointCollectionButNotTheRestorePointsContainedI [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -177,7 +177,7 @@ public async Task Exists_GetARestorePointCollectionButNotTheRestorePointsContain [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -219,7 +219,7 @@ public async Task GetIfExists_GetARestorePointCollectionButNotTheRestorePointsCo [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -253,7 +253,7 @@ public async Task Get_GetARestorePointCollectionIncludingTheRestorePointsContain [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -283,7 +283,7 @@ public async Task Exists_GetARestorePointCollectionIncludingTheRestorePointsCont [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -325,7 +325,7 @@ public async Task GetIfExists_GetARestorePointCollectionIncludingTheRestorePoint [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsTheListOfRestorePointCollectionsInAResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json // this example is just showing the usage of "RestorePointCollections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupResource.cs index 55d04bdc1b561..5629709a8917b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupResource.cs @@ -21,7 +21,7 @@ public partial class Sample_RestorePointGroupResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_RestorePointCollectionUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json // this example is just showing the usage of "RestorePointCollections_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task Update_RestorePointCollectionUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_RestorePointCollectionUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json // this example is just showing the usage of "RestorePointCollections_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Update_RestorePointCollectionUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_RestorePointCollectionDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json // this example is just showing the usage of "RestorePointCollections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task Delete_RestorePointCollectionDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_RestorePointCollectionDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json // this example is just showing the usage of "RestorePointCollections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +149,7 @@ public async Task Delete_RestorePointCollectionDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -180,7 +180,7 @@ public async Task Get_GetARestorePointCollectionButNotTheRestorePointsContainedI [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -211,7 +211,7 @@ public async Task Get_GetARestorePointCollectionIncludingTheRestorePointsContain [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorePointGroups_GetsTheListOfRestorePointCollectionsInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json // this example is just showing the usage of "RestorePointCollections_ListAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointResource.cs index 80a253862449e..35ca6bb173500 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointResource.cs @@ -20,7 +20,7 @@ public partial class Sample_RestorePointResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CopyARestorePointToADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json // this example is just showing the usage of "RestorePoints_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task Update_CopyARestorePointToADifferentRegion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateARestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Create.json // this example is just showing the usage of "RestorePoints_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Update_CreateARestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_RestorePointDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json // this example is just showing the usage of "RestorePoints_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task Delete_RestorePointDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_RestorePointDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json // this example is just showing the usage of "RestorePoints_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task Delete_RestorePointDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -188,7 +188,7 @@ public async Task Get_GetARestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRestorePointWithInstanceView() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotCollection.cs index 5a1a1912945a9..f6f3e9560e085 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_SnapshotCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_CreateASnapshotByImportingAnUnmanagedBlobFromAD [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +106,7 @@ public async Task CreateOrUpdate_CreateASnapshotByImportingAnUnmanagedBlobFromTh [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateASnapshotFromAnElasticSanVolumeSnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_FromAnElasticSanVolumeSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_FromAnElasticSanVolumeSnapshot.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -148,7 +148,7 @@ public async Task CreateOrUpdate_CreateASnapshotFromAnElasticSanVolumeSnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_EnhancedProvisionedBandwidthCopySpeed.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_EnhancedProvisionedBandwidthCopySpeed.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -191,7 +191,7 @@ public async Task CreateOrUpdate_CreateASnapshotFromAnExistingSnapshotInTheSameO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -233,7 +233,7 @@ public async Task CreateOrUpdate_CreateASnapshotFromAnExistingSnapshotInTheSameO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -275,7 +275,7 @@ public async Task CreateOrUpdate_CreateASnapshotFromAnExistingSnapshotInTheSameO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Get.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -309,7 +309,7 @@ public async Task Get_GetInformationAboutASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Get.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -339,7 +339,7 @@ public async Task Exists_GetInformationAboutASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Get.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -381,7 +381,7 @@ public async Task GetIfExists_GetInformationAboutASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAnIncrementalSnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -415,7 +415,7 @@ public async Task Get_GetInformationAboutAnIncrementalSnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutAnIncrementalSnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -445,7 +445,7 @@ public async Task Exists_GetInformationAboutAnIncrementalSnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutAnIncrementalSnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -487,7 +487,7 @@ public async Task GetIfExists_GetInformationAboutAnIncrementalSnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAllSnapshotsInAResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json // this example is just showing the usage of "Snapshots_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotResource.cs index 55b3ea8ce23e4..a1f5cf3c675c7 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SnapshotResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateASnapshotWithAcceleratedNetworking() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json // this example is just showing the usage of "Snapshots_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task Update_UpdateASnapshotWithAcceleratedNetworking() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Update.json // this example is just showing the usage of "Snapshots_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -107,7 +107,7 @@ public async Task Update_UpdateASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Get.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task Get_GetInformationAboutASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAnIncrementalSnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -169,7 +169,7 @@ public async Task Get_GetInformationAboutAnIncrementalSnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Delete.json // this example is just showing the usage of "Snapshots_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,7 +196,7 @@ public async Task Delete_DeleteASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSnapshots_ListAllSnapshotsInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_ListBySubscription.json // this example is just showing the usage of "Snapshots_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -228,7 +228,7 @@ public async Task GetSnapshots_ListAllSnapshotsInASubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GrantAccess_GetASasOnASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json // this example is just showing the usage of "Snapshots_GrantAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -260,7 +260,7 @@ public async Task GrantAccess_GetASasOnASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RevokeAccess_RevokeAccessToASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_EndGetAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_EndGetAccess.json // this example is just showing the usage of "Snapshots_RevokeAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyCollection.cs index 3cdfe79a85bee..656fb087eb445 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_SshPublicKeyCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_SshPublicKeyListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetAll_SshPublicKeyListByResourceGroupMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_SshPublicKeyListByResourceGroupMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task GetAll_SshPublicKeyListByResourceGroupMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateANewSSHPublicKeyResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Create.json // this example is just showing the usage of "SshPublicKeys_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task CreateOrUpdate_CreateANewSSHPublicKeyResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnSshPublicKey() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json // this example is just showing the usage of "SshPublicKeys_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task Get_GetAnSshPublicKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAnSshPublicKey() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json // this example is just showing the usage of "SshPublicKeys_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -195,7 +195,7 @@ public async Task Exists_GetAnSshPublicKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAnSshPublicKey() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json // this example is just showing the usage of "SshPublicKeys_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyResource.cs index 06c2130990202..bf39ea29ce94d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SshPublicKeyResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSshPublicKeys_SshPublicKeyListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task GetSshPublicKeys_SshPublicKeyListBySubscriptionMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSshPublicKeys_SshPublicKeyListBySubscriptionMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -85,7 +85,7 @@ public async Task GetSshPublicKeys_SshPublicKeyListBySubscriptionMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_SshPublicKeyUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Update_SshPublicKeyUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_SshPublicKeyUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task Update_SshPublicKeyUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_SshPublicKeyDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -183,7 +183,7 @@ public async Task Delete_SshPublicKeyDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_SshPublicKeyDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +210,7 @@ public async Task Delete_SshPublicKeyDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnSshPublicKey() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json // this example is just showing the usage of "SshPublicKeys_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -241,7 +241,7 @@ public async Task Get_GetAnSshPublicKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GenerateKeyPair_GenerateAnSSHKeyPairWithEd25519Encryption() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json // this example is just showing the usage of "SshPublicKeys_GenerateKeyPair" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -260,7 +260,7 @@ public async Task GenerateKeyPair_GenerateAnSSHKeyPairWithEd25519Encryption() // invoke the operation SshGenerateKeyPairInputContent content = new SshGenerateKeyPairInputContent() { - EncryptionType = SshEncryptionType.RSA, + EncryptionType = SshEncryptionType.Ed25519, }; SshPublicKeyGenerateKeyPairResult result = await sshPublicKey.GenerateKeyPairAsync(content: content); @@ -272,7 +272,7 @@ public async Task GenerateKeyPair_GenerateAnSSHKeyPairWithEd25519Encryption() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GenerateKeyPair_GenerateAnSSHKeyPairWithRSAEncryption() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json // this example is just showing the usage of "SshPublicKeys_GenerateKeyPair" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -303,7 +303,7 @@ public async Task GenerateKeyPair_GenerateAnSSHKeyPairWithRSAEncryption() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GenerateKeyPair_GenerateAnSSHKeyPair() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json // this example is just showing the usage of "SshPublicKeys_GenerateKeyPair" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 0bcdb3d0eafcf..a1d33d2dd501e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsages_UsageListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json // this example is just showing the usage of "Usage_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task GetUsages_UsageListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsages_UsageListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json // this example is just showing the usage of "Usage_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,7 +79,7 @@ public async Task GetUsages_UsageListMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineSizes_VirtualMachineSizesListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineSizes_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +108,7 @@ public async Task GetVirtualMachineSizes_VirtualMachineSizesListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineSizes_VirtualMachineSizesListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineSizes_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,7 +137,7 @@ public async Task GetVirtualMachineSizes_VirtualMachineSizesListMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImage_VirtualMachineImageGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task GetVirtualMachineImage_VirtualMachineImageGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImage_VirtualMachineImageGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -197,7 +197,7 @@ public async Task GetVirtualMachineImage_VirtualMachineImageGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImages_VirtualMachineImageListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -226,7 +226,7 @@ public async Task GetVirtualMachineImages_VirtualMachineImageListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImages_VirtualMachineImageListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -255,7 +255,7 @@ public async Task GetVirtualMachineImages_VirtualMachineImageListMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImageOffers_VirtualMachineImageListOffersMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListOffers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -285,7 +285,7 @@ public async Task GetVirtualMachineImageOffers_VirtualMachineImageListOffersMaxi [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImageOffers_VirtualMachineImageListOffersMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListOffers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -315,7 +315,7 @@ public async Task GetVirtualMachineImageOffers_VirtualMachineImageListOffersMini [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagePublishers_VirtualMachineImageListPublishersMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListPublishers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -344,7 +344,7 @@ public async Task GetVirtualMachineImagePublishers_VirtualMachineImageListPublis [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagePublishers_VirtualMachineImageListPublishersMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListPublishers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -373,7 +373,7 @@ public async Task GetVirtualMachineImagePublishers_VirtualMachineImageListPublis [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImageSkus_VirtualMachineImageListSkusMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -404,7 +404,7 @@ public async Task GetVirtualMachineImageSkus_VirtualMachineImageListSkusMaximumS [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImageSkus_VirtualMachineImageListSkusMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -435,7 +435,7 @@ public async Task GetVirtualMachineImageSkus_VirtualMachineImageListSkusMinimumS [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagesByEdgeZone_VirtualMachineImagesEdgeZoneListByEdgeZoneMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListByEdgeZone" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -465,7 +465,7 @@ public async Task GetVirtualMachineImagesByEdgeZone_VirtualMachineImagesEdgeZone [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagesByEdgeZone_VirtualMachineImagesEdgeZoneListByEdgeZoneMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListByEdgeZone" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -495,7 +495,7 @@ public async Task GetVirtualMachineImagesByEdgeZone_VirtualMachineImagesEdgeZone [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagesEdgeZone_VirtualMachineImagesEdgeZoneGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -521,7 +521,7 @@ public async Task GetVirtualMachineImagesEdgeZone_VirtualMachineImagesEdgeZoneGe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagesEdgeZone_VirtualMachineImagesEdgeZoneGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -547,7 +547,7 @@ public async Task GetVirtualMachineImagesEdgeZone_VirtualMachineImagesEdgeZoneGe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -576,7 +576,7 @@ public async Task GetVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneL [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -605,7 +605,7 @@ public async Task GetVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneL [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOffersVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneListOffersMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_ListOffers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -636,7 +636,7 @@ public async Task GetOffersVirtualMachineImagesEdgeZones_VirtualMachineImagesEdg [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOffersVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneListOffersMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_ListOffers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -667,7 +667,7 @@ public async Task GetOffersVirtualMachineImagesEdgeZones_VirtualMachineImagesEdg [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetPublishersVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneListPublishersMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_ListPublishers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -697,7 +697,7 @@ public async Task GetPublishersVirtualMachineImagesEdgeZones_VirtualMachineImage [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetPublishersVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneListPublishersMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_ListPublishers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -727,7 +727,7 @@ public async Task GetPublishersVirtualMachineImagesEdgeZones_VirtualMachineImage [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImageEdgeZoneSkus_VirtualMachineImagesEdgeZoneListSkusMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -759,7 +759,7 @@ public async Task GetVirtualMachineImageEdgeZoneSkus_VirtualMachineImagesEdgeZon [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImageEdgeZoneSkus_VirtualMachineImagesEdgeZoneListSkusMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -791,7 +791,7 @@ public async Task GetVirtualMachineImageEdgeZoneSkus_VirtualMachineImagesEdgeZon [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ExportLogAnalyticsRequestRateByInterval_ExportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json // this example is just showing the usage of "LogAnalytics_ExportRequestRateByInterval" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -822,7 +822,7 @@ public async Task ExportLogAnalyticsRequestRateByInterval_ExportLogsWhichContain [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ExportLogAnalyticsThrottledRequests_ExportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json // this example is just showing the usage of "LogAnalytics_ExportThrottledRequests" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineCollection.cs index 815cd4f384f4b..352de45c29301 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_VirtualMachineCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingAssessmentModeOfImageDefault() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +108,7 @@ public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingAssessmentModeOf [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -200,7 +200,7 @@ public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingPatchModeOfAutom [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingPatchModeOfImageDefault() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -286,7 +286,7 @@ public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingPatchModeOfImage [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -373,7 +373,7 @@ public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingsPatchModeAndAss [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMFromACommunityGalleryImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -448,7 +448,7 @@ public async Task CreateOrUpdate_CreateAVMFromACommunityGalleryImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMFromASharedGalleryImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -523,7 +523,7 @@ public async Task CreateOrUpdate_CreateAVMFromASharedGalleryImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithDiskControllerType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -617,7 +617,7 @@ public async Task CreateOrUpdate_CreateAVMWithDiskControllerType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithHibernationEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -704,7 +704,7 @@ public async Task CreateOrUpdate_CreateAVMWithHibernationEnabled() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithProxyAgentSettingsOfEnabledAndMode() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithProxyAgentSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithProxyAgentSettings.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -790,7 +790,7 @@ public async Task CreateOrUpdate_CreateAVMWithProxyAgentSettingsOfEnabledAndMode [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithUefiSettingsOfSecureBootAndVTPM() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -877,7 +877,7 @@ public async Task CreateOrUpdate_CreateAVMWithUefiSettingsOfSecureBootAndVTPM() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUserData.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -961,7 +961,7 @@ public async Task CreateOrUpdate_CreateAVMWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1050,7 +1050,7 @@ public async Task CreateOrUpdate_CreateAVMWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithEncryptionIdentity() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionIdentity.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionIdentity.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1139,7 +1139,7 @@ public async Task CreateOrUpdate_CreateAVMWithEncryptionIdentity() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithNetworkInterfaceConfiguration() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1235,7 +1235,7 @@ public async Task CreateOrUpdate_CreateAVMWithNetworkInterfaceConfiguration() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithNetworkInterfaceConfigurationWithPublicIpAddressDnsSettings() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfigurationDnsSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfigurationDnsSettings.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1335,7 +1335,7 @@ public async Task CreateOrUpdate_CreateAVMWithNetworkInterfaceConfigurationWithP [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1427,7 +1427,7 @@ public async Task CreateOrUpdate_CreateAVMWithSecurityTypeConfidentialVMWithCust [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithSecurityTypeConfidentialVMWithNonPersistedTPMSecurityEncryptionType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1518,7 +1518,7 @@ public async Task CreateOrUpdate_CreateAVMWithSecurityTypeConfidentialVMWithNonP [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1609,7 +1609,7 @@ public async Task CreateOrUpdate_CreateAVMWithSecurityTypeConfidentialVMWithPlat [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1696,7 +1696,7 @@ public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingAssessmentMode [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOS() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1783,7 +1783,7 @@ public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfAut [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1876,7 +1876,7 @@ public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfAut [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1964,7 +1964,7 @@ public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfAut [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfManual() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2051,7 +2051,7 @@ public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfMan [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2139,7 +2139,7 @@ public async Task CreateOrUpdate_CreateAWindowsVmWithPatchSettingsPatchModeAndAs [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateACustomImageVmFromAnUnmanagedGeneralizedOsImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2209,7 +2209,7 @@ public async Task CreateOrUpdate_CreateACustomImageVmFromAnUnmanagedGeneralizedO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAPlatformImageVmWithUnmanagedOsAndDataDisks() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2296,7 +2296,7 @@ public async Task CreateOrUpdate_CreateAPlatformImageVmWithUnmanagedOsAndDataDis [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmFromACustomImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2371,7 +2371,7 @@ public async Task CreateOrUpdate_CreateAVmFromACustomImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmFromAGeneralizedSharedImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2446,7 +2446,7 @@ public async Task CreateOrUpdate_CreateAVmFromAGeneralizedSharedImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmFromASpecializedSharedImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2515,7 +2515,7 @@ public async Task CreateOrUpdate_CreateAVmFromASpecializedSharedImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2595,7 +2595,7 @@ public async Task CreateOrUpdate_CreateAVmInAVirtualMachineScaleSetWithCustomerA [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmInAnAvailabilitySet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2674,7 +2674,7 @@ public async Task CreateOrUpdate_CreateAVmInAnAvailabilitySet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithApplicationProfile() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2763,7 +2763,7 @@ public async Task CreateOrUpdate_CreateAVmWithApplicationProfile() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2862,7 +2862,7 @@ public async Task CreateOrUpdate_CreateAVmWithDiskEncryptionSetResourceIdInTheOs [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithHostEncryptionUsingEncryptionAtHostProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2950,7 +2950,7 @@ public async Task CreateOrUpdate_CreateAVmWithHostEncryptionUsingEncryptionAtHos [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithScheduledEventsProfile() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3055,7 +3055,7 @@ public async Task CreateOrUpdate_CreateAVmWithScheduledEventsProfile() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithAMarketplaceImagePlan() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3139,7 +3139,7 @@ public async Task CreateOrUpdate_CreateAVmWithAMarketplaceImagePlan() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithAnExtensionsTimeBudget() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3223,7 +3223,7 @@ public async Task CreateOrUpdate_CreateAVmWithAnExtensionsTimeBudget() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithBootDiagnostics() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3306,7 +3306,7 @@ public async Task CreateOrUpdate_CreateAVmWithBootDiagnostics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithDataDisksUsingCopyAndRestoreOptions() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDataDisksFromSourceResource.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDataDisksFromSourceResource.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3400,7 +3400,7 @@ public async Task CreateOrUpdate_CreateAVmWithDataDisksUsingCopyAndRestoreOption [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithEmptyDataDisks() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3488,7 +3488,7 @@ public async Task CreateOrUpdate_CreateAVmWithEmptyDataDisks() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3577,7 +3577,7 @@ public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDiskProvisioningInCache [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3666,7 +3666,7 @@ public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDiskProvisioningInNvmeD [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3755,7 +3755,7 @@ public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDiskProvisioningInResou [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3843,7 +3843,7 @@ public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithManagedBootDiagnostics() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3925,7 +3925,7 @@ public async Task CreateOrUpdate_CreateAVmWithManagedBootDiagnostics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithPasswordAuthentication() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4003,7 +4003,7 @@ public async Task CreateOrUpdate_CreateAVmWithPasswordAuthentication() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithPremiumStorage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4081,7 +4081,7 @@ public async Task CreateOrUpdate_CreateAVmWithPremiumStorage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithSshAuthentication() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4170,7 +4170,7 @@ public async Task CreateOrUpdate_CreateAVmWithSshAuthentication() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAVMWithCapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4255,7 +4255,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAVMWithCapacityReservation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4290,7 +4290,7 @@ public async Task Get_GetAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4321,7 +4321,7 @@ public async Task Exists_GetAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4364,7 +4364,7 @@ public async Task GetIfExists_GetAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4398,7 +4398,7 @@ public async Task Get_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutoma [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4428,7 +4428,7 @@ public async Task Exists_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAut [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4470,7 +4470,7 @@ public async Task GetIfExists_GetAVirtualMachinePlacedOnADedicatedHostGroupThrou [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineWithDiskControllerTypeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4505,7 +4505,7 @@ public async Task Get_GetAVirtualMachineWithDiskControllerTypeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachineWithDiskControllerTypeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4536,7 +4536,7 @@ public async Task Exists_GetAVirtualMachineWithDiskControllerTypeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachineWithDiskControllerTypeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4579,7 +4579,7 @@ public async Task GetIfExists_GetAVirtualMachineWithDiskControllerTypeProperties [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4613,7 +4613,7 @@ public async Task Get_GetAVirtualMachineWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachineWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4643,7 +4643,7 @@ public async Task Exists_GetAVirtualMachineWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachineWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4685,7 +4685,7 @@ public async Task GetIfExists_GetAVirtualMachineWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4722,7 +4722,7 @@ public async Task GetAll_VirtualMachineListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionCollection.cs index 23da9fe3b7c53..64266ea996ee4 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualMachineExtensionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VirtualMachineExtensionCreateOrUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -105,7 +105,7 @@ public async Task CreateOrUpdate_VirtualMachineExtensionCreateOrUpdateMaximumSet [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VirtualMachineExtensionCreateOrUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -142,7 +142,7 @@ public async Task CreateOrUpdate_VirtualMachineExtensionCreateOrUpdateMinimumSet [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -178,7 +178,7 @@ public async Task Get_VirtualMachineExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VirtualMachineExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +210,7 @@ public async Task Exists_VirtualMachineExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_VirtualMachineExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -254,7 +254,7 @@ public async Task GetIfExists_VirtualMachineExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -289,7 +289,7 @@ public async Task Get_VirtualMachineExtensionGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VirtualMachineExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -320,7 +320,7 @@ public async Task Exists_VirtualMachineExtensionGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_VirtualMachineExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -363,7 +363,7 @@ public async Task GetIfExists_VirtualMachineExtensionGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineExtensionListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -401,7 +401,7 @@ public async Task GetAll_VirtualMachineExtensionListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineExtensionListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageCollection.cs index 14ee270ff7daf..36c427bbf98ec 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualMachineExtensionImageCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionImageGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task Get_VirtualMachineExtensionImageGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VirtualMachineExtensionImageGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Exists_VirtualMachineExtensionImageGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_VirtualMachineExtensionImageGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +132,7 @@ public async Task GetIfExists_VirtualMachineExtensionImageGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionImageGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task Get_VirtualMachineExtensionImageGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VirtualMachineExtensionImageGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -200,7 +200,7 @@ public async Task Exists_VirtualMachineExtensionImageGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_VirtualMachineExtensionImageGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -244,7 +244,7 @@ public async Task GetIfExists_VirtualMachineExtensionImageGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineExtensionImageListTypesMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_ListTypes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -281,7 +281,7 @@ public async Task GetAll_VirtualMachineExtensionImageListTypesMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineExtensionImageListTypesMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_ListTypes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -318,7 +318,7 @@ public async Task GetAll_VirtualMachineExtensionImageListTypesMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineExtensionImageListVersionsMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_ListVersions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -359,7 +359,7 @@ public async Task GetAll_VirtualMachineExtensionImageListVersionsMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineExtensionImageListVersionsMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_ListVersions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageResource.cs index 15147ea7ee2d5..d06b1e238510d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageResource.cs @@ -19,7 +19,7 @@ public partial class Sample_VirtualMachineExtensionImageResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionImageGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_VirtualMachineExtensionImageGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionImageGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionResource.cs index 471feb982a212..0e6fb23ce46a4 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionResource.cs @@ -22,7 +22,7 @@ public partial class Sample_VirtualMachineExtensionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Update.json // this example is just showing the usage of "VirtualMachineExtensions_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -71,7 +71,7 @@ public async Task Update_UpdateVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_VirtualMachineExtensionDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task Delete_VirtualMachineExtensionDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_VirtualMachineExtensionDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task Delete_VirtualMachineExtensionDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Get_VirtualMachineExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineResource.cs index ea7529766ce33..d0d219cd78b3b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineResource.cs @@ -22,7 +22,7 @@ public partial class Sample_VirtualMachineResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachinesByLocation_ListsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json // this example is just showing the usage of "VirtualMachines_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task GetVirtualMachinesByLocation_ListsAllTheVirtualMachinesUnderTh [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Capture_VirtualMachineCaptureMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Capture" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +84,7 @@ public async Task Capture_VirtualMachineCaptureMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Capture_VirtualMachineCaptureMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Capture" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task Capture_VirtualMachineCaptureMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAVMByDetachingDataDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json // this example is just showing the usage of "VirtualMachines_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -200,7 +200,7 @@ public async Task Update_UpdateAVMByDetachingDataDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAVMByForceDetachingDataDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json // this example is just showing the usage of "VirtualMachines_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -288,7 +288,7 @@ public async Task Update_UpdateAVMByForceDetachingDataDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ForceDeleteAVM() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json // this example is just showing the usage of "VirtualMachines_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -316,7 +316,7 @@ public async Task Delete_ForceDeleteAVM() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -348,7 +348,7 @@ public async Task Get_GetAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -379,7 +379,7 @@ public async Task Get_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutoma [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineWithDiskControllerTypeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -411,7 +411,7 @@ public async Task Get_GetAVirtualMachineWithDiskControllerTypeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -442,7 +442,7 @@ public async Task Get_GetAVirtualMachineWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task InstanceView_GetVirtualMachineInstanceView() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json // this example is just showing the usage of "VirtualMachines_InstanceView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -469,7 +469,7 @@ public async Task InstanceView_GetVirtualMachineInstanceView() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task InstanceView_GetInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachines_InstanceView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -496,7 +496,7 @@ public async Task InstanceView_GetInstanceViewOfAVirtualMachinePlacedOnADedicate [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ConvertToManagedDisks_VirtualMachineConvertToManagedDisksMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_ConvertToManagedDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -523,7 +523,7 @@ public async Task ConvertToManagedDisks_VirtualMachineConvertToManagedDisksMaxim [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ConvertToManagedDisks_VirtualMachineConvertToManagedDisksMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_ConvertToManagedDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -550,7 +550,7 @@ public async Task ConvertToManagedDisks_VirtualMachineConvertToManagedDisksMinim [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_VirtualMachineDeallocateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -578,7 +578,7 @@ public async Task Deallocate_VirtualMachineDeallocateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_VirtualMachineDeallocateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -605,7 +605,7 @@ public async Task Deallocate_VirtualMachineDeallocateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Generalize_GeneralizeAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Generalize.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Generalize.json // this example is just showing the usage of "VirtualMachines_Generalize" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -632,7 +632,7 @@ public async Task Generalize_GeneralizeAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachines_VirtualMachineListAllMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_ListAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -666,7 +666,7 @@ public async Task GetVirtualMachines_VirtualMachineListAllMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachines_VirtualMachineListAllMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_ListAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -698,7 +698,7 @@ public async Task GetVirtualMachines_VirtualMachineListAllMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAvailableSizes_ListsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json // this example is just showing the usage of "VirtualMachines_ListAvailableSizes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -728,7 +728,7 @@ public async Task GetAvailableSizes_ListsAllAvailableVirtualMachineSizesToWhichT [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOff_VirtualMachinePowerOffMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_PowerOff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -756,7 +756,7 @@ public async Task PowerOff_VirtualMachinePowerOffMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOff_VirtualMachinePowerOffMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_PowerOff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -783,7 +783,7 @@ public async Task PowerOff_VirtualMachinePowerOffMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reapply_ReapplyTheStateOfAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Reapply.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Reapply.json // this example is just showing the usage of "VirtualMachines_Reapply" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -810,7 +810,7 @@ public async Task Reapply_ReapplyTheStateOfAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_VirtualMachineRestartMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -837,7 +837,7 @@ public async Task Restart_VirtualMachineRestartMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_VirtualMachineRestartMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -864,7 +864,7 @@ public async Task Restart_VirtualMachineRestartMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOn_VirtualMachineStartMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -891,7 +891,7 @@ public async Task PowerOn_VirtualMachineStartMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOn_VirtualMachineStartMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -918,7 +918,7 @@ public async Task PowerOn_VirtualMachineStartMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_VirtualMachineRedeployMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -945,7 +945,7 @@ public async Task Redeploy_VirtualMachineRedeployMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_VirtualMachineRedeployMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -972,7 +972,7 @@ public async Task Redeploy_VirtualMachineRedeployMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reimage_ReimageANonEphemeralVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json // this example is just showing the usage of "VirtualMachines_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1009,7 +1009,7 @@ public async Task Reimage_ReimageANonEphemeralVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reimage_ReimageAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Reimage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Reimage.json // this example is just showing the usage of "VirtualMachines_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1040,7 +1040,7 @@ public async Task Reimage_ReimageAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveBootDiagnosticsData_RetrieveBootDiagnosticsDataOfAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json // this example is just showing the usage of "VirtualMachines_RetrieveBootDiagnosticsData" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1068,7 +1068,7 @@ public async Task RetrieveBootDiagnosticsData_RetrieveBootDiagnosticsDataOfAVirt [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PerformMaintenance_VirtualMachinePerformMaintenanceMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_PerformMaintenance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1095,7 +1095,7 @@ public async Task PerformMaintenance_VirtualMachinePerformMaintenanceMaximumSetG [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PerformMaintenance_VirtualMachinePerformMaintenanceMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_PerformMaintenance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1122,7 +1122,7 @@ public async Task PerformMaintenance_VirtualMachinePerformMaintenanceMinimumSetG [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task SimulateEviction_SimulateEvictionAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json // this example is just showing the usage of "VirtualMachines_SimulateEviction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1149,7 +1149,7 @@ public async Task SimulateEviction_SimulateEvictionAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task AssessPatches_AssessPatchStateOfAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json // this example is just showing the usage of "VirtualMachines_AssessPatches" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1177,7 +1177,7 @@ public async Task AssessPatches_AssessPatchStateOfAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task InstallPatches_InstallPatchStateOfAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json // this example is just showing the usage of "VirtualMachines_InstallPatches" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1217,7 +1217,7 @@ public async Task InstallPatches_InstallPatchStateOfAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task AttachDetachDataDisks_VirtualMachineAttachDetachDataDisksMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_AttachDetachDataDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1276,7 +1276,7 @@ public async Task AttachDetachDataDisks_VirtualMachineAttachDetachDataDisksMaxim [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task AttachDetachDataDisks_VirtualMachineAttachDetachDataDisksMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_AttachDetachDataDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1315,7 +1315,7 @@ public async Task AttachDetachDataDisks_VirtualMachineAttachDetachDataDisksMinim [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RunCommand_VirtualMachineRunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand.json // this example is just showing the usage of "VirtualMachines_RunCommand" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandCollection.cs index 13dd9df4c7a74..bbde704b4e6f5 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualMachineRunCommandCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json // this example is just showing the usage of "VirtualMachineRunCommands_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task CreateOrUpdate_CreateOrUpdateARunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json // this example is just showing the usage of "VirtualMachineRunCommands_GetByVirtualMachine" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task Get_GetARunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json // this example is just showing the usage of "VirtualMachineRunCommands_GetByVirtualMachine" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,7 +144,7 @@ public async Task Exists_GetARunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json // this example is just showing the usage of "VirtualMachineRunCommands_GetByVirtualMachine" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -187,7 +187,7 @@ public async Task GetIfExists_GetARunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRunCommandsInAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_List.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_List.json // this example is just showing the usage of "VirtualMachineRunCommands_ListByVirtualMachine" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandResource.cs index dafa659bcf75b..407e0e7619692 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandResource.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualMachineRunCommandResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineRunCommands_VirtualMachineRunCommandList() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/RunCommand_List.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/RunCommand_List.json // this example is just showing the usage of "VirtualMachineRunCommands_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task GetVirtualMachineRunCommands_VirtualMachineRunCommandList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineRunCommand_VirtualMachineRunCommandGet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/RunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/RunCommand_Get.json // this example is just showing the usage of "VirtualMachineRunCommands_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task GetVirtualMachineRunCommand_VirtualMachineRunCommandGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_Update.json // this example is just showing the usage of "VirtualMachineRunCommands_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task Update_UpdateARunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json // this example is just showing the usage of "VirtualMachineRunCommands_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task Delete_DeleteARunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json // this example is just showing the usage of "VirtualMachineRunCommands_GetByVirtualMachine" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetCollection.cs index 47a1ff24f4570..3dde6dd43ad94 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_VirtualMachineScaleSetCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMSSWithAnExtensionThatHasSuppressFailuresEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -139,7 +139,7 @@ public async Task CreateOrUpdate_CreateAVMSSWithAnExtensionThatHasSuppressFailur [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMSSWithAnExtensionWithProtectedSettingsFromKeyVault() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -258,7 +258,7 @@ public async Task CreateOrUpdate_CreateAVMSSWithAnExtensionWithProtectedSettings [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -343,7 +343,7 @@ public async Task CreateOrUpdate_CreateACustomImageScaleSetFromAnUnmanagedGenera [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAPlatformImageScaleSetWithUnmanagedOsDisks() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -438,7 +438,7 @@ public async Task CreateOrUpdate_CreateAPlatformImageScaleSetWithUnmanagedOsDisk [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetFromACustomImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -529,7 +529,7 @@ public async Task CreateOrUpdate_CreateAScaleSetFromACustomImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetFromAGeneralizedSharedImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -620,7 +620,7 @@ public async Task CreateOrUpdate_CreateAScaleSetFromAGeneralizedSharedImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetFromASpecializedSharedImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -705,7 +705,7 @@ public async Task CreateOrUpdate_CreateAScaleSetFromASpecializedSharedImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -813,7 +813,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWhereNicConfigHasDisableTcpState [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithApplicationProfile() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -918,7 +918,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithApplicationProfile() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithDiskControllerType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1028,7 +1028,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithDiskControllerType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1133,7 +1133,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithDiskEncryptionSetResourceInO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithFpgaNetworkInterfaces() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1239,7 +1239,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithFpgaNetworkInterfaces() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1343,7 +1343,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithHostEncryptionUsingEncryptio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithNetworkInterfacesWithPublicIpAddressDnsSettings() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithNetworkInterfaceWithDnsSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithNetworkInterfaceWithDnsSettings.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1461,7 +1461,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithNetworkInterfacesWithPublicI [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithOSImageScheduledEventsEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1563,7 +1563,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithOSImageScheduledEventsEnable [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithProxyAgentSettingsOfEnabledAndMode() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProxyAgentSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProxyAgentSettings.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1665,7 +1665,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithProxyAgentSettingsOfEnabledA [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithResilientVMCreationEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMCreationPolicy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMCreationPolicy.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1763,7 +1763,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithResilientVMCreationEnabled() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithResilientVMDeletionEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMDeletionPolicy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMDeletionPolicy.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1861,7 +1861,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithResilientVMDeletionEnabled() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithSecurityPostureReference() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1938,10 +1938,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithSecurityPostureReference() } }, }, - SecurityPostureReference = new ComputeSecurityPostureReference() - { - Id = new ResourceIdentifier("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), - }, + SecurityPostureReference = new ComputeSecurityPostureReference(new ResourceIdentifier("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest")), }, Overprovision = true, }; @@ -1960,7 +1957,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithSecurityPostureReference() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithSecurityTypeAsConfidentialVM() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2067,7 +2064,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithSecurityTypeAsConfidentialVM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTPMSecurityEncryptionType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2174,7 +2171,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithSecurityTypeAsConfidentialVM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithServiceArtifactReference() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2270,7 +2267,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithServiceArtifactReference() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithUefiSettingsOfSecureBootAndVTPM() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2373,7 +2370,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithUefiSettingsOfSecureBootAndV [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithAMarketplaceImagePlan() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2473,7 +2470,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithAMarketplaceImagePlan() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithAnAzureApplicationGateway() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2574,7 +2571,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithAnAzureApplicationGateway() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithAnAzureLoadBalancer() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2686,7 +2683,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithAnAzureLoadBalancer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithAutomaticRepairsEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2794,7 +2791,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithAutomaticRepairsEnabled() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithBootDiagnostics() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2893,7 +2890,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithBootDiagnostics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithEmptyDataDisksOnEachVm() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2998,7 +2995,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithEmptyDataDisksOnEachVm() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3103,7 +3100,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithEphemeralOsDiskProvisioningI [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithEphemeralOsDisksUsingPlacementProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3208,7 +3205,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithEphemeralOsDisksUsingPlaceme [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithEphemeralOsDisks() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3312,7 +3309,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithEphemeralOsDisks() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithExtensionTimeBudget() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3428,7 +3425,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithExtensionTimeBudget() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithManagedBootDiagnostics() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3526,7 +3523,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithManagedBootDiagnostics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithPasswordAuthentication() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3620,7 +3617,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithPasswordAuthentication() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithPremiumStorage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3714,7 +3711,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithPremiumStorage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithPriorityMixPolicy() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3813,7 +3810,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithPriorityMixPolicy() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithScaleInPolicy() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3910,12 +3907,127 @@ public async Task CreateOrUpdate_CreateAScaleSetWithScaleInPolicy() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Create a scale set with sku profile + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAScaleSetWithSkuProfile() + { + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile.json + // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "{subscription-id}"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VirtualMachineScaleSetResource + VirtualMachineScaleSetCollection collection = resourceGroupResource.GetVirtualMachineScaleSets(); + + // invoke the operation + string virtualMachineScaleSetName = "{vmss-name}"; + VirtualMachineScaleSetData data = new VirtualMachineScaleSetData(new AzureLocation("westus")) + { + Sku = new ComputeSku() + { + Name = "Mix", + Capacity = 10, + }, + VirtualMachineProfile = new VirtualMachineScaleSetVmProfile() + { + OSProfile = new VirtualMachineScaleSetOSProfile() + { + ComputerNamePrefix = "{vmss-name}", + AdminUsername = "{your-username}", + AdminPassword = "{your-password}", + }, + StorageProfile = new VirtualMachineScaleSetStorageProfile() + { + ImageReference = new ImageReference() + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-Datacenter", + Version = "latest", + }, + OSDisk = new VirtualMachineScaleSetOSDisk(DiskCreateOptionType.FromImage) + { + Caching = CachingType.ReadWrite, + ManagedDisk = new VirtualMachineScaleSetManagedDisk() + { + StorageAccountType = StorageAccountType.StandardLrs, + }, + }, + }, + NetworkProfile = new VirtualMachineScaleSetNetworkProfile() + { + NetworkInterfaceConfigurations = +{ +new VirtualMachineScaleSetNetworkConfiguration("{vmss-name}") +{ +Primary = true, +IPConfigurations = +{ +new VirtualMachineScaleSetIPConfiguration("{vmss-name}") +{ +SubnetId = new ResourceIdentifier("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), +} +}, +EnableIPForwarding = true, +} +}, + }, + Priority = VirtualMachinePriorityType.Spot, + EvictionPolicy = VirtualMachineEvictionPolicyType.Deallocate, + BillingMaxPrice = -1, + }, + SinglePlacementGroup = false, + OrchestrationMode = OrchestrationMode.Flexible, + PriorityMixPolicy = new VirtualMachineScaleSetPriorityMixPolicy() + { + BaseRegularPriorityCount = 4, + RegularPriorityPercentageAboveBase = 50, + }, + SkuProfile = new ComputeSkuProfile() + { + VmSizes = +{ +new ComputeSkuProfileVmSize() +{ +Name = "Standard_D8s_v5", +},new ComputeSkuProfileVmSize() +{ +Name = "Standard_E16s_v5", +},new ComputeSkuProfileVmSize() +{ +Name = "Standard_D2s_v5", +} +}, + AllocationStrategy = ComputeAllocationStrategy.CapacityOptimized, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, virtualMachineScaleSetName, data); + VirtualMachineScaleSetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + VirtualMachineScaleSetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Create a scale set with spot restore policy [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithSpotRestorePolicy() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4017,7 +4129,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithSpotRestorePolicy() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithSshAuthentication() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4122,7 +4234,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithSshAuthentication() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithTerminateScheduledEventsEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4224,7 +4336,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithTerminateScheduledEventsEnab [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4319,7 +4431,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithVirtualMachinesInDifferentZones() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4428,7 +4540,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithVirtualMachinesInDifferentZo [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithVmSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4523,12 +4635,116 @@ public async Task CreateOrUpdate_CreateAScaleSetWithVmSizeProperties() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Create a scale set with zonalPlatformFaultDomainAlignMode as Aligned + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned() + { + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithZonalPlatformFaultDomainAlignMode.json + // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "{subscription-id}"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VirtualMachineScaleSetResource + VirtualMachineScaleSetCollection collection = resourceGroupResource.GetVirtualMachineScaleSets(); + + // invoke the operation + string virtualMachineScaleSetName = "{vmss-name}"; + VirtualMachineScaleSetData data = new VirtualMachineScaleSetData(new AzureLocation("westus")) + { + Sku = new ComputeSku() + { + Name = "Standard_D1_v2", + Tier = "Standard", + Capacity = 3, + }, + UpgradePolicy = new VirtualMachineScaleSetUpgradePolicy() + { + Mode = VirtualMachineScaleSetUpgradeMode.Manual, + }, + ScheduledEventsPolicy = new ScheduledEventsPolicy() + { + UserInitiatedRedeploy = new UserInitiatedRedeploy() + { + AutomaticallyApprove = true, + }, + AutomaticallyApprove = true, + Enable = true, + }, + VirtualMachineProfile = new VirtualMachineScaleSetVmProfile() + { + OSProfile = new VirtualMachineScaleSetOSProfile() + { + ComputerNamePrefix = "{vmss-name}", + AdminUsername = "{your-username}", + AdminPassword = "{your-password}", + }, + StorageProfile = new VirtualMachineScaleSetStorageProfile() + { + ImageReference = new ImageReference() + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-Datacenter", + Version = "latest", + }, + OSDisk = new VirtualMachineScaleSetOSDisk(DiskCreateOptionType.FromImage) + { + Caching = CachingType.ReadWrite, + ManagedDisk = new VirtualMachineScaleSetManagedDisk() + { + StorageAccountType = StorageAccountType.StandardLrs, + }, + }, + }, + NetworkProfile = new VirtualMachineScaleSetNetworkProfile() + { + NetworkInterfaceConfigurations = +{ +new VirtualMachineScaleSetNetworkConfiguration("{vmss-name}") +{ +Primary = true, +IPConfigurations = +{ +new VirtualMachineScaleSetIPConfiguration("{vmss-name}") +{ +SubnetId = new ResourceIdentifier("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), +} +}, +EnableIPForwarding = true, +} +}, + }, + }, + Overprovision = true, + ZonalPlatformFaultDomainAlignMode = ZonalPlatformFaultDomainAlignMode.Aligned, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, virtualMachineScaleSetName, data); + VirtualMachineScaleSetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + VirtualMachineScaleSetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Create or update a scale set with capacity reservation. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAScaleSetWithCapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4623,7 +4839,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAScaleSetWithCapacityReservation( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVMScaleSetVMWithDiskControllerType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4658,7 +4874,7 @@ public async Task Get_GetVMScaleSetVMWithDiskControllerType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetVMScaleSetVMWithDiskControllerType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4689,7 +4905,7 @@ public async Task Exists_GetVMScaleSetVMWithDiskControllerType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetVMScaleSetVMWithDiskControllerType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4732,7 +4948,7 @@ public async Task GetIfExists_GetVMScaleSetVMWithDiskControllerType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineScaleSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4766,7 +4982,7 @@ public async Task Get_GetAVirtualMachineScaleSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachineScaleSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4796,7 +5012,7 @@ public async Task Exists_GetAVirtualMachineScaleSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachineScaleSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4838,7 +5054,7 @@ public async Task GetIfExists_GetAVirtualMachineScaleSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4872,7 +5088,7 @@ public async Task Get_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThrou [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4902,7 +5118,7 @@ public async Task Exists_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupTh [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4944,7 +5160,7 @@ public async Task GetIfExists_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineScaleSetWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4979,7 +5195,7 @@ public async Task Get_GetAVirtualMachineScaleSetWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachineScaleSetWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -5010,7 +5226,7 @@ public async Task Exists_GetAVirtualMachineScaleSetWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachineScaleSetWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -5053,7 +5269,7 @@ public async Task GetIfExists_GetAVirtualMachineScaleSetWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineScaleSetListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -5089,7 +5305,7 @@ public async Task GetAll_VirtualMachineScaleSetListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineScaleSetListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionCollection.cs index fd37694c3c01a..6db66c5e18fee 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualMachineScaleSetExtensionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VirtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task CreateOrUpdate_VirtualMachineScaleSetExtensionCreateOrUpdateMa [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VirtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task CreateOrUpdate_VirtualMachineScaleSetExtensionCreateOrUpdateMi [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineScaleSetExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +149,7 @@ public async Task Get_VirtualMachineScaleSetExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VirtualMachineScaleSetExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -181,7 +181,7 @@ public async Task Exists_VirtualMachineScaleSetExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_VirtualMachineScaleSetExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -225,7 +225,7 @@ public async Task GetIfExists_VirtualMachineScaleSetExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineScaleSetExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -260,7 +260,7 @@ public async Task Get_VirtualMachineScaleSetExtensionGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VirtualMachineScaleSetExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -291,7 +291,7 @@ public async Task Exists_VirtualMachineScaleSetExtensionGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_VirtualMachineScaleSetExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -334,7 +334,7 @@ public async Task GetIfExists_VirtualMachineScaleSetExtensionGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineScaleSetExtensionListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -371,7 +371,7 @@ public async Task GetAll_VirtualMachineScaleSetExtensionListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineScaleSetExtensionListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionResource.cs index 9984e9982f824..f4b1bf57b9137 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionResource.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualMachineScaleSetExtensionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VirtualMachineScaleSetExtensionUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -74,7 +74,7 @@ public async Task Update_VirtualMachineScaleSetExtensionUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VirtualMachineScaleSetExtensionUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +108,7 @@ public async Task Update_VirtualMachineScaleSetExtensionUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_VirtualMachineScaleSetExtensionDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,7 +136,7 @@ public async Task Delete_VirtualMachineScaleSetExtensionDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_VirtualMachineScaleSetExtensionDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,7 +164,7 @@ public async Task Delete_VirtualMachineScaleSetExtensionDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineScaleSetExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -197,7 +197,7 @@ public async Task Get_VirtualMachineScaleSetExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineScaleSetExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetResource.cs index e5388ae7908ec..5b2e600267548 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetResource.cs @@ -24,7 +24,7 @@ public partial class Sample_VirtualMachineScaleSetResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineScaleSetsByLocation_ListsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json // this example is just showing the usage of "VirtualMachineScaleSets_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetVirtualMachineScaleSetsByLocation_ListsAllTheVMScaleSetsUnd [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VirtualMachineScaleSetUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,6 +96,10 @@ public async Task Update_VirtualMachineScaleSetUpdateMaximumSetGen() [new ResourceIdentifier("key3951")] = new UserAssignedIdentity(), }, }, + Zones = +{ +"1","2","3" +}, UpgradePolicy = new VirtualMachineScaleSetUpgradePolicy() { Mode = VirtualMachineScaleSetUpgradeMode.Manual, @@ -402,7 +406,7 @@ public async Task Update_VirtualMachineScaleSetUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VirtualMachineScaleSetUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -435,7 +439,7 @@ public async Task Update_VirtualMachineScaleSetUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ForceDeleteAVMScaleSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json // this example is just showing the usage of "VirtualMachineScaleSets_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -463,7 +467,7 @@ public async Task Delete_ForceDeleteAVMScaleSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVMScaleSetVMWithDiskControllerType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -495,7 +499,7 @@ public async Task Get_GetVMScaleSetVMWithDiskControllerType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineScaleSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -526,7 +530,7 @@ public async Task Get_GetAVirtualMachineScaleSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -557,7 +561,7 @@ public async Task Get_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThrou [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineScaleSetWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -589,7 +593,7 @@ public async Task Get_GetAVirtualMachineScaleSetWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_VirtualMachineScaleSetDeallocateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -624,7 +628,7 @@ public async Task Deallocate_VirtualMachineScaleSetDeallocateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_VirtualMachineScaleSetDeallocateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -651,7 +655,7 @@ public async Task Deallocate_VirtualMachineScaleSetDeallocateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task DeleteInstances_VirtualMachineScaleSetDeleteInstancesMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_DeleteInstances" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -683,7 +687,7 @@ public async Task DeleteInstances_VirtualMachineScaleSetDeleteInstancesMaximumSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task DeleteInstances_VirtualMachineScaleSetDeleteInstancesMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_DeleteInstances" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -714,7 +718,7 @@ public async Task DeleteInstances_VirtualMachineScaleSetDeleteInstancesMinimumSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetInstanceView_VirtualMachineScaleSetGetInstanceViewMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_GetInstanceView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -741,7 +745,7 @@ public async Task GetInstanceView_VirtualMachineScaleSetGetInstanceViewMaximumSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetInstanceView_VirtualMachineScaleSetGetInstanceViewMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_GetInstanceView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -768,7 +772,7 @@ public async Task GetInstanceView_VirtualMachineScaleSetGetInstanceViewMinimumSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineScaleSets_VirtualMachineScaleSetListAllMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ListAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -800,7 +804,7 @@ public async Task GetVirtualMachineScaleSets_VirtualMachineScaleSetListAllMaximu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineScaleSets_VirtualMachineScaleSetListAllMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ListAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -832,7 +836,7 @@ public async Task GetVirtualMachineScaleSets_VirtualMachineScaleSetListAllMinimu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSkus_VirtualMachineScaleSetListSkusMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -862,7 +866,7 @@ public async Task GetSkus_VirtualMachineScaleSetListSkusMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSkus_VirtualMachineScaleSetListSkusMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -892,7 +896,7 @@ public async Task GetSkus_VirtualMachineScaleSetListSkusMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOSUpgradeHistory_VirtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_GetOSUpgradeHistory" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -922,7 +926,7 @@ public async Task GetOSUpgradeHistory_VirtualMachineScaleSetGetOSUpgradeHistoryM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOSUpgradeHistory_VirtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_GetOSUpgradeHistory" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -952,7 +956,7 @@ public async Task GetOSUpgradeHistory_VirtualMachineScaleSetGetOSUpgradeHistoryM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOff_VirtualMachineScaleSetPowerOffMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_PowerOff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -987,7 +991,7 @@ public async Task PowerOff_VirtualMachineScaleSetPowerOffMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOff_VirtualMachineScaleSetPowerOffMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_PowerOff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1014,7 +1018,7 @@ public async Task PowerOff_VirtualMachineScaleSetPowerOffMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_VirtualMachineScaleSetRestartMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1048,7 +1052,7 @@ public async Task Restart_VirtualMachineScaleSetRestartMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_VirtualMachineScaleSetRestartMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1075,7 +1079,7 @@ public async Task Restart_VirtualMachineScaleSetRestartMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOn_VirtualMachineScaleSetStartMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1109,7 +1113,7 @@ public async Task PowerOn_VirtualMachineScaleSetStartMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOn_VirtualMachineScaleSetStartMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1136,7 +1140,7 @@ public async Task PowerOn_VirtualMachineScaleSetStartMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reapply_VirtualMachineScaleSetsReapplyMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Reapply" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1163,7 +1167,7 @@ public async Task Reapply_VirtualMachineScaleSetsReapplyMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reapply_VirtualMachineScaleSetsReapplyMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Reapply" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1190,7 +1194,7 @@ public async Task Reapply_VirtualMachineScaleSetsReapplyMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_VirtualMachineScaleSetRedeployMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1224,7 +1228,7 @@ public async Task Redeploy_VirtualMachineScaleSetRedeployMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_VirtualMachineScaleSetRedeployMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1251,7 +1255,7 @@ public async Task Redeploy_VirtualMachineScaleSetRedeployMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PerformMaintenance_VirtualMachineScaleSetPerformMaintenanceMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_PerformMaintenance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1285,7 +1289,7 @@ public async Task PerformMaintenance_VirtualMachineScaleSetPerformMaintenanceMax [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PerformMaintenance_VirtualMachineScaleSetPerformMaintenanceMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_PerformMaintenance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1312,7 +1316,7 @@ public async Task PerformMaintenance_VirtualMachineScaleSetPerformMaintenanceMin [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpdateInstances_VirtualMachineScaleSetUpdateInstancesMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_UpdateInstances" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1343,7 +1347,7 @@ public async Task UpdateInstances_VirtualMachineScaleSetUpdateInstancesMaximumSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpdateInstances_VirtualMachineScaleSetUpdateInstancesMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_UpdateInstances" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1374,7 +1378,7 @@ public async Task UpdateInstances_VirtualMachineScaleSetUpdateInstancesMinimumSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reimage_VirtualMachineScaleSetReimageMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1410,7 +1414,7 @@ public async Task Reimage_VirtualMachineScaleSetReimageMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reimage_VirtualMachineScaleSetReimageMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1437,7 +1441,7 @@ public async Task Reimage_VirtualMachineScaleSetReimageMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ReimageAll_VirtualMachineScaleSetReimageAllMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ReimageAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1471,7 +1475,7 @@ public async Task ReimageAll_VirtualMachineScaleSetReimageAllMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ReimageAll_VirtualMachineScaleSetReimageAllMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ReimageAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1498,7 +1502,7 @@ public async Task ReimageAll_VirtualMachineScaleSetReimageAllMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ApproveRollingUpgrade_VirtualMachineScaleSetApproveRollingUpgrade() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json // this example is just showing the usage of "VirtualMachineScaleSets_ApproveRollingUpgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1532,7 +1536,7 @@ public async Task ApproveRollingUpgrade_VirtualMachineScaleSetApproveRollingUpgr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ForceRecoveryServiceFabricPlatformUpdateDomainWalk_VirtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1560,7 +1564,7 @@ public async Task ForceRecoveryServiceFabricPlatformUpdateDomainWalk_VirtualMach [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ForceRecoveryServiceFabricPlatformUpdateDomainWalk_VirtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1588,7 +1592,7 @@ public async Task ForceRecoveryServiceFabricPlatformUpdateDomainWalk_VirtualMach [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ConvertToSinglePlacementGroup_VirtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ConvertToSinglePlacementGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1619,7 +1623,7 @@ public async Task ConvertToSinglePlacementGroup_VirtualMachineScaleSetConvertToS [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ConvertToSinglePlacementGroup_VirtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ConvertToSinglePlacementGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1647,7 +1651,7 @@ public async Task ConvertToSinglePlacementGroup_VirtualMachineScaleSetConvertToS [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task SetOrchestrationServiceState_VirtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_SetOrchestrationServiceState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1675,7 +1679,7 @@ public async Task SetOrchestrationServiceState_VirtualMachineScaleSetSetOrchestr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task SetOrchestrationServiceState_VirtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_SetOrchestrationServiceState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1703,7 +1707,7 @@ public async Task SetOrchestrationServiceState_VirtualMachineScaleSetSetOrchestr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CancelVirtualMachineScaleSetRollingUpgrade_VirtualMachineScaleSetRollingUpgradeCancelMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_Cancel" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1730,7 +1734,7 @@ public async Task CancelVirtualMachineScaleSetRollingUpgrade_VirtualMachineScale [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CancelVirtualMachineScaleSetRollingUpgrade_VirtualMachineScaleSetRollingUpgradeCancelMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_Cancel" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1757,7 +1761,7 @@ public async Task CancelVirtualMachineScaleSetRollingUpgrade_VirtualMachineScale [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StartOSUpgrade_VirtualMachineScaleSetRollingUpgradeStartOSUpgradeMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1784,7 +1788,7 @@ public async Task StartOSUpgrade_VirtualMachineScaleSetRollingUpgradeStartOSUpgr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StartOSUpgrade_VirtualMachineScaleSetRollingUpgradeStartOSUpgradeMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1811,7 +1815,7 @@ public async Task StartOSUpgrade_VirtualMachineScaleSetRollingUpgradeStartOSUpgr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StartExtensionUpgradeVirtualMachineScaleSetRollingUpgrade_StartAnExtensionRollingUpgrade() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_StartExtensionUpgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetRollingUpgradeResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetRollingUpgradeResource.cs index d0017e268481e..96e791efcc8b0 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetRollingUpgradeResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetRollingUpgradeResource.cs @@ -19,7 +19,7 @@ public partial class Sample_VirtualMachineScaleSetRollingUpgradeResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_GetLatest" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_VirtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_GetLatest" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmCollection.cs index 4e12c58ba421c..1a17b4cc2f063 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualMachineScaleSetVmCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VirtualMachineScaleSetVMUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -389,7 +389,7 @@ public async Task CreateOrUpdate_VirtualMachineScaleSetVMUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VirtualMachineScaleSetVMUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -426,7 +426,7 @@ public async Task CreateOrUpdate_VirtualMachineScaleSetVMUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVMScaleSetVMWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -461,7 +461,7 @@ public async Task Get_GetVMScaleSetVMWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetVMScaleSetVMWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -492,7 +492,7 @@ public async Task Exists_GetVMScaleSetVMWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetVMScaleSetVMWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -535,7 +535,7 @@ public async Task GetIfExists_GetVMScaleSetVMWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVMScaleSetVMWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -570,7 +570,7 @@ public async Task Get_GetVMScaleSetVMWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetVMScaleSetVMWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -601,7 +601,7 @@ public async Task Exists_GetVMScaleSetVMWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetVMScaleSetVMWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -644,7 +644,7 @@ public async Task GetIfExists_GetVMScaleSetVMWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineScaleSetVMListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -684,7 +684,7 @@ public async Task GetAll_VirtualMachineScaleSetVMListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineScaleSetVMListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionCollection.cs index 794d97412768f..ba3c05eb0a57c 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualMachineScaleSetVmExtensionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CreateVirtualMachineScaleSetVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -104,7 +104,7 @@ public async Task Get_GetVirtualMachineScaleSetVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,7 +136,7 @@ public async Task Exists_GetVirtualMachineScaleSetVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -180,7 +180,7 @@ public async Task GetIfExists_GetVirtualMachineScaleSetVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListExtensionsInVmssInstance() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionResource.cs index 5f2dbacf78be9..c135579c54dbe 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionResource.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualMachineScaleSetVmExtensionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task Update_UpdateVirtualMachineScaleSetVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Delete_DeleteVirtualMachineScaleSetVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmResource.cs index c8b6c8ef41817..9120da9247cc5 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmResource.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualMachineScaleSetVmResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reimage_VirtualMachineScaleSetVMReimageMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Reimage_VirtualMachineScaleSetVMReimageMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reimage_VirtualMachineScaleSetVMReimageMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Reimage_VirtualMachineScaleSetVMReimageMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ReimageAll_VirtualMachineScaleSetVMReimageAllMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_ReimageAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -110,7 +110,7 @@ public async Task ReimageAll_VirtualMachineScaleSetVMReimageAllMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ReimageAll_VirtualMachineScaleSetVMReimageAllMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_ReimageAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task ReimageAll_VirtualMachineScaleSetVMReimageAllMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ApproveRollingUpgrade_VirtualMachineScaleSetVMApproveRollingUpgrade() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_ApproveRollingUpgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task ApproveRollingUpgrade_VirtualMachineScaleSetVMApproveRollingUp [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_VirtualMachineScaleSetVMDeallocateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -194,7 +194,7 @@ public async Task Deallocate_VirtualMachineScaleSetVMDeallocateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_VirtualMachineScaleSetVMDeallocateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -222,7 +222,7 @@ public async Task Deallocate_VirtualMachineScaleSetVMDeallocateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VirtualMachineScaleSetVMUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -587,7 +587,7 @@ public async Task Update_VirtualMachineScaleSetVMUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VirtualMachineScaleSetVMUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -621,7 +621,7 @@ public async Task Update_VirtualMachineScaleSetVMUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ForceDeleteAVirtualMachineFromAVMScaleSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -650,7 +650,7 @@ public async Task Delete_ForceDeleteAVirtualMachineFromAVMScaleSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVMScaleSetVMWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -682,7 +682,7 @@ public async Task Get_GetVMScaleSetVMWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVMScaleSetVMWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -714,7 +714,7 @@ public async Task Get_GetVMScaleSetVMWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetInstanceView_GetInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_GetInstanceView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -742,7 +742,7 @@ public async Task GetInstanceView_GetInstanceViewOfAVirtualMachineFromAVMScaleSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOff_VirtualMachineScaleSetVMPowerOffMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_PowerOff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -771,7 +771,7 @@ public async Task PowerOff_VirtualMachineScaleSetVMPowerOffMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOff_VirtualMachineScaleSetVMPowerOffMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_PowerOff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -799,7 +799,7 @@ public async Task PowerOff_VirtualMachineScaleSetVMPowerOffMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_VirtualMachineScaleSetVMRestartMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -827,7 +827,7 @@ public async Task Restart_VirtualMachineScaleSetVMRestartMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_VirtualMachineScaleSetVMRestartMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -855,7 +855,7 @@ public async Task Restart_VirtualMachineScaleSetVMRestartMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOn_VirtualMachineScaleSetVMStartMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -883,7 +883,7 @@ public async Task PowerOn_VirtualMachineScaleSetVMStartMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOn_VirtualMachineScaleSetVMStartMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -911,7 +911,7 @@ public async Task PowerOn_VirtualMachineScaleSetVMStartMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_VirtualMachineScaleSetVMRedeployMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -939,7 +939,7 @@ public async Task Redeploy_VirtualMachineScaleSetVMRedeployMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_VirtualMachineScaleSetVMRedeployMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -967,7 +967,7 @@ public async Task Redeploy_VirtualMachineScaleSetVMRedeployMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveBootDiagnosticsData_RetrieveBootDiagnosticsDataOfAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_RetrieveBootDiagnosticsData" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -996,7 +996,7 @@ public async Task RetrieveBootDiagnosticsData_RetrieveBootDiagnosticsDataOfAVirt [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PerformMaintenance_VirtualMachineScaleSetVMPerformMaintenanceMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_PerformMaintenance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1024,7 +1024,7 @@ public async Task PerformMaintenance_VirtualMachineScaleSetVMPerformMaintenanceM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PerformMaintenance_VirtualMachineScaleSetVMPerformMaintenanceMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_PerformMaintenance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1052,7 +1052,7 @@ public async Task PerformMaintenance_VirtualMachineScaleSetVMPerformMaintenanceM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task SimulateEviction_SimulateEvictionAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_SimulateEviction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1080,7 +1080,7 @@ public async Task SimulateEviction_SimulateEvictionAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task AttachDetachDataDisks_VirtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_AttachDetachDataDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1138,7 +1138,7 @@ public async Task AttachDetachDataDisks_VirtualMachineScaleSetVMAttachDetachData [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task AttachDetachDataDisks_VirtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_AttachDetachDataDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1178,7 +1178,7 @@ public async Task AttachDetachDataDisks_VirtualMachineScaleSetVMAttachDetachData [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RunCommand_VirtualMachineScaleSetVMsRunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_RunCommand" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandCollection.cs index 2da24f5c669c0..6a6be30c2979d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualMachineScaleSetVmRunCommandCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateVirtualMachineScaleSetVMRunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +84,7 @@ public async Task CreateOrUpdate_CreateVirtualMachineScaleSetVMRunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVirtualMachineScaleSetVMRunCommands() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +120,7 @@ public async Task Get_GetVirtualMachineScaleSetVMRunCommands() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetVirtualMachineScaleSetVMRunCommands() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -152,7 +152,7 @@ public async Task Exists_GetVirtualMachineScaleSetVMRunCommands() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetVirtualMachineScaleSetVMRunCommands() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,7 +196,7 @@ public async Task GetIfExists_GetVirtualMachineScaleSetVMRunCommands() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRunCommandsInVmssInstance() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandResource.cs index 0e2901d2bae3d..9fb4a11494778 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandResource.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualMachineScaleSetVmRunCommandResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateVirtualMachineScaleSetVMRunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -65,7 +65,7 @@ public async Task Update_UpdateVirtualMachineScaleSetVMRunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteVirtualMachineScaleSetVMRunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Delete_DeleteVirtualMachineScaleSetVMRunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVirtualMachineScaleSetVMRunCommands() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj b/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj index 375047c4cf346..1da48e78a4b0b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj @@ -1,6 +1,6 @@ - 1.6.0-beta.1 + 1.6.0 1.5.0 Azure.ResourceManager.Compute diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/ComputeSecurityPostureReference.cs.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/ComputeSecurityPostureReference.cs.cs new file mode 100644 index 0000000000000..1bf4603a282e2 --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/ComputeSecurityPostureReference.cs.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Azure.Core; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01. + public partial class ComputeSecurityPostureReference + { + /// Initializes a new instance of . + [EditorBrowsable(EditorBrowsableState.Never)] + public ComputeSecurityPostureReference() + { + ExcludeExtensions = new ChangeTrackingList(); + ExcludeExtensionNames = new ChangeTrackingList(); + } + + /// List of virtual machine extensions to exclude when applying the Security Posture. This property is deprecated. Instead, use ExcludeExtensionNames that takes in list of strings. + [EditorBrowsable(EditorBrowsableState.Never)] + public IList ExcludeExtensions { get; } + } +} + + diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/WindowsConfiguration.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/WindowsConfiguration.cs index c1bb5464aeb10..898840ababc69 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/WindowsConfiguration.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/WindowsConfiguration.cs @@ -12,5 +12,8 @@ public partial class WindowsConfiguration /// Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. <br><br> For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. [EditorBrowsable(EditorBrowsableState.Never)] public bool? EnableAutomaticUpdates { get => IsAutomaticUpdatesEnabled; set => IsAutomaticUpdatesEnabled = value; } + + /// Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. + public bool? IsVmAgentPlatformUpdatesEnabled { get; [EditorBrowsable(EditorBrowsableState.Never)] set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ArmComputeModelFactory.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ArmComputeModelFactory.cs index fabe19ebcbb58..195d2f33d4429 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ArmComputeModelFactory.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ArmComputeModelFactory.cs @@ -107,7 +107,7 @@ public static VirtualMachineSize VirtualMachineSize(string name = null, int? num /// The virtual machine scale set sku. /// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. /// The identity of the virtual machine scale set, if configured. - /// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set. + /// The virtual machine scale set zones. /// The extended location of the Virtual Machine Scale Set. /// Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header to ensure optimistic updates. /// The upgrade policy. @@ -131,8 +131,10 @@ public static VirtualMachineSize VirtualMachineSize(string name = null, int? num /// Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. /// Optional property which must either be set to True or omitted. /// Policy for Resiliency. + /// Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. + /// Specifies the sku profile for the virtual machine scale set. /// A new instance for mocking. - public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ComputeSku sku = null, ComputePlan plan = null, ManagedServiceIdentity identity = null, IEnumerable zones = null, ExtendedLocation extendedLocation = null, string etag = null, VirtualMachineScaleSetUpgradePolicy upgradePolicy = null, ScheduledEventsPolicy scheduledEventsPolicy = null, AutomaticRepairsPolicy automaticRepairsPolicy = null, VirtualMachineScaleSetVmProfile virtualMachineProfile = null, string provisioningState = null, bool? overprovision = null, bool? doNotRunExtensionsOnOverprovisionedVms = null, string uniqueId = null, bool? singlePlacementGroup = null, bool? zoneBalance = null, int? platformFaultDomainCount = null, ResourceIdentifier proximityPlacementGroupId = null, ResourceIdentifier hostGroupId = null, AdditionalCapabilities additionalCapabilities = null, ScaleInPolicy scaleInPolicy = null, OrchestrationMode? orchestrationMode = null, SpotRestorePolicy spotRestorePolicy = null, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy = null, DateTimeOffset? timeCreated = null, bool? isMaximumCapacityConstrained = null, ResiliencyPolicy resiliencyPolicy = null) + public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ComputeSku sku = null, ComputePlan plan = null, ManagedServiceIdentity identity = null, IEnumerable zones = null, ExtendedLocation extendedLocation = null, string etag = null, VirtualMachineScaleSetUpgradePolicy upgradePolicy = null, ScheduledEventsPolicy scheduledEventsPolicy = null, AutomaticRepairsPolicy automaticRepairsPolicy = null, VirtualMachineScaleSetVmProfile virtualMachineProfile = null, string provisioningState = null, bool? overprovision = null, bool? doNotRunExtensionsOnOverprovisionedVms = null, string uniqueId = null, bool? singlePlacementGroup = null, bool? zoneBalance = null, int? platformFaultDomainCount = null, ResourceIdentifier proximityPlacementGroupId = null, ResourceIdentifier hostGroupId = null, AdditionalCapabilities additionalCapabilities = null, ScaleInPolicy scaleInPolicy = null, OrchestrationMode? orchestrationMode = null, SpotRestorePolicy spotRestorePolicy = null, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy = null, DateTimeOffset? timeCreated = null, bool? isMaximumCapacityConstrained = null, ResiliencyPolicy resiliencyPolicy = null, ZonalPlatformFaultDomainAlignMode? zonalPlatformFaultDomainAlignMode = null, ComputeSkuProfile skuProfile = null) { tags ??= new Dictionary(); zones ??= new List(); @@ -171,6 +173,8 @@ public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIden timeCreated, isMaximumCapacityConstrained, resiliencyPolicy, + zonalPlatformFaultDomainAlignMode, + skuProfile, serializedAdditionalRawData: null); } @@ -191,8 +195,8 @@ public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIden /// Specifies the gallery applications that should be made available to the VM/VMSS. /// Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. /// Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01. - /// Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01. - /// Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. Minimum API version for this property is 2024-03-01. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile with minimum api-version 2024-03-01. + /// Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01. + /// Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile. Minimum API version for this property is 2023-09-01. /// A new instance for mocking. public static VirtualMachineScaleSetVmProfile VirtualMachineScaleSetVmProfile(VirtualMachineScaleSetOSProfile osProfile = null, VirtualMachineScaleSetStorageProfile storageProfile = null, VirtualMachineScaleSetNetworkProfile networkProfile = null, SecurityProfile securityProfile = null, BootDiagnostics bootDiagnostics = null, VirtualMachineScaleSetExtensionProfile extensionProfile = null, string licenseType = null, VirtualMachinePriorityType? priority = null, VirtualMachineEvictionPolicyType? evictionPolicy = null, double? billingMaxPrice = null, ComputeScheduledEventsProfile scheduledEventsProfile = null, string userData = null, ResourceIdentifier capacityReservationGroupId = null, IEnumerable galleryApplications = null, VirtualMachineSizeProperties hardwareVmSizeProperties = null, ResourceIdentifier serviceArtifactReferenceId = null, ComputeSecurityPostureReference securityPostureReference = null, DateTimeOffset? timeCreated = null) { @@ -220,6 +224,31 @@ public static VirtualMachineScaleSetVmProfile VirtualMachineScaleSetVmProfile(Vi serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified in the request body, it is set to true by default. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. + /// Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. + /// Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + /// Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. + /// [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + /// Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. + /// Indicates whether VMAgent Platform Updates are enabled for the Windows Virtual Machine. + /// A new instance for mocking. + public static WindowsConfiguration WindowsConfiguration(bool? provisionVmAgent = null, bool? isAutomaticUpdatesEnabled = null, string timeZone = null, IEnumerable additionalUnattendContent = null, PatchSettings patchSettings = null, IEnumerable winRMListeners = null, bool? isVmAgentPlatformUpdatesEnabled = null) + { + additionalUnattendContent ??= new List(); + winRMListeners ??= new List(); + + return new WindowsConfiguration( + provisionVmAgent, + isAutomaticUpdatesEnabled, + timeZone, + additionalUnattendContent?.ToList(), + patchSettings, + winRMListeners != null ? new WinRMConfiguration(winRMListeners?.ToList(), serializedAdditionalRawData: null) : null, + isVmAgentPlatformUpdatesEnabled, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Resource Id. /// The image publisher. @@ -294,55 +323,6 @@ public static ComputeSubResourceData ComputeSubResourceData(ResourceIdentifier i return new ComputeSubResourceData(id, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// How the extension handler should be forced to update even if the extension configuration has not changed. - /// The name of the extension handler publisher. - /// Specifies the type of the extension; an example is "CustomScriptExtension". - /// Specifies the version of the script handler. - /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. - /// Json formatted public settings for the extension. - /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - /// The provisioning state, which only appears in the response. - /// The virtual machine extension instance view. - /// Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. - /// The extensions protected settings that are passed by reference, and consumed from key vault. - /// Collection of extension names after which this extension needs to be provisioned. - /// A new instance for mocking. - public static VirtualMachineExtensionData VirtualMachineExtensionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? autoUpgradeMinorVersion = null, bool? enableAutomaticUpgrade = null, BinaryData settings = null, BinaryData protectedSettings = null, string provisioningState = null, VirtualMachineExtensionInstanceView instanceView = null, bool? suppressFailures = null, KeyVaultSecretReference keyVaultProtectedSettings = null, IEnumerable provisionAfterExtensions = null) - { - tags ??= new Dictionary(); - provisionAfterExtensions ??= new List(); - - return new VirtualMachineExtensionData( - id, - name, - resourceType, - systemData, - tags, - location, - forceUpdateTag, - publisher, - extensionType, - typeHandlerVersion, - autoUpgradeMinorVersion, - enableAutomaticUpgrade, - settings, - protectedSettings, - provisioningState, - instanceView, - suppressFailures, - keyVaultProtectedSettings, - provisionAfterExtensions?.ToList(), - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The instance view status summary for the virtual machine scale set. /// The extensions information. @@ -674,8 +654,8 @@ public static VirtualMachineScaleSetVmExtensionPatch VirtualMachineScaleSetVmExt /// Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15. /// Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. /// Specifies the protection policy of the virtual machine. - /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01. - /// Specifies the time at which the Virtual Machine resource was created.<br><br>Minimum api-version: 2021-11-01. + /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. + /// Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. /// A new instance for mocking. public static VirtualMachineScaleSetVmData VirtualMachineScaleSetVmData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string instanceId = null, ComputeSku sku = null, ComputePlan plan = null, IEnumerable resources = null, IEnumerable zones = null, ManagedServiceIdentity identity = null, string etag = null, bool? latestModelApplied = null, string vmId = null, VirtualMachineScaleSetVmInstanceView instanceView = null, VirtualMachineHardwareProfile hardwareProfile = null, VirtualMachineStorageProfile storageProfile = null, AdditionalCapabilities additionalCapabilities = null, VirtualMachineOSProfile osProfile = null, SecurityProfile securityProfile = null, VirtualMachineNetworkProfile networkProfile = null, IEnumerable networkInterfaceConfigurations = null, BootDiagnostics bootDiagnostics = null, ResourceIdentifier availabilitySetId = null, string provisioningState = null, string licenseType = null, string modelDefinitionApplied = null, VirtualMachineScaleSetVmProtectionPolicy protectionPolicy = null, string userData = null, DateTimeOffset? timeCreated = null) { @@ -869,6 +849,55 @@ public static VirtualMachineDataDisk VirtualMachineDataDisk(int lun = default, s serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// How the extension handler should be forced to update even if the extension configuration has not changed. + /// The name of the extension handler publisher. + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// Specifies the version of the script handler. + /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + /// Json formatted public settings for the extension. + /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + /// The provisioning state, which only appears in the response. + /// The virtual machine extension instance view. + /// Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. + /// The extensions protected settings that are passed by reference, and consumed from key vault. + /// Collection of extension names after which this extension needs to be provisioned. + /// A new instance for mocking. + public static VirtualMachineExtensionData VirtualMachineExtensionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? autoUpgradeMinorVersion = null, bool? enableAutomaticUpgrade = null, BinaryData settings = null, BinaryData protectedSettings = null, string provisioningState = null, VirtualMachineExtensionInstanceView instanceView = null, bool? suppressFailures = null, KeyVaultSecretReference keyVaultProtectedSettings = null, IEnumerable provisionAfterExtensions = null) + { + tags ??= new Dictionary(); + provisionAfterExtensions ??= new List(); + + return new VirtualMachineExtensionData( + id, + name, + resourceType, + systemData, + tags, + location, + forceUpdateTag, + publisher, + extensionType, + typeHandlerVersion, + autoUpgradeMinorVersion, + enableAutomaticUpgrade, + settings, + protectedSettings, + provisioningState, + instanceView, + suppressFailures, + keyVaultProtectedSettings, + provisionAfterExtensions?.ToList(), + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The console screenshot blob URI. /// The serial console log blob URI. @@ -1382,8 +1411,9 @@ public static VirtualMachineExtensionImageData VirtualMachineExtensionImageData( /// A list of references to all virtual machines in the availability set. /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. /// The resource status information. + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. /// A new instance for mocking. - public static AvailabilitySetData AvailabilitySetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ComputeSku sku = null, int? platformUpdateDomainCount = null, int? platformFaultDomainCount = null, IEnumerable virtualMachines = null, ResourceIdentifier proximityPlacementGroupId = null, IEnumerable statuses = null) + public static AvailabilitySetData AvailabilitySetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ComputeSku sku = null, int? platformUpdateDomainCount = null, int? platformFaultDomainCount = null, IEnumerable virtualMachines = null, ResourceIdentifier proximityPlacementGroupId = null, IEnumerable statuses = null, ScheduledEventsPolicy scheduledEventsPolicy = null) { tags ??= new Dictionary(); virtualMachines ??= new List(); @@ -1402,6 +1432,7 @@ public static AvailabilitySetData AvailabilitySetData(ResourceIdentifier id = nu virtualMachines?.ToList(), proximityPlacementGroupId != null ? ResourceManagerModelFactory.WritableSubResource(proximityPlacementGroupId) : null, statuses?.ToList(), + scheduledEventsPolicy, serializedAdditionalRawData: null); } @@ -1413,8 +1444,9 @@ public static AvailabilitySetData AvailabilitySetData(ResourceIdentifier id = nu /// A list of references to all virtual machines in the availability set. /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. /// The resource status information. + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. /// A new instance for mocking. - public static AvailabilitySetPatch AvailabilitySetPatch(IDictionary tags = null, ComputeSku sku = null, int? platformUpdateDomainCount = null, int? platformFaultDomainCount = null, IEnumerable virtualMachines = null, ResourceIdentifier proximityPlacementGroupId = null, IEnumerable statuses = null) + public static AvailabilitySetPatch AvailabilitySetPatch(IDictionary tags = null, ComputeSku sku = null, int? platformUpdateDomainCount = null, int? platformFaultDomainCount = null, IEnumerable virtualMachines = null, ResourceIdentifier proximityPlacementGroupId = null, IEnumerable statuses = null, ScheduledEventsPolicy scheduledEventsPolicy = null) { tags ??= new Dictionary(); virtualMachines ??= new List(); @@ -1428,7 +1460,8 @@ public static AvailabilitySetPatch AvailabilitySetPatch(IDictionary Initializes a new instance of . @@ -1964,7 +1997,7 @@ public static RestorePointGroupPatch RestorePointGroupPatch(IDictionary A list of all capacity reservation resource ids that belong to capacity reservation group. /// A list of references to all virtual machines associated to the capacity reservation group. /// The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. - /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. /// A new instance for mocking. public static CapacityReservationGroupData CapacityReservationGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable zones = null, IEnumerable capacityReservations = null, IEnumerable virtualMachinesAssociated = null, CapacityReservationGroupInstanceView instanceView = null, IEnumerable sharingSubscriptionIds = null) { @@ -1991,7 +2024,7 @@ public static CapacityReservationGroupData CapacityReservationGroupData(Resource /// Initializes a new instance of . /// List of instance view of the capacity reservations under the capacity reservation group. - /// List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. /// A new instance for mocking. public static CapacityReservationGroupInstanceView CapacityReservationGroupInstanceView(IEnumerable capacityReservations = null, IEnumerable sharedSubscriptionIds = null) { @@ -2040,7 +2073,7 @@ public static CapacityReservationUtilization CapacityReservationUtilization(int? /// A list of all capacity reservation resource ids that belong to capacity reservation group. /// A list of references to all virtual machines associated to the capacity reservation group. /// The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. - /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. /// A new instance for mocking. public static CapacityReservationGroupPatch CapacityReservationGroupPatch(IDictionary tags = null, IEnumerable capacityReservations = null, IEnumerable virtualMachinesAssociated = null, CapacityReservationGroupInstanceView instanceView = null, IEnumerable sharingSubscriptionIds = null) { @@ -2773,8 +2806,9 @@ public static DiskEncryptionSetData DiskEncryptionSetData(ResourceIdentifier id /// Replication state of disk restore point when source resource is from a different region. /// Location of source disk or source disk restore point when source resource is from a different region. /// Contains the security related information for the resource. + /// Logical sector size in bytes for disk restore points of UltraSSD_LRS and PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the default. /// A new instance for mocking. - public static DiskRestorePointData DiskRestorePointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? timeCreated = null, ResourceIdentifier sourceResourceId = null, SupportedOperatingSystemType? osType = null, HyperVGeneration? hyperVGeneration = null, DiskPurchasePlan purchasePlan = null, SupportedCapabilities supportedCapabilities = null, string familyId = null, string sourceUniqueId = null, DiskEncryption encryption = null, bool? supportsHibernation = null, NetworkAccessPolicy? networkAccessPolicy = null, DiskPublicNetworkAccess? publicNetworkAccess = null, ResourceIdentifier diskAccessId = null, float? completionPercent = null, string replicationState = null, AzureLocation? sourceResourceLocation = null, DiskSecurityProfile securityProfile = null) + public static DiskRestorePointData DiskRestorePointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? timeCreated = null, ResourceIdentifier sourceResourceId = null, SupportedOperatingSystemType? osType = null, HyperVGeneration? hyperVGeneration = null, DiskPurchasePlan purchasePlan = null, SupportedCapabilities supportedCapabilities = null, string familyId = null, string sourceUniqueId = null, DiskEncryption encryption = null, bool? supportsHibernation = null, NetworkAccessPolicy? networkAccessPolicy = null, DiskPublicNetworkAccess? publicNetworkAccess = null, ResourceIdentifier diskAccessId = null, float? completionPercent = null, string replicationState = null, AzureLocation? sourceResourceLocation = null, DiskSecurityProfile securityProfile = null, int? logicalSectorSize = null) { return new DiskRestorePointData( id, @@ -2798,6 +2832,7 @@ public static DiskRestorePointData DiskRestorePointData(ResourceIdentifier id = replicationState, sourceResourceLocation, securityProfile, + logicalSectorSize, serializedAdditionalRawData: null); } @@ -4189,6 +4224,111 @@ public static OSVersionPropertiesBase OSVersionPropertiesBase(string version = n return new OSVersionPropertiesBase(version, label, isDefault, isActive, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The virtual machine scale set sku. + /// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. + /// The identity of the virtual machine scale set, if configured. + /// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set. + /// The extended location of the Virtual Machine Scale Set. + /// Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header to ensure optimistic updates. + /// The upgrade policy. + /// The ScheduledEventsPolicy. + /// Policy for automatic repairs. + /// The virtual machine profile. + /// The provisioning state, which only appears in the response. + /// Specifies whether the Virtual Machine Scale Set should be overprovisioned. + /// When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. + /// Specifies the ID which uniquely identifies a Virtual Machine Scale Set. + /// When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. + /// Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property can only be set if the zones property of the scale set contains more than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. + /// Fault Domain count for each placement group. + /// Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. Minimum api-version: 2018-04-01. + /// Specifies information about the dedicated host group that the virtual machine scale set resides in. Minimum api-version: 2020-06-01. + /// Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. + /// Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. + /// Specifies the orchestration mode for the virtual machine scale set. + /// Specifies the Spot Restore properties for the virtual machine scale set. + /// Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. + /// Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. + /// Optional property which must either be set to True or omitted. + /// Policy for Resiliency. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, IEnumerable zones, ExtendedLocation extendedLocation, string etag, VirtualMachineScaleSetUpgradePolicy upgradePolicy, ScheduledEventsPolicy scheduledEventsPolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, ResourceIdentifier proximityPlacementGroupId, ResourceIdentifier hostGroupId, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, OrchestrationMode? orchestrationMode, SpotRestorePolicy spotRestorePolicy, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained, ResiliencyPolicy resiliencyPolicy) + { + return VirtualMachineScaleSetData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, plan: plan, identity: identity, zones: zones, extendedLocation: extendedLocation, etag: etag, upgradePolicy: upgradePolicy, scheduledEventsPolicy: scheduledEventsPolicy, automaticRepairsPolicy: automaticRepairsPolicy, virtualMachineProfile: virtualMachineProfile, provisioningState: provisioningState, overprovision: overprovision, doNotRunExtensionsOnOverprovisionedVms: doNotRunExtensionsOnOverprovisionedVms, uniqueId: uniqueId, singlePlacementGroup: singlePlacementGroup, zoneBalance: zoneBalance, platformFaultDomainCount: platformFaultDomainCount, proximityPlacementGroupId: proximityPlacementGroupId, hostGroupId: hostGroupId, additionalCapabilities: additionalCapabilities, scaleInPolicy: scaleInPolicy, orchestrationMode: orchestrationMode, spotRestorePolicy: spotRestorePolicy, priorityMixPolicy: priorityMixPolicy, timeCreated: timeCreated, isMaximumCapacityConstrained: isMaximumCapacityConstrained, resiliencyPolicy: resiliencyPolicy, zonalPlatformFaultDomainAlignMode: default, skuProfile: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. + /// Update Domain count. + /// Fault Domain count. + /// A list of references to all virtual machines in the availability set. + /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. + /// The resource status information. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AvailabilitySetData AvailabilitySetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IEnumerable virtualMachines, ResourceIdentifier proximityPlacementGroupId, IEnumerable statuses) + { + return AvailabilitySetData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, platformUpdateDomainCount: platformUpdateDomainCount, platformFaultDomainCount: platformFaultDomainCount, virtualMachines: virtualMachines, proximityPlacementGroupId: proximityPlacementGroupId, statuses: statuses, scheduledEventsPolicy: default); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Sku of the availability set. + /// Update Domain count. + /// Fault Domain count. + /// A list of references to all virtual machines in the availability set. + /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. + /// The resource status information. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AvailabilitySetPatch AvailabilitySetPatch(IDictionary tags, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IEnumerable virtualMachines, ResourceIdentifier proximityPlacementGroupId, IEnumerable statuses) + { + return AvailabilitySetPatch(tags: tags, sku: sku, platformUpdateDomainCount: platformUpdateDomainCount, platformFaultDomainCount: platformFaultDomainCount, virtualMachines: virtualMachines, proximityPlacementGroupId: proximityPlacementGroupId, statuses: statuses, scheduledEventsPolicy: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The timestamp of restorePoint creation. + /// arm id of source disk or source disk restore point. + /// The Operating System type. + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + /// Purchase plan information for the the image from which the OS disk was created. + /// List of supported capabilities for the image from which the OS disk was created. + /// id of the backing snapshot's MIS family. + /// unique incarnation id of the source disk. + /// Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + /// Indicates the OS on a disk supports hibernation. + /// Policy for accessing the disk via network. + /// Policy for controlling export on the disk. + /// ARM id of the DiskAccess resource for using private endpoints on disks. + /// Percentage complete for the background copy of disk restore point when source resource is from a different region. + /// Replication state of disk restore point when source resource is from a different region. + /// Location of source disk or source disk restore point when source resource is from a different region. + /// Contains the security related information for the resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static DiskRestorePointData DiskRestorePointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? timeCreated, ResourceIdentifier sourceResourceId, SupportedOperatingSystemType? osType, HyperVGeneration? hyperVGeneration, DiskPurchasePlan purchasePlan, SupportedCapabilities supportedCapabilities, string familyId, string sourceUniqueId, DiskEncryption encryption, bool? supportsHibernation, NetworkAccessPolicy? networkAccessPolicy, DiskPublicNetworkAccess? publicNetworkAccess, ResourceIdentifier diskAccessId, float? completionPercent, string replicationState, AzureLocation? sourceResourceLocation, DiskSecurityProfile securityProfile) + { + return DiskRestorePointData(id: id, name: name, resourceType: resourceType, systemData: systemData, timeCreated: timeCreated, sourceResourceId: sourceResourceId, osType: osType, hyperVGeneration: hyperVGeneration, purchasePlan: purchasePlan, supportedCapabilities: supportedCapabilities, familyId: familyId, sourceUniqueId: sourceUniqueId, encryption: encryption, supportsHibernation: supportsHibernation, networkAccessPolicy: networkAccessPolicy, publicNetworkAccess: publicNetworkAccess, diskAccessId: diskAccessId, completionPercent: completionPercent, replicationState: replicationState, sourceResourceLocation: sourceResourceLocation, securityProfile: securityProfile, logicalSectorSize: default); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -4226,7 +4366,7 @@ public static OSVersionPropertiesBase OSVersionPropertiesBase(string version = n [EditorBrowsable(EditorBrowsableState.Never)] public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, IEnumerable zones, ExtendedLocation extendedLocation, string etag, VirtualMachineScaleSetUpgradePolicy upgradePolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, ResourceIdentifier proximityPlacementGroupId, ResourceIdentifier hostGroupId, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, OrchestrationMode? orchestrationMode, SpotRestorePolicy spotRestorePolicy, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained, ResiliencyPolicy resiliencyPolicy) { - return VirtualMachineScaleSetData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, plan: plan, identity: identity, zones: zones, extendedLocation: extendedLocation, etag: etag, upgradePolicy: upgradePolicy, scheduledEventsPolicy: default, automaticRepairsPolicy: automaticRepairsPolicy, virtualMachineProfile: virtualMachineProfile, provisioningState: provisioningState, overprovision: overprovision, doNotRunExtensionsOnOverprovisionedVms: doNotRunExtensionsOnOverprovisionedVms, uniqueId: uniqueId, singlePlacementGroup: singlePlacementGroup, zoneBalance: zoneBalance, platformFaultDomainCount: platformFaultDomainCount, proximityPlacementGroupId: proximityPlacementGroupId, hostGroupId: hostGroupId, additionalCapabilities: additionalCapabilities, scaleInPolicy: scaleInPolicy, orchestrationMode: orchestrationMode, spotRestorePolicy: spotRestorePolicy, priorityMixPolicy: priorityMixPolicy, timeCreated: timeCreated, isMaximumCapacityConstrained: isMaximumCapacityConstrained, resiliencyPolicy: resiliencyPolicy); + return VirtualMachineScaleSetData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, plan: plan, identity: identity, zones: zones, extendedLocation: extendedLocation, etag: etag, upgradePolicy: upgradePolicy, scheduledEventsPolicy: default, automaticRepairsPolicy: automaticRepairsPolicy, virtualMachineProfile: virtualMachineProfile, provisioningState: provisioningState, overprovision: overprovision, doNotRunExtensionsOnOverprovisionedVms: doNotRunExtensionsOnOverprovisionedVms, uniqueId: uniqueId, singlePlacementGroup: singlePlacementGroup, zoneBalance: zoneBalance, platformFaultDomainCount: platformFaultDomainCount, proximityPlacementGroupId: proximityPlacementGroupId, hostGroupId: hostGroupId, additionalCapabilities: additionalCapabilities, scaleInPolicy: scaleInPolicy, orchestrationMode: orchestrationMode, spotRestorePolicy: spotRestorePolicy, priorityMixPolicy: priorityMixPolicy, timeCreated: timeCreated, isMaximumCapacityConstrained: isMaximumCapacityConstrained, resiliencyPolicy: resiliencyPolicy, zonalPlatformFaultDomainAlignMode: default, skuProfile: default); } /// Initializes a new instance of . diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetCollection.cs index 2462ee686f1a8..89c78df172781 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string ava /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string availabilitySetName, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string availabilitySetName /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string availabilitySetName, CancellationTok /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.Serialization.cs index 939e4f5bd2a23..662a6b81f2165 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.Serialization.cs @@ -104,6 +104,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (Optional.IsDefined(ScheduledEventsPolicy)) + { + writer.WritePropertyName("scheduledEventsPolicy"u8); + writer.WriteObjectValue(ScheduledEventsPolicy, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -155,6 +160,7 @@ internal static AvailabilitySetData DeserializeAvailabilitySetData(JsonElement e IList virtualMachines = default; WritableSubResource proximityPlacementGroup = default; IReadOnlyList statuses = default; + ScheduledEventsPolicy scheduledEventsPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -275,6 +281,15 @@ internal static AvailabilitySetData DeserializeAvailabilitySetData(JsonElement e statuses = array; continue; } + if (property0.NameEquals("scheduledEventsPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledEventsPolicy = ScheduledEventsPolicy.DeserializeScheduledEventsPolicy(property0.Value, options); + continue; + } } continue; } @@ -297,6 +312,7 @@ internal static AvailabilitySetData DeserializeAvailabilitySetData(JsonElement e virtualMachines ?? new ChangeTrackingList(), proximityPlacementGroup, statuses ?? new ChangeTrackingList(), + scheduledEventsPolicy, serializedAdditionalRawData); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.cs index 04171c68292f1..48925e2a00c22 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.cs @@ -73,8 +73,9 @@ public AvailabilitySetData(AzureLocation location) : base(location) /// A list of references to all virtual machines in the availability set. /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. /// The resource status information. + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. /// Keeps track of any properties unknown to the library. - internal AvailabilitySetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IList virtualMachines, WritableSubResource proximityPlacementGroup, IReadOnlyList statuses, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal AvailabilitySetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IList virtualMachines, WritableSubResource proximityPlacementGroup, IReadOnlyList statuses, ScheduledEventsPolicy scheduledEventsPolicy, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; PlatformUpdateDomainCount = platformUpdateDomainCount; @@ -82,6 +83,7 @@ internal AvailabilitySetData(ResourceIdentifier id, string name, ResourceType re VirtualMachines = virtualMachines; ProximityPlacementGroup = proximityPlacementGroup; Statuses = statuses; + ScheduledEventsPolicy = scheduledEventsPolicy; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -114,5 +116,7 @@ public ResourceIdentifier ProximityPlacementGroupId /// The resource status information. public IReadOnlyList Statuses { get; } + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. + public ScheduledEventsPolicy ScheduledEventsPolicy { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetResource.cs index 4791546e5d45a..bbf00466bad06 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -228,7 +228,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -272,7 +272,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> UpdateAsync(Availab /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual Response Update(AvailabilitySetPatch pat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -385,7 +385,7 @@ public virtual AsyncPageable GetAvailableSizesAsync(Cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -414,7 +414,7 @@ public virtual Pageable GetAvailableSizes(CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -476,7 +476,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -538,7 +538,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -595,7 +595,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -652,7 +652,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -712,7 +712,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationCollection.cs index fc5afd6032c15..0cb915667f7d4 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual Response Get(string capacityReservat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string capacityReservation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string capacityReservationName, CapacityRes /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupCollection.cs index 2d070f89721fd..36afef369c685 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -260,7 +260,7 @@ public virtual Response Get(string capacityRes /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -291,7 +291,7 @@ public virtual AsyncPageable GetAllAsync(Capac /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -322,7 +322,7 @@ public virtual Pageable GetAll(CapacityReserva /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -366,7 +366,7 @@ public virtual async Task> ExistsAsync(string capacityReservation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -410,7 +410,7 @@ public virtual Response Exists(string capacityReservationGroupName, Capaci /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -456,7 +456,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupData.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupData.cs index 0e1a0bef2bd95..15e57212848d9 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupData.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupData.cs @@ -72,7 +72,7 @@ public CapacityReservationGroupData(AzureLocation location) : base(location) /// A list of all capacity reservation resource ids that belong to capacity reservation group. /// A list of references to all virtual machines associated to the capacity reservation group. /// The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. - /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. /// Keeps track of any properties unknown to the library. internal CapacityReservationGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IList zones, IReadOnlyList capacityReservations, IReadOnlyList virtualMachinesAssociated, CapacityReservationGroupInstanceView instanceView, ResourceSharingProfile sharingProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { @@ -97,9 +97,9 @@ internal CapacityReservationGroupData() public IReadOnlyList VirtualMachinesAssociated { get; } /// The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. public CapacityReservationGroupInstanceView InstanceView { get; } - /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. internal ResourceSharingProfile SharingProfile { get; set; } - /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. public IList SharingSubscriptionIds { get diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupResource.cs index 963ebe6e465d0..50235e7b4642a 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupResource.cs @@ -110,7 +110,7 @@ public virtual CapacityReservationCollection GetCapacityReservations() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetCapacityRese /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -174,7 +174,7 @@ public virtual Response GetCapacityReservation(stri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(CapacityReservatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -344,7 +344,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task> UpdateAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -428,7 +428,7 @@ public virtual Response Update(CapacityReserva /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -490,7 +490,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -552,7 +552,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -609,7 +609,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -666,7 +666,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -726,7 +726,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationResource.cs index 06cf25ecb72cf..8917e9f15684b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(Capaci /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CapacityReservationInst /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil waitUn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsync(str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, string v /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsync(ID /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagAsync( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionCollection.cs index d681485f8a018..510c4c1ce19f0 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string pri /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionResource.cs index 565fa22c54636..53cf26e920d6b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostCollection.cs index d67e6e143e354..4d267f3ea62ad 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string hostN /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual Response Get(string hostName, InstanceView /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToke /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual Pageable GetAll(CancellationToken cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string hostName, InstanceV /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string hostName, InstanceViewType? expand = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupCollection.cs index 59d4c67710a26..a666f8eb9b820 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -260,7 +260,7 @@ public virtual Response Get(string hostGroupName, In /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -320,7 +320,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string hostGroupName, Inst /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -408,7 +408,7 @@ public virtual Response Exists(string hostGroupName, InstanceViewType? exp /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupResource.cs index f5f7140698ebf..06fa03a182cd4 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupResource.cs @@ -110,7 +110,7 @@ public virtual DedicatedHostCollection GetDedicatedHosts() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetDedicatedHostAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -174,7 +174,7 @@ public virtual Response GetDedicatedHost(string hostName, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> GetAsync(Instanc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(InstanceViewType? expand /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -344,7 +344,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task> UpdateAsync(Dedi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -428,7 +428,7 @@ public virtual Response Update(DedicatedHostGroupPat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -490,7 +490,7 @@ public virtual async Task> AddTagAsync(stri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -552,7 +552,7 @@ public virtual Response AddTag(string key, string va /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -609,7 +609,7 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -666,7 +666,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -726,7 +726,7 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostResource.cs index a70fc2b27ad49..00af9fdf262c8 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync(InstanceView /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -186,7 +186,7 @@ public virtual Response Get(InstanceViewType? expand = nu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -228,7 +228,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, D /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -404,7 +404,7 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -446,7 +446,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -488,7 +488,7 @@ public virtual async Task RedeployAsync(WaitUntil waitUntil, Cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -530,7 +530,7 @@ public virtual ArmOperation Redeploy(WaitUntil waitUntil, CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -559,7 +559,7 @@ public virtual AsyncPageable GetAvailableSizesAsync(CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -588,7 +588,7 @@ public virtual Pageable GetAvailableSizes(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -650,7 +650,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -712,7 +712,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -769,7 +769,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -826,7 +826,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -886,7 +886,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessCollection.cs index bc7fa1d5c8c23..40f8926058057 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync( /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string diskAcce /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string diskAccessName, Cancellat /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken c /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellatio /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string diskAccessName, Can /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string diskAccessName, CancellationToken ca /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsync /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessResource.cs index 41d946c1a5e3d..cb33df01bd17f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessResource.cs @@ -111,7 +111,7 @@ public virtual ComputePrivateEndpointConnectionCollection GetComputePrivateEndpo /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -173,7 +173,7 @@ public virtual Response GetComputePriv /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task> GetAsync(CancellationTok /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(CancellationToken cancellationTo /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -295,7 +295,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -337,7 +337,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -383,7 +383,7 @@ public virtual async Task> UpdateAsync(WaitUnti /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -429,7 +429,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Disk /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual AsyncPageable GetPrivateLinkResou /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -487,7 +487,7 @@ public virtual Pageable GetPrivateLinkResources( /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -549,7 +549,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -611,7 +611,7 @@ public virtual Response AddTag(string key, string value, Can /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -668,7 +668,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -725,7 +725,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -785,7 +785,7 @@ public virtual async Task> RemoveTagAsync(string ke /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetCollection.cs index 26605fc709587..e138cf39db214 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string d /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string diskEncryptionSetN /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string diskEncryptionSetNa /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string diskEncryptionSetName, CancellationT /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetResource.cs index 30548b9067d33..3e1a58da13bd3 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -390,7 +390,7 @@ public virtual AsyncPageable GetAssociatedResourcesAsync(CancellationTok /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -420,7 +420,7 @@ public virtual Pageable GetAssociatedResources(CancellationToken cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -482,7 +482,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -544,7 +544,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -601,7 +601,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -658,7 +658,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -718,7 +718,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageCollection.cs index 2af931371dc00..2dbfc75fb098f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync(W /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnti /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string imageName /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual Response Get(string imageName, string expand = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual Pageable GetAll(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string imageName, string e /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string imageName, string expand = null, Can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task> GetIfExistsAsync( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageResource.cs index 0a455a9f0eb51..edfb2abea396c 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(string expand = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(string expand = null, Cancellatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, DiskI /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsync(string key, s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, string value, Canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsync(IDictionary< /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary t /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagAsync(string key /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointCollection.cs index 14d269aa8ea20..c0379fb51893d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string di /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string diskRestorePointNam /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string diskRestorePointNam /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string diskRestorePointName, CancellationTo /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.Serialization.cs index 66c27f346cdcd..433fe6767b1a6 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.Serialization.cs @@ -135,6 +135,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("securityProfile"u8); writer.WriteObjectValue(SecurityProfile, options); } + if (options.Format != "W" && Optional.IsDefined(LogicalSectorSize)) + { + writer.WritePropertyName("logicalSectorSize"u8); + writer.WriteNumberValue(LogicalSectorSize.Value); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -195,6 +200,7 @@ internal static DiskRestorePointData DeserializeDiskRestorePointData(JsonElement string replicationState = default; AzureLocation? sourceResourceLocation = default; DiskSecurityProfile securityProfile = default; + int? logicalSectorSize = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -373,6 +379,15 @@ internal static DiskRestorePointData DeserializeDiskRestorePointData(JsonElement securityProfile = DiskSecurityProfile.DeserializeDiskSecurityProfile(property0.Value, options); continue; } + if (property0.NameEquals("logicalSectorSize"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logicalSectorSize = property0.Value.GetInt32(); + continue; + } } continue; } @@ -404,6 +419,7 @@ internal static DiskRestorePointData DeserializeDiskRestorePointData(JsonElement replicationState, sourceResourceLocation, securityProfile, + logicalSectorSize, serializedAdditionalRawData); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.cs index b260b0ca485d4..a5320d4b6e843 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.cs @@ -78,8 +78,9 @@ internal DiskRestorePointData() /// Replication state of disk restore point when source resource is from a different region. /// Location of source disk or source disk restore point when source resource is from a different region. /// Contains the security related information for the resource. + /// Logical sector size in bytes for disk restore points of UltraSSD_LRS and PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the default. /// Keeps track of any properties unknown to the library. - internal DiskRestorePointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? timeCreated, ResourceIdentifier sourceResourceId, SupportedOperatingSystemType? osType, HyperVGeneration? hyperVGeneration, DiskPurchasePlan purchasePlan, SupportedCapabilities supportedCapabilities, string familyId, string sourceUniqueId, DiskEncryption encryption, bool? supportsHibernation, NetworkAccessPolicy? networkAccessPolicy, DiskPublicNetworkAccess? publicNetworkAccess, ResourceIdentifier diskAccessId, float? completionPercent, string replicationState, AzureLocation? sourceResourceLocation, DiskSecurityProfile securityProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal DiskRestorePointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? timeCreated, ResourceIdentifier sourceResourceId, SupportedOperatingSystemType? osType, HyperVGeneration? hyperVGeneration, DiskPurchasePlan purchasePlan, SupportedCapabilities supportedCapabilities, string familyId, string sourceUniqueId, DiskEncryption encryption, bool? supportsHibernation, NetworkAccessPolicy? networkAccessPolicy, DiskPublicNetworkAccess? publicNetworkAccess, ResourceIdentifier diskAccessId, float? completionPercent, string replicationState, AzureLocation? sourceResourceLocation, DiskSecurityProfile securityProfile, int? logicalSectorSize, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { TimeCreated = timeCreated; SourceResourceId = sourceResourceId; @@ -98,6 +99,7 @@ internal DiskRestorePointData(ResourceIdentifier id, string name, ResourceType r ReplicationState = replicationState; SourceResourceLocation = sourceResourceLocation; SecurityProfile = securityProfile; + LogicalSectorSize = logicalSectorSize; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -135,5 +137,7 @@ internal DiskRestorePointData(ResourceIdentifier id, string name, ResourceType r public AzureLocation? SourceResourceLocation { get; } /// Contains the security related information for the resource. public DiskSecurityProfile SecurityProfile { get; } + /// Logical sector size in bytes for disk restore points of UltraSSD_LRS and PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the default. + public int? LogicalSectorSize { get; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointResource.cs index 59c71a69c3663..25d712036babc 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> GrantAccessAsync(WaitUntil wa /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation GrantAccess(WaitUntil waitUntil, GrantAcc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task RevokeAccessAsync(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs index b4136177c8f08..a33aaacea59e8 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs @@ -861,7 +861,7 @@ public static VirtualMachineScaleSetCollection GetVirtualMachineScaleSets(this R /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -900,7 +900,7 @@ public static async Task> GetVirtualMac /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -956,7 +956,7 @@ public static VirtualMachineCollection GetVirtualMachines(this ResourceGroupReso /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -995,7 +995,7 @@ public static async Task> GetVirtualMachineAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1051,7 +1051,7 @@ public static AvailabilitySetCollection GetAvailabilitySets(this ResourceGroupRe /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1089,7 +1089,7 @@ public static async Task> GetAvailabilitySetAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1144,7 +1144,7 @@ public static ProximityPlacementGroupCollection GetProximityPlacementGroups(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1183,7 +1183,7 @@ public static async Task> GetProximity /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1239,7 +1239,7 @@ public static DedicatedHostGroupCollection GetDedicatedHostGroups(this ResourceG /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1278,7 +1278,7 @@ public static async Task> GetDedicatedHostG /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1334,7 +1334,7 @@ public static SshPublicKeyCollection GetSshPublicKeys(this ResourceGroupResource /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1372,7 +1372,7 @@ public static async Task> GetSshPublicKeyAsync(th /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1427,7 +1427,7 @@ public static DiskImageCollection GetDiskImages(this ResourceGroupResource resou /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1466,7 +1466,7 @@ public static async Task> GetDiskImageAsync(this Res /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1522,7 +1522,7 @@ public static RestorePointGroupCollection GetRestorePointGroups(this ResourceGro /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1561,7 +1561,7 @@ public static async Task> GetRestorePointGro /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1617,7 +1617,7 @@ public static CapacityReservationGroupCollection GetCapacityReservationGroups(th /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1656,7 +1656,7 @@ public static async Task> GetCapacity /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1712,7 +1712,7 @@ public static ManagedDiskCollection GetManagedDisks(this ResourceGroupResource r /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -1750,7 +1750,7 @@ public static async Task> GetManagedDiskAsync(this /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -1805,7 +1805,7 @@ public static DiskAccessCollection GetDiskAccesses(this ResourceGroupResource re /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -1843,7 +1843,7 @@ public static async Task> GetDiskAccessAsync(this R /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -1898,7 +1898,7 @@ public static DiskEncryptionSetCollection GetDiskEncryptionSets(this ResourceGro /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -1936,7 +1936,7 @@ public static async Task> GetDiskEncryptionS /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -1991,7 +1991,7 @@ public static SnapshotCollection GetSnapshots(this ResourceGroupResource resourc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2029,7 +2029,7 @@ public static async Task> GetSnapshotAsync(this Resou /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2277,7 +2277,7 @@ public static VirtualMachineExtensionImageCollection GetVirtualMachineExtensionI /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2318,7 +2318,7 @@ public static async Task> GetVirt /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2742,7 +2742,7 @@ public static Response GetCloudServiceOSFamily(thi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2775,7 +2775,7 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionResour /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2808,7 +2808,7 @@ public static Pageable GetUsages(this SubscriptionResource subscri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2841,7 +2841,7 @@ public static AsyncPageable GetVirtualMachineSizesAsync(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2874,7 +2874,7 @@ public static Pageable GetVirtualMachineSizes(this Subscript /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2911,7 +2911,7 @@ public static AsyncPageable GetVirtualMachineSca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2948,7 +2948,7 @@ public static Pageable GetVirtualMachineScaleSet /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2984,7 +2984,7 @@ public static AsyncPageable GetVirtualMachineSca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -3020,7 +3020,7 @@ public static Pageable GetVirtualMachineScaleSet /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -3057,7 +3057,7 @@ public static AsyncPageable GetVirtualMachinesByLocation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -3094,7 +3094,7 @@ public static Pageable GetVirtualMachinesByLocation(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -3133,7 +3133,7 @@ public static AsyncPageable GetVirtualMachinesAsync(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -3172,7 +3172,7 @@ public static Pageable GetVirtualMachines(this Subscript /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3209,7 +3209,7 @@ public static async Task> GetVirtualMachineImageAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3246,7 +3246,7 @@ public static Response GetVirtualMachineImage(this Subscrip /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3279,7 +3279,7 @@ public static AsyncPageable GetVirtualMachineImagesAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3312,7 +3312,7 @@ public static Pageable GetVirtualMachineImages(this Sub /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3347,7 +3347,7 @@ public static AsyncPageable GetVirtualMachineImageOffer /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3382,7 +3382,7 @@ public static Pageable GetVirtualMachineImageOffers(thi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3415,7 +3415,7 @@ public static AsyncPageable GetVirtualMachineImagePubli /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3448,7 +3448,7 @@ public static Pageable GetVirtualMachineImagePublishers /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3484,7 +3484,7 @@ public static AsyncPageable GetVirtualMachineImageSkusA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3520,7 +3520,7 @@ public static Pageable GetVirtualMachineImageSkus(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3555,7 +3555,7 @@ public static AsyncPageable GetVirtualMachineImagesByEd /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3590,7 +3590,7 @@ public static Pageable GetVirtualMachineImagesByEdgeZon /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3622,7 +3622,7 @@ public static async Task> GetVirtualMachineImagesE /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3654,7 +3654,7 @@ public static Response GetVirtualMachineImagesEdgeZone(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3687,7 +3687,7 @@ public static AsyncPageable GetVirtualMachineImagesEdge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3720,7 +3720,7 @@ public static Pageable GetVirtualMachineImagesEdgeZones /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3756,7 +3756,7 @@ public static AsyncPageable GetOffersVirtualMachineImag /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3792,7 +3792,7 @@ public static Pageable GetOffersVirtualMachineImagesEdg /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3827,7 +3827,7 @@ public static AsyncPageable GetPublishersVirtualMachine /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3862,7 +3862,7 @@ public static Pageable GetPublishersVirtualMachineImage /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3899,7 +3899,7 @@ public static AsyncPageable GetVirtualMachineImageEdgeZ /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3936,7 +3936,7 @@ public static Pageable GetVirtualMachineImageEdgeZoneSk /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -3973,7 +3973,7 @@ public static AsyncPageable GetAvailabilitySetsAsync(th /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4010,7 +4010,7 @@ public static Pageable GetAvailabilitySets(this Subscri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4046,7 +4046,7 @@ public static AsyncPageable GetProximityPlaceme /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4082,7 +4082,7 @@ public static Pageable GetProximityPlacementGro /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4118,7 +4118,7 @@ public static AsyncPageable GetDedicatedHostGroupsAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4154,7 +4154,7 @@ public static Pageable GetDedicatedHostGroups(this S /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4190,7 +4190,7 @@ public static AsyncPageable GetSshPublicKeysAsync(this Sub /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4226,7 +4226,7 @@ public static Pageable GetSshPublicKeys(this SubscriptionR /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4262,7 +4262,7 @@ public static AsyncPageable GetDiskImagesAsync(this Subscript /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4298,7 +4298,7 @@ public static Pageable GetDiskImages(this SubscriptionResourc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4334,7 +4334,7 @@ public static AsyncPageable GetRestorePointGroupsAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4370,7 +4370,7 @@ public static Pageable GetRestorePointGroups(this Sub /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4408,7 +4408,7 @@ public static AsyncPageable GetCapacityReserva /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4446,7 +4446,7 @@ public static Pageable GetCapacityReservationG /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -4480,7 +4480,7 @@ public static async Task> ExportLogAnalyticsRequestRa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -4514,7 +4514,7 @@ public static ArmOperation ExportLogAnalyticsRequestRateByInterval /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -4548,7 +4548,7 @@ public static async Task> ExportLogAnalyticsThrottled /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -4582,7 +4582,7 @@ public static ArmOperation ExportLogAnalyticsThrottledRequests(thi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4619,7 +4619,7 @@ public static AsyncPageable GetVirtualMachineRunCommands /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4656,7 +4656,7 @@ public static Pageable GetVirtualMachineRunCommands(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4694,7 +4694,7 @@ public static async Task> GetVirtualMachineRunComma /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4732,7 +4732,7 @@ public static Response GetVirtualMachineRunCommand(this Subs /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4768,7 +4768,7 @@ public static AsyncPageable GetManagedDisksAsync(this Subsc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4804,7 +4804,7 @@ public static Pageable GetManagedDisks(this SubscriptionRes /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4840,7 +4840,7 @@ public static AsyncPageable GetDiskAccessesAsync(this Subscr /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4876,7 +4876,7 @@ public static Pageable GetDiskAccesses(this SubscriptionReso /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4912,7 +4912,7 @@ public static AsyncPageable GetDiskEncryptionSetsAsyn /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4948,7 +4948,7 @@ public static Pageable GetDiskEncryptionSets(this Sub /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4984,7 +4984,7 @@ public static AsyncPageable GetSnapshotsAsync(this Subscriptio /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeResourceGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeResourceGroupResource.cs index 49c3e7eb7b221..1fc8bce466849 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeResourceGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeResourceGroupResource.cs @@ -54,7 +54,7 @@ public virtual VirtualMachineScaleSetCollection GetVirtualMachineScaleSets() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -86,7 +86,7 @@ public virtual async Task> GetVirtualMa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -125,7 +125,7 @@ public virtual VirtualMachineCollection GetVirtualMachines() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -157,7 +157,7 @@ public virtual async Task> GetVirtualMachineAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -196,7 +196,7 @@ public virtual AvailabilitySetCollection GetAvailabilitySets() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task> GetAvailabilitySetA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ProximityPlacementGroupCollection GetProximityPlacementGroups() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -297,7 +297,7 @@ public virtual async Task> GetProximit /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -336,7 +336,7 @@ public virtual DedicatedHostGroupCollection GetDedicatedHostGroups() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -368,7 +368,7 @@ public virtual async Task> GetDedicatedHost /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -407,7 +407,7 @@ public virtual SshPublicKeyCollection GetSshPublicKeys() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -438,7 +438,7 @@ public virtual async Task> GetSshPublicKeyAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -476,7 +476,7 @@ public virtual DiskImageCollection GetDiskImages() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -508,7 +508,7 @@ public virtual async Task> GetDiskImageAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -547,7 +547,7 @@ public virtual RestorePointGroupCollection GetRestorePointGroups() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -579,7 +579,7 @@ public virtual async Task> GetRestorePointGr /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -618,7 +618,7 @@ public virtual CapacityReservationGroupCollection GetCapacityReservationGroups() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -650,7 +650,7 @@ public virtual async Task> GetCapacit /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -689,7 +689,7 @@ public virtual ManagedDiskCollection GetManagedDisks() /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -720,7 +720,7 @@ public virtual async Task> GetManagedDiskAsync(str /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -758,7 +758,7 @@ public virtual DiskAccessCollection GetDiskAccesses() /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -789,7 +789,7 @@ public virtual async Task> GetDiskAccessAsync(strin /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -827,7 +827,7 @@ public virtual DiskEncryptionSetCollection GetDiskEncryptionSets() /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -858,7 +858,7 @@ public virtual async Task> GetDiskEncryption /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -896,7 +896,7 @@ public virtual SnapshotCollection GetSnapshots() /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -927,7 +927,7 @@ public virtual async Task> GetSnapshotAsync(string sn /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeSubscriptionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeSubscriptionResource.cs index 41a682047e1c2..20cc6ff00ca73 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeSubscriptionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeSubscriptionResource.cs @@ -150,7 +150,7 @@ public virtual VirtualMachineExtensionImageCollection GetVirtualMachineExtension /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual async Task> GetVir /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual Response GetCloudServiceOSFamily(Az /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -532,7 +532,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation location /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -559,7 +559,7 @@ public virtual Pageable GetUsages(AzureLocation location, Cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -585,7 +585,7 @@ public virtual AsyncPageable GetVirtualMachineSizesAsync(Azu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -611,7 +611,7 @@ public virtual Pageable GetVirtualMachineSizes(AzureLocation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -642,7 +642,7 @@ public virtual AsyncPageable GetVirtualMachineSc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -673,7 +673,7 @@ public virtual Pageable GetVirtualMachineScaleSe /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -703,7 +703,7 @@ public virtual AsyncPageable GetVirtualMachineSc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -733,7 +733,7 @@ public virtual Pageable GetVirtualMachineScaleSe /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -764,7 +764,7 @@ public virtual AsyncPageable GetVirtualMachinesByLocatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -795,7 +795,7 @@ public virtual Pageable GetVirtualMachinesByLocation(Azu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -828,7 +828,7 @@ public virtual AsyncPageable GetVirtualMachinesAsync(str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -861,7 +861,7 @@ public virtual Pageable GetVirtualMachines(string status /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -907,7 +907,7 @@ public virtual async Task> GetVirtualMachineImageA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -953,7 +953,7 @@ public virtual Response GetVirtualMachineImage(AzureLocatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -982,7 +982,7 @@ public virtual AsyncPageable GetVirtualMachineImagesAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1011,7 +1011,7 @@ public virtual Pageable GetVirtualMachineImages(Subscri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1042,7 +1042,7 @@ public virtual AsyncPageable GetVirtualMachineImageOffe /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1073,7 +1073,7 @@ public virtual Pageable GetVirtualMachineImageOffers(Az /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1099,7 +1099,7 @@ public virtual AsyncPageable GetVirtualMachineImagePubl /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1125,7 +1125,7 @@ public virtual Pageable GetVirtualMachineImagePublisher /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1158,7 +1158,7 @@ public virtual AsyncPageable GetVirtualMachineImageSkus /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1191,7 +1191,7 @@ public virtual Pageable GetVirtualMachineImageSkus(Azur /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1222,7 +1222,7 @@ public virtual AsyncPageable GetVirtualMachineImagesByE /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1253,7 +1253,7 @@ public virtual Pageable GetVirtualMachineImagesByEdgeZo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1291,7 +1291,7 @@ public virtual async Task> GetVirtualMachineImages /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1329,7 +1329,7 @@ public virtual Response GetVirtualMachineImagesEdgeZone(Sub /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1358,7 +1358,7 @@ public virtual AsyncPageable GetVirtualMachineImagesEdg /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1387,7 +1387,7 @@ public virtual Pageable GetVirtualMachineImagesEdgeZone /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1420,7 +1420,7 @@ public virtual AsyncPageable GetOffersVirtualMachineIma /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1453,7 +1453,7 @@ public virtual Pageable GetOffersVirtualMachineImagesEd /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1484,7 +1484,7 @@ public virtual AsyncPageable GetPublishersVirtualMachin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1515,7 +1515,7 @@ public virtual Pageable GetPublishersVirtualMachineImag /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1550,7 +1550,7 @@ public virtual AsyncPageable GetVirtualMachineImageEdge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1585,7 +1585,7 @@ public virtual Pageable GetVirtualMachineImageEdgeZoneS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1616,7 +1616,7 @@ public virtual AsyncPageable GetAvailabilitySetsAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1647,7 +1647,7 @@ public virtual Pageable GetAvailabilitySets(string expa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1677,7 +1677,7 @@ public virtual AsyncPageable GetProximityPlacem /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1707,7 +1707,7 @@ public virtual Pageable GetProximityPlacementGr /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1737,7 +1737,7 @@ public virtual AsyncPageable GetDedicatedHostGroupsA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1767,7 +1767,7 @@ public virtual Pageable GetDedicatedHostGroups(Cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1797,7 +1797,7 @@ public virtual AsyncPageable GetSshPublicKeysAsync(Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1827,7 +1827,7 @@ public virtual Pageable GetSshPublicKeys(CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1857,7 +1857,7 @@ public virtual AsyncPageable GetDiskImagesAsync(CancellationT /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1887,7 +1887,7 @@ public virtual Pageable GetDiskImages(CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1917,7 +1917,7 @@ public virtual AsyncPageable GetRestorePointGroupsAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1947,7 +1947,7 @@ public virtual Pageable GetRestorePointGroups(Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1979,7 +1979,7 @@ public virtual AsyncPageable GetCapacityReserv /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2011,7 +2011,7 @@ public virtual Pageable GetCapacityReservation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2054,7 +2054,7 @@ public virtual async Task> ExportLogAnalyticsRequestR /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2097,7 +2097,7 @@ public virtual ArmOperation ExportLogAnalyticsRequestRateByInterva /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2140,7 +2140,7 @@ public virtual async Task> ExportLogAnalyticsThrottle /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2183,7 +2183,7 @@ public virtual ArmOperation ExportLogAnalyticsThrottledRequests(Wa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2214,7 +2214,7 @@ public virtual AsyncPageable GetVirtualMachineRunCommand /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2245,7 +2245,7 @@ public virtual Pageable GetVirtualMachineRunCommands(Azu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2289,7 +2289,7 @@ public virtual async Task> GetVirtualMachineRunComm /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2333,7 +2333,7 @@ public virtual Response GetVirtualMachineRunCommand(AzureLoc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2363,7 +2363,7 @@ public virtual AsyncPageable GetManagedDisksAsync(Cancellat /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2393,7 +2393,7 @@ public virtual Pageable GetManagedDisks(CancellationToken c /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2423,7 +2423,7 @@ public virtual AsyncPageable GetDiskAccessesAsync(Cancellati /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2453,7 +2453,7 @@ public virtual Pageable GetDiskAccesses(CancellationToken ca /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2483,7 +2483,7 @@ public virtual AsyncPageable GetDiskEncryptionSetsAsy /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2513,7 +2513,7 @@ public virtual Pageable GetDiskEncryptionSets(Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2543,7 +2543,7 @@ public virtual AsyncPageable GetSnapshotsAsync(CancellationTok /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskCollection.cs index 31ccb43c569fe..61f175844d9a9 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUn /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string diskNam /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string diskName, CancellationTo /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellati /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string diskName, Cancellat /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string diskName, CancellationToken cancella /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsyn /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskResource.cs index f02326a42478f..27ff9b604e1f4 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationTo /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationT /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(WaitUnt /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Man /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -405,7 +405,7 @@ public virtual async Task> GrantAccessAsync(WaitUntil wa /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -451,7 +451,7 @@ public virtual ArmOperation GrantAccess(WaitUntil waitUntil, GrantAcc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -493,7 +493,7 @@ public virtual async Task RevokeAccessAsync(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -535,7 +535,7 @@ public virtual ArmOperation RevokeAccess(WaitUntil waitUntil, CancellationToken /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -597,7 +597,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual Response AddTag(string key, string value, Ca /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -716,7 +716,7 @@ public virtual async Task> SetTagsAsync(IDictionar /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -773,7 +773,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -833,7 +833,7 @@ public virtual async Task> RemoveTagAsync(string k /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.Serialization.cs index 8d04d2330c3d5..ad7a06ff24023 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.Serialization.cs @@ -80,6 +80,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteEndArray(); } + if (Optional.IsDefined(ScheduledEventsPolicy)) + { + writer.WritePropertyName("scheduledEventsPolicy"u8); + writer.WriteObjectValue(ScheduledEventsPolicy, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -126,6 +131,7 @@ internal static AvailabilitySetPatch DeserializeAvailabilitySetPatch(JsonElement IList virtualMachines = default; WritableSubResource proximityPlacementGroup = default; IReadOnlyList statuses = default; + ScheduledEventsPolicy scheduledEventsPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -217,6 +223,15 @@ internal static AvailabilitySetPatch DeserializeAvailabilitySetPatch(JsonElement statuses = array; continue; } + if (property0.NameEquals("scheduledEventsPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledEventsPolicy = ScheduledEventsPolicy.DeserializeScheduledEventsPolicy(property0.Value, options); + continue; + } } continue; } @@ -234,7 +249,8 @@ internal static AvailabilitySetPatch DeserializeAvailabilitySetPatch(JsonElement platformFaultDomainCount, virtualMachines ?? new ChangeTrackingList(), proximityPlacementGroup, - statuses ?? new ChangeTrackingList()); + statuses ?? new ChangeTrackingList(), + scheduledEventsPolicy); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.cs index 9edd5dde05bdc..68d10c002520b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.cs @@ -31,7 +31,8 @@ public AvailabilitySetPatch() /// A list of references to all virtual machines in the availability set. /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. /// The resource status information. - internal AvailabilitySetPatch(IDictionary tags, IDictionary serializedAdditionalRawData, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IList virtualMachines, WritableSubResource proximityPlacementGroup, IReadOnlyList statuses) : base(tags, serializedAdditionalRawData) + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. + internal AvailabilitySetPatch(IDictionary tags, IDictionary serializedAdditionalRawData, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IList virtualMachines, WritableSubResource proximityPlacementGroup, IReadOnlyList statuses, ScheduledEventsPolicy scheduledEventsPolicy) : base(tags, serializedAdditionalRawData) { Sku = sku; PlatformUpdateDomainCount = platformUpdateDomainCount; @@ -39,6 +40,7 @@ internal AvailabilitySetPatch(IDictionary tags, IDictionary Sku of the availability set. @@ -65,5 +67,7 @@ public ResourceIdentifier ProximityPlacementGroupId /// The resource status information. public IReadOnlyList Statuses { get; } + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. + public ScheduledEventsPolicy ScheduledEventsPolicy { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupInstanceView.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupInstanceView.cs index dff375d412c17..4d6eaa4fb56da 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupInstanceView.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupInstanceView.cs @@ -55,7 +55,7 @@ internal CapacityReservationGroupInstanceView() /// Initializes a new instance of . /// List of instance view of the capacity reservations under the capacity reservation group. - /// List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. /// Keeps track of any properties unknown to the library. internal CapacityReservationGroupInstanceView(IReadOnlyList capacityReservations, IReadOnlyList sharedSubscriptionIds, IDictionary serializedAdditionalRawData) { @@ -66,7 +66,7 @@ internal CapacityReservationGroupInstanceView(IReadOnlyList List of instance view of the capacity reservations under the capacity reservation group. public IReadOnlyList CapacityReservations { get; } - /// List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. public IReadOnlyList SharedSubscriptionIds { get; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupPatch.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupPatch.cs index 8287f77a873b9..f1946b36a19cd 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupPatch.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupPatch.cs @@ -27,7 +27,7 @@ public CapacityReservationGroupPatch() /// A list of all capacity reservation resource ids that belong to capacity reservation group. /// A list of references to all virtual machines associated to the capacity reservation group. /// The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. - /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. internal CapacityReservationGroupPatch(IDictionary tags, IDictionary serializedAdditionalRawData, IReadOnlyList capacityReservations, IReadOnlyList virtualMachinesAssociated, CapacityReservationGroupInstanceView instanceView, ResourceSharingProfile sharingProfile) : base(tags, serializedAdditionalRawData) { CapacityReservations = capacityReservations; @@ -42,9 +42,9 @@ internal CapacityReservationGroupPatch(IDictionary tags, IDictio public IReadOnlyList VirtualMachinesAssociated { get; } /// The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. public CapacityReservationGroupInstanceView InstanceView { get; } - /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. internal ResourceSharingProfile SharingProfile { get; set; } - /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. public IList SharingSubscriptionIds { get diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeAllocationStrategy.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeAllocationStrategy.cs new file mode 100644 index 0000000000000..bc4e5a2a9fc1b --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeAllocationStrategy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the allocation strategy for the virtual machine scale set based on which the VMs will be allocated. + public readonly partial struct ComputeAllocationStrategy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeAllocationStrategy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LowestPriceValue = "LowestPrice"; + private const string CapacityOptimizedValue = "CapacityOptimized"; + + /// LowestPrice. + public static ComputeAllocationStrategy LowestPrice { get; } = new ComputeAllocationStrategy(LowestPriceValue); + /// CapacityOptimized. + public static ComputeAllocationStrategy CapacityOptimized { get; } = new ComputeAllocationStrategy(CapacityOptimizedValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeAllocationStrategy left, ComputeAllocationStrategy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeAllocationStrategy left, ComputeAllocationStrategy right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeAllocationStrategy(string value) => new ComputeAllocationStrategy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeAllocationStrategy other && Equals(other); + /// + public bool Equals(ComputeAllocationStrategy 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/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.Serialization.cs index 3fa687b1f362e..b0f5bae5c273e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.Serialization.cs @@ -26,21 +26,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsCollectionDefined(ExcludeExtensions)) + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsCollectionDefined(ExcludeExtensionNames)) { writer.WritePropertyName("excludeExtensions"u8); writer.WriteStartArray(); - foreach (var item in ExcludeExtensions) + foreach (var item in ExcludeExtensionNames) { - writer.WriteObjectValue(item, options); + writer.WriteStringValue(item); } writer.WriteEndArray(); } + if (Optional.IsDefined(IsOverridable)) + { + writer.WritePropertyName("isOverridable"u8); + writer.WriteBooleanValue(IsOverridable.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -80,17 +82,14 @@ internal static ComputeSecurityPostureReference DeserializeComputeSecurityPostur return null; } ResourceIdentifier id = default; - IList excludeExtensions = default; + IList excludeExtensions = default; + bool? isOverridable = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } id = new ResourceIdentifier(property.Value.GetString()); continue; } @@ -100,21 +99,30 @@ internal static ComputeSecurityPostureReference DeserializeComputeSecurityPostur { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(VirtualMachineExtensionData.DeserializeVirtualMachineExtensionData(item, options)); + array.Add(item.GetString()); } excludeExtensions = array; continue; } + if (property.NameEquals("isOverridable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOverridable = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ComputeSecurityPostureReference(id, excludeExtensions ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new ComputeSecurityPostureReference(id, excludeExtensions ?? new ChangeTrackingList(), isOverridable, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.cs index f47588301e281..6148d0bbe3aaa 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Compute.Models { - /// Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01. + /// Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01. public partial class ComputeSecurityPostureReference { /// @@ -47,25 +47,34 @@ public partial class ComputeSecurityPostureReference private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public ComputeSecurityPostureReference() + /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest. + /// is null. + public ComputeSecurityPostureReference(ResourceIdentifier id) { - ExcludeExtensions = new ChangeTrackingList(); + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + ExcludeExtensionNames = new ChangeTrackingList(); } /// Initializes a new instance of . - /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest. - /// List of virtual machine extensions to exclude when applying the Security Posture. + /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest. + /// The list of virtual machine extension names to exclude when applying the security posture. + /// Whether the security posture can be overridden by the user. /// Keeps track of any properties unknown to the library. - internal ComputeSecurityPostureReference(ResourceIdentifier id, IList excludeExtensions, IDictionary serializedAdditionalRawData) + internal ComputeSecurityPostureReference(ResourceIdentifier id, IList excludeExtensionNames, bool? isOverridable, IDictionary serializedAdditionalRawData) { Id = id; - ExcludeExtensions = excludeExtensions; + ExcludeExtensionNames = excludeExtensionNames; + IsOverridable = isOverridable; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest. + /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest. public ResourceIdentifier Id { get; set; } - /// List of virtual machine extensions to exclude when applying the Security Posture. - public IList ExcludeExtensions { get; } + /// The list of virtual machine extension names to exclude when applying the security posture. + public IList ExcludeExtensionNames { get; } + /// Whether the security posture can be overridden by the user. + public bool? IsOverridable { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.Serialization.cs new file mode 100644 index 0000000000000..ce3352bd96a56 --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.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.Core; + +namespace Azure.ResourceManager.Compute.Models +{ + public partial class ComputeSkuProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeSkuProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(VmSizes)) + { + writer.WritePropertyName("vmSizes"u8); + writer.WriteStartArray(); + foreach (var item in VmSizes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AllocationStrategy)) + { + writer.WritePropertyName("allocationStrategy"u8); + writer.WriteStringValue(AllocationStrategy.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeSkuProfile 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(ComputeSkuProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeSkuProfile(document.RootElement, options); + } + + internal static ComputeSkuProfile DeserializeComputeSkuProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList vmSizes = default; + ComputeAllocationStrategy? allocationStrategy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmSizes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeSkuProfileVmSize.DeserializeComputeSkuProfileVmSize(item, options)); + } + vmSizes = array; + continue; + } + if (property.NameEquals("allocationStrategy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocationStrategy = new ComputeAllocationStrategy(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeSkuProfile(vmSizes ?? new ChangeTrackingList(), allocationStrategy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeSkuProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeSkuProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeSkuProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeSkuProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.cs new file mode 100644 index 0000000000000..fb9cbb4cf5026 --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the sku profile for the virtual machine scale set. With this property the customer is able to specify a list of VM sizes and an allocation strategy. + public partial class ComputeSkuProfile + { + /// + /// 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 . + public ComputeSkuProfile() + { + VmSizes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Specifies the VM sizes for the virtual machine scale set. + /// Specifies the allocation strategy for the virtual machine scale set based on which the VMs will be allocated. + /// Keeps track of any properties unknown to the library. + internal ComputeSkuProfile(IList vmSizes, ComputeAllocationStrategy? allocationStrategy, IDictionary serializedAdditionalRawData) + { + VmSizes = vmSizes; + AllocationStrategy = allocationStrategy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the VM sizes for the virtual machine scale set. + public IList VmSizes { get; } + /// Specifies the allocation strategy for the virtual machine scale set based on which the VMs will be allocated. + public ComputeAllocationStrategy? AllocationStrategy { get; set; } + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.Serialization.cs new file mode 100644 index 0000000000000..859ac40652f4f --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.Serialization.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Compute.Models +{ + public partial class ComputeSkuProfileVmSize : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeSkuProfileVmSize)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeSkuProfileVmSize 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(ComputeSkuProfileVmSize)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeSkuProfileVmSize(document.RootElement, options); + } + + internal static ComputeSkuProfileVmSize DeserializeComputeSkuProfileVmSize(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = 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 (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeSkuProfileVmSize(name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeSkuProfileVmSize)} does not support writing '{options.Format}' format."); + } + } + + ComputeSkuProfileVmSize IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeSkuProfileVmSize(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeSkuProfileVmSize)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.cs new file mode 100644 index 0000000000000..e168e7ba2a442 --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the VM Size. + public partial class ComputeSkuProfileVmSize + { + /// + /// 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 . + public ComputeSkuProfileVmSize() + { + } + + /// Initializes a new instance of . + /// Specifies the name of the VM Size. + /// Keeps track of any properties unknown to the library. + internal ComputeSkuProfileVmSize(string name, IDictionary serializedAdditionalRawData) + { + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the name of the VM Size. + public string Name { get; set; } + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/DiskDetachOptionType.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/DiskDetachOptionType.cs index 283917f83b446..2c4acc4d1409d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/DiskDetachOptionType.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/DiskDetachOptionType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Compute.Models { - /// Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values are: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. + /// Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values are: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. public readonly partial struct DiskDetachOptionType : IEquatable { private readonly string _value; diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ProxyAgentSettings.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ProxyAgentSettings.cs index 843352697efcd..466c74c479073 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ProxyAgentSettings.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ProxyAgentSettings.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Compute.Models { - /// Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2024-03-01. + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2023-09-01. public partial class ProxyAgentSettings { /// diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ResourceSharingProfile.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ResourceSharingProfile.cs index 1df1780fe5bea..b745ae06b96bb 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ResourceSharingProfile.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ResourceSharingProfile.cs @@ -53,7 +53,7 @@ public ResourceSharingProfile() } /// Initializes a new instance of . - /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. /// Keeps track of any properties unknown to the library. internal ResourceSharingProfile(IList subscriptionIds, IDictionary serializedAdditionalRawData) { @@ -61,7 +61,7 @@ internal ResourceSharingProfile(IList subscriptionIds, IDic _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. public IList SubscriptionIds { get; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.Serialization.cs new file mode 100644 index 0000000000000..c51262ccaf2e9 --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Compute.Models +{ + public partial class SecurityPostureReferenceUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityPostureReferenceUpdate)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(ExcludeExtensions)) + { + writer.WritePropertyName("excludeExtensions"u8); + writer.WriteStartArray(); + foreach (var item in ExcludeExtensions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IsOverridable)) + { + writer.WritePropertyName("isOverridable"u8); + writer.WriteBooleanValue(IsOverridable.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SecurityPostureReferenceUpdate 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(SecurityPostureReferenceUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecurityPostureReferenceUpdate(document.RootElement, options); + } + + internal static SecurityPostureReferenceUpdate DeserializeSecurityPostureReferenceUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + IList excludeExtensions = default; + bool? isOverridable = 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("excludeExtensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + excludeExtensions = array; + continue; + } + if (property.NameEquals("isOverridable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOverridable = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecurityPostureReferenceUpdate(id, excludeExtensions ?? new ChangeTrackingList(), isOverridable, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SecurityPostureReferenceUpdate)} does not support writing '{options.Format}' format."); + } + } + + SecurityPostureReferenceUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecurityPostureReferenceUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecurityPostureReferenceUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.cs new file mode 100644 index 0000000000000..d47cb1dbfa556 --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01. + public partial class SecurityPostureReferenceUpdate + { + /// + /// 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 . + public SecurityPostureReferenceUpdate() + { + ExcludeExtensions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest. + /// The list of virtual machine extension names to exclude when applying the security posture. + /// Whether the security posture can be overridden by the user. + /// Keeps track of any properties unknown to the library. + internal SecurityPostureReferenceUpdate(string id, IList excludeExtensions, bool? isOverridable, IDictionary serializedAdditionalRawData) + { + Id = id; + ExcludeExtensions = excludeExtensions; + IsOverridable = isOverridable; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest. + public string Id { get; set; } + /// The list of virtual machine extension names to exclude when applying the security posture. + public IList ExcludeExtensions { get; } + /// Whether the security posture can be overridden by the user. + public bool? IsOverridable { get; set; } + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityProfile.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityProfile.cs index f0b45a15b1536..7967290893ca2 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityProfile.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityProfile.cs @@ -55,7 +55,7 @@ public SecurityProfile() /// This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. The default behavior is: The Encryption at host will be disabled unless this property is set to true for the resource. /// Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. The default behavior is: UefiSettings will not be enabled unless this property is set. /// Specifies the Managed Identity used by ADE to get access token for keyvault operations. - /// Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2024-03-01. + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2023-09-01. /// Keeps track of any properties unknown to the library. internal SecurityProfile(UefiSettings uefiSettings, bool? encryptionAtHost, SecurityType? securityType, EncryptionIdentity encryptionIdentity, ProxyAgentSettings proxyAgentSettings, IDictionary serializedAdditionalRawData) { @@ -87,7 +87,7 @@ public string UserAssignedIdentityResourceId } } - /// Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2024-03-01. + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2023-09-01. public ProxyAgentSettings ProxyAgentSettings { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.Serialization.cs index 19cbebc2346fa..5cd28542f03ad 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.Serialization.cs @@ -43,6 +43,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("identity"u8); JsonSerializer.Serialize(writer, Identity); } + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,6 +126,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("resiliencyPolicy"u8); writer.WriteObjectValue(ResiliencyPolicy, options); } + if (Optional.IsDefined(ZonalPlatformFaultDomainAlignMode)) + { + writer.WritePropertyName("zonalPlatformFaultDomainAlignMode"u8); + writer.WriteStringValue(ZonalPlatformFaultDomainAlignMode.Value.ToString()); + } + if (Optional.IsDefined(SkuProfile)) + { + writer.WritePropertyName("skuProfile"u8); + writer.WriteObjectValue(SkuProfile, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -158,6 +178,7 @@ internal static VirtualMachineScaleSetPatch DeserializeVirtualMachineScaleSetPat ComputeSku sku = default; ComputePlan plan = default; ManagedServiceIdentity identity = default; + IList zones = default; IDictionary tags = default; VirtualMachineScaleSetUpgradePolicy upgradePolicy = default; AutomaticRepairsPolicy automaticRepairsPolicy = default; @@ -171,6 +192,8 @@ internal static VirtualMachineScaleSetPatch DeserializeVirtualMachineScaleSetPat VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy = default; SpotRestorePolicy spotRestorePolicy = default; ResiliencyPolicy resiliencyPolicy = default; + ZonalPlatformFaultDomainAlignMode? zonalPlatformFaultDomainAlignMode = default; + ComputeSkuProfile skuProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -202,6 +225,20 @@ internal static VirtualMachineScaleSetPatch DeserializeVirtualMachineScaleSetPat identity = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } + if (property.NameEquals("zones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -333,6 +370,24 @@ internal static VirtualMachineScaleSetPatch DeserializeVirtualMachineScaleSetPat resiliencyPolicy = ResiliencyPolicy.DeserializeResiliencyPolicy(property0.Value, options); continue; } + if (property0.NameEquals("zonalPlatformFaultDomainAlignMode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zonalPlatformFaultDomainAlignMode = new ZonalPlatformFaultDomainAlignMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("skuProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + skuProfile = ComputeSkuProfile.DeserializeComputeSkuProfile(property0.Value, options); + continue; + } } continue; } @@ -348,6 +403,7 @@ internal static VirtualMachineScaleSetPatch DeserializeVirtualMachineScaleSetPat sku, plan, identity, + zones ?? new ChangeTrackingList(), upgradePolicy, automaticRepairsPolicy, virtualMachineProfile, @@ -359,7 +415,9 @@ internal static VirtualMachineScaleSetPatch DeserializeVirtualMachineScaleSetPat proximityPlacementGroup, priorityMixPolicy, spotRestorePolicy, - resiliencyPolicy); + resiliencyPolicy, + zonalPlatformFaultDomainAlignMode, + skuProfile); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.cs index adb2a217df602..b68cbbcdb156d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.cs @@ -19,6 +19,7 @@ public partial class VirtualMachineScaleSetPatch : ComputeResourcePatch /// Initializes a new instance of . public VirtualMachineScaleSetPatch() { + Zones = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -27,6 +28,7 @@ public VirtualMachineScaleSetPatch() /// The virtual machine scale set sku. /// The purchase plan when deploying a virtual machine scale set from VM Marketplace images. /// The identity of the virtual machine scale set, if configured. + /// The virtual machine scale set zones. /// The upgrade policy. /// Policy for automatic repairs. /// The virtual machine profile. @@ -39,11 +41,14 @@ public VirtualMachineScaleSetPatch() /// Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. /// Specifies the Spot Restore properties for the virtual machine scale set. /// Policy for Resiliency. - internal VirtualMachineScaleSetPatch(IDictionary tags, IDictionary serializedAdditionalRawData, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, VirtualMachineScaleSetUpgradePolicy upgradePolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetUpdateVmProfile virtualMachineProfile, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, bool? singlePlacementGroup, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, WritableSubResource proximityPlacementGroup, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, SpotRestorePolicy spotRestorePolicy, ResiliencyPolicy resiliencyPolicy) : base(tags, serializedAdditionalRawData) + /// Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. + /// Specifies the sku profile for the virtual machine scale set. + internal VirtualMachineScaleSetPatch(IDictionary tags, IDictionary serializedAdditionalRawData, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, IList zones, VirtualMachineScaleSetUpgradePolicy upgradePolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetUpdateVmProfile virtualMachineProfile, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, bool? singlePlacementGroup, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, WritableSubResource proximityPlacementGroup, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, SpotRestorePolicy spotRestorePolicy, ResiliencyPolicy resiliencyPolicy, ZonalPlatformFaultDomainAlignMode? zonalPlatformFaultDomainAlignMode, ComputeSkuProfile skuProfile) : base(tags, serializedAdditionalRawData) { Sku = sku; Plan = plan; Identity = identity; + Zones = zones; UpgradePolicy = upgradePolicy; AutomaticRepairsPolicy = automaticRepairsPolicy; VirtualMachineProfile = virtualMachineProfile; @@ -56,6 +61,8 @@ internal VirtualMachineScaleSetPatch(IDictionary tags, IDictiona PriorityMixPolicy = priorityMixPolicy; SpotRestorePolicy = spotRestorePolicy; ResiliencyPolicy = resiliencyPolicy; + ZonalPlatformFaultDomainAlignMode = zonalPlatformFaultDomainAlignMode; + SkuProfile = skuProfile; } /// The virtual machine scale set sku. @@ -64,6 +71,8 @@ internal VirtualMachineScaleSetPatch(IDictionary tags, IDictiona public ComputePlan Plan { get; set; } /// The identity of the virtual machine scale set, if configured. public ManagedServiceIdentity Identity { get; set; } + /// The virtual machine scale set zones. + public IList Zones { get; } /// The upgrade policy. public VirtualMachineScaleSetUpgradePolicy UpgradePolicy { get; set; } /// Policy for automatic repairs. @@ -100,5 +109,9 @@ public ResourceIdentifier ProximityPlacementGroupId public SpotRestorePolicy SpotRestorePolicy { get; set; } /// Policy for Resiliency. public ResiliencyPolicy ResiliencyPolicy { get; set; } + /// Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. + public ZonalPlatformFaultDomainAlignMode? ZonalPlatformFaultDomainAlignMode { get; set; } + /// Specifies the sku profile for the virtual machine scale set. + public ComputeSkuProfile SkuProfile { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.Serialization.cs index 550b33eee8200..edd5928a0d203 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.Serialization.cs @@ -41,6 +41,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WritePropertyName("networkProfile"u8); writer.WriteObjectValue(NetworkProfile, options); } + if (Optional.IsDefined(SecurityPostureReference)) + { + writer.WritePropertyName("securityPostureReference"u8); + writer.WriteObjectValue(SecurityPostureReference, options); + } if (Optional.IsDefined(SecurityProfile)) { writer.WritePropertyName("securityProfile"u8); @@ -122,6 +127,7 @@ internal static VirtualMachineScaleSetUpdateVmProfile DeserializeVirtualMachineS VirtualMachineScaleSetUpdateOSProfile osProfile = default; VirtualMachineScaleSetUpdateStorageProfile storageProfile = default; VirtualMachineScaleSetUpdateNetworkProfile networkProfile = default; + SecurityPostureReferenceUpdate securityPostureReference = default; SecurityProfile securityProfile = default; DiagnosticsProfile diagnosticsProfile = default; VirtualMachineScaleSetExtensionProfile extensionProfile = default; @@ -161,6 +167,15 @@ internal static VirtualMachineScaleSetUpdateVmProfile DeserializeVirtualMachineS networkProfile = VirtualMachineScaleSetUpdateNetworkProfile.DeserializeVirtualMachineScaleSetUpdateNetworkProfile(property.Value, options); continue; } + if (property.NameEquals("securityPostureReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityPostureReference = SecurityPostureReferenceUpdate.DeserializeSecurityPostureReferenceUpdate(property.Value, options); + continue; + } if (property.NameEquals("securityProfile"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -235,6 +250,7 @@ internal static VirtualMachineScaleSetUpdateVmProfile DeserializeVirtualMachineS osProfile, storageProfile, networkProfile, + securityPostureReference, securityProfile, diagnosticsProfile, extensionProfile, diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.cs index f5c7d33a5f374..2077a6e9ebca3 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.cs @@ -54,6 +54,7 @@ public VirtualMachineScaleSetUpdateVmProfile() /// The virtual machine scale set OS profile. /// The virtual machine scale set storage profile. /// The virtual machine scale set network profile. + /// The virtual machine scale set security posture reference. /// The virtual machine scale set Security profile. /// The virtual machine scale set diagnostics profile. /// The virtual machine scale set extension profile. @@ -63,11 +64,12 @@ public VirtualMachineScaleSetUpdateVmProfile() /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01. /// Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. /// Keeps track of any properties unknown to the library. - internal VirtualMachineScaleSetUpdateVmProfile(VirtualMachineScaleSetUpdateOSProfile osProfile, VirtualMachineScaleSetUpdateStorageProfile storageProfile, VirtualMachineScaleSetUpdateNetworkProfile networkProfile, SecurityProfile securityProfile, DiagnosticsProfile diagnosticsProfile, VirtualMachineScaleSetExtensionProfile extensionProfile, string licenseType, BillingProfile billingProfile, ComputeScheduledEventsProfile scheduledEventsProfile, string userData, VirtualMachineScaleSetHardwareProfile hardwareProfile, IDictionary serializedAdditionalRawData) + internal VirtualMachineScaleSetUpdateVmProfile(VirtualMachineScaleSetUpdateOSProfile osProfile, VirtualMachineScaleSetUpdateStorageProfile storageProfile, VirtualMachineScaleSetUpdateNetworkProfile networkProfile, SecurityPostureReferenceUpdate securityPostureReference, SecurityProfile securityProfile, DiagnosticsProfile diagnosticsProfile, VirtualMachineScaleSetExtensionProfile extensionProfile, string licenseType, BillingProfile billingProfile, ComputeScheduledEventsProfile scheduledEventsProfile, string userData, VirtualMachineScaleSetHardwareProfile hardwareProfile, IDictionary serializedAdditionalRawData) { OSProfile = osProfile; StorageProfile = storageProfile; NetworkProfile = networkProfile; + SecurityPostureReference = securityPostureReference; SecurityProfile = securityProfile; DiagnosticsProfile = diagnosticsProfile; ExtensionProfile = extensionProfile; @@ -85,6 +87,8 @@ internal VirtualMachineScaleSetUpdateVmProfile(VirtualMachineScaleSetUpdateOSPro public VirtualMachineScaleSetUpdateStorageProfile StorageProfile { get; set; } /// The virtual machine scale set network profile. public VirtualMachineScaleSetUpdateNetworkProfile NetworkProfile { get; set; } + /// The virtual machine scale set security posture reference. + public SecurityPostureReferenceUpdate SecurityPostureReference { get; set; } /// The virtual machine scale set Security profile. public SecurityProfile SecurityProfile { get; set; } /// The virtual machine scale set diagnostics profile. diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmProfile.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmProfile.cs index 732c9ab548fdf..16ad90ac6f291 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmProfile.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmProfile.cs @@ -69,8 +69,8 @@ public VirtualMachineScaleSetVmProfile() /// Specifies the gallery applications that should be made available to the VM/VMSS. /// Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. /// Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01. - /// Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01. - /// Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. Minimum API version for this property is 2024-03-01. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile with minimum api-version 2024-03-01. + /// Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01. + /// Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile. Minimum API version for this property is 2023-09-01. /// Keeps track of any properties unknown to the library. internal VirtualMachineScaleSetVmProfile(VirtualMachineScaleSetOSProfile osProfile, VirtualMachineScaleSetStorageProfile storageProfile, VirtualMachineScaleSetNetworkProfile networkProfile, SecurityProfile securityProfile, DiagnosticsProfile diagnosticsProfile, VirtualMachineScaleSetExtensionProfile extensionProfile, string licenseType, VirtualMachinePriorityType? priority, VirtualMachineEvictionPolicyType? evictionPolicy, BillingProfile billingProfile, ComputeScheduledEventsProfile scheduledEventsProfile, string userData, CapacityReservationProfile capacityReservation, ApplicationProfile applicationProfile, VirtualMachineScaleSetHardwareProfile hardwareProfile, WritableSubResource serviceArtifactReference, ComputeSecurityPostureReference securityPostureReference, DateTimeOffset? timeCreated, IDictionary serializedAdditionalRawData) { @@ -198,9 +198,9 @@ public ResourceIdentifier ServiceArtifactReferenceId } } - /// Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01. + /// Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01. public ComputeSecurityPostureReference SecurityPostureReference { get; set; } - /// Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. Minimum API version for this property is 2024-03-01. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile with minimum api-version 2024-03-01. + /// Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile. Minimum API version for this property is 2023-09-01. public DateTimeOffset? TimeCreated { get; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.Serialization.cs index 75b32d96ef022..0ad8931914957 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.Serialization.cs @@ -61,7 +61,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("winRM"u8); writer.WriteObjectValue(WinRM, options); } - if (Optional.IsDefined(IsVmAgentPlatformUpdatesEnabled)) + if (options.Format != "W" && Optional.IsDefined(IsVmAgentPlatformUpdatesEnabled)) { writer.WritePropertyName("enableVMAgentPlatformUpdates"u8); writer.WriteBooleanValue(IsVmAgentPlatformUpdatesEnabled.Value); diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.cs index 92a91f084f9bb..cfe33b82150d7 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.cs @@ -58,7 +58,7 @@ public WindowsConfiguration() /// Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. /// [Preview Feature] Specifies settings related to VM Guest Patching on Windows. /// Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. - /// Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. + /// Indicates whether VMAgent Platform Updates are enabled for the Windows Virtual Machine. /// Keeps track of any properties unknown to the library. internal WindowsConfiguration(bool? provisionVmAgent, bool? isAutomaticUpdatesEnabled, string timeZone, IList additionalUnattendContent, PatchSettings patchSettings, WinRMConfiguration winRM, bool? isVmAgentPlatformUpdatesEnabled, IDictionary serializedAdditionalRawData) { @@ -94,8 +94,5 @@ public IList WinRMListeners return WinRM.Listeners; } } - - /// Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. - public bool? IsVmAgentPlatformUpdatesEnabled { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ZonalPlatformFaultDomainAlignMode.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ZonalPlatformFaultDomainAlignMode.cs new file mode 100644 index 0000000000000..d1f59a70f8fb4 --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ZonalPlatformFaultDomainAlignMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. + public readonly partial struct ZonalPlatformFaultDomainAlignMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ZonalPlatformFaultDomainAlignMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AlignedValue = "Aligned"; + private const string UnalignedValue = "Unaligned"; + + /// Aligned. + public static ZonalPlatformFaultDomainAlignMode Aligned { get; } = new ZonalPlatformFaultDomainAlignMode(AlignedValue); + /// Unaligned. + public static ZonalPlatformFaultDomainAlignMode Unaligned { get; } = new ZonalPlatformFaultDomainAlignMode(UnalignedValue); + /// Determines if two values are the same. + public static bool operator ==(ZonalPlatformFaultDomainAlignMode left, ZonalPlatformFaultDomainAlignMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ZonalPlatformFaultDomainAlignMode left, ZonalPlatformFaultDomainAlignMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ZonalPlatformFaultDomainAlignMode(string value) => new ZonalPlatformFaultDomainAlignMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ZonalPlatformFaultDomainAlignMode other && Equals(other); + /// + public bool Equals(ZonalPlatformFaultDomainAlignMode 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/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupCollection.cs index a3b7e8229c9bf..4752c0c434ec2 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateO /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(string proximityPla /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAsync(Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(CancellationToke /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -363,7 +363,7 @@ public virtual async Task> ExistsAsync(string proximityPlacementG /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -407,7 +407,7 @@ public virtual Response Exists(string proximityPlacementGroupName, string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -453,7 +453,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupResource.cs index 6ec7f061d3f48..785fe0b0d9ab0 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(string includeColoc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -273,7 +273,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -357,7 +357,7 @@ public virtual Response Update(ProximityPlaceme /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -419,7 +419,7 @@ public virtual async Task> AddTagAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -481,7 +481,7 @@ public virtual Response AddTag(string key, stri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -538,7 +538,7 @@ public virtual async Task> SetTagsAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -595,7 +595,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -655,7 +655,7 @@ public virtual async Task> RemoveTagAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/AvailabilitySetsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/AvailabilitySetsRestOperations.cs index 1b586890c4c92..b38415e8e3a39 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/AvailabilitySetsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/AvailabilitySetsRestOperations.cs @@ -32,7 +32,7 @@ public AvailabilitySetsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationGroupsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationGroupsRestOperations.cs index dfa363041b772..0a19b9fcfb31d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationGroupsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationGroupsRestOperations.cs @@ -32,7 +32,7 @@ public CapacityReservationGroupsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationsRestOperations.cs index ea5afd4d3a72c..2d8185a69f0ba 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationsRestOperations.cs @@ -32,7 +32,7 @@ public CapacityReservationsRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostGroupsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostGroupsRestOperations.cs index 6ad5e32ba5cc9..767261bf2c322 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostGroupsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostGroupsRestOperations.cs @@ -32,7 +32,7 @@ public DedicatedHostGroupsRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostsRestOperations.cs index ffe6ac8342fac..245098e6b3637 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostsRestOperations.cs @@ -32,7 +32,7 @@ public DedicatedHostsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskAccessesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskAccessesRestOperations.cs index f247b82c397b3..623d76107872f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskAccessesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskAccessesRestOperations.cs @@ -32,7 +32,7 @@ public DiskAccessesRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-02"; + _apiVersion = apiVersion ?? "2024-03-02"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskEncryptionSetsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskEncryptionSetsRestOperations.cs index 87602226244a0..44f6701786f48 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskEncryptionSetsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskEncryptionSetsRestOperations.cs @@ -32,7 +32,7 @@ public DiskEncryptionSetsRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-02"; + _apiVersion = apiVersion ?? "2024-03-02"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskRestorePointRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskRestorePointRestOperations.cs index 10e294f746698..fdf3f9733b706 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskRestorePointRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskRestorePointRestOperations.cs @@ -32,7 +32,7 @@ public DiskRestorePointRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-02"; + _apiVersion = apiVersion ?? "2024-03-02"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DisksRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DisksRestOperations.cs index 2c3b4e2485baa..dc0b3d627e7fa 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DisksRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DisksRestOperations.cs @@ -32,7 +32,7 @@ public DisksRestOperations(HttpPipeline pipeline, string applicationId, Uri endp { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-02"; + _apiVersion = apiVersion ?? "2024-03-02"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ImagesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ImagesRestOperations.cs index 95128bc8f0af0..cd2b9b649e68b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ImagesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ImagesRestOperations.cs @@ -32,7 +32,7 @@ public ImagesRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/LogAnalyticsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/LogAnalyticsRestOperations.cs index 5b0735600c03f..50ecd872d28e3 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/LogAnalyticsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/LogAnalyticsRestOperations.cs @@ -31,7 +31,7 @@ public LogAnalyticsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ProximityPlacementGroupsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ProximityPlacementGroupsRestOperations.cs index 0d610f627ed92..4983d25e50030 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ProximityPlacementGroupsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ProximityPlacementGroupsRestOperations.cs @@ -32,7 +32,7 @@ public ProximityPlacementGroupsRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointCollectionsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointCollectionsRestOperations.cs index 3b2175fd2cb31..4bcb21becb3b8 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointCollectionsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointCollectionsRestOperations.cs @@ -32,7 +32,7 @@ public RestorePointCollectionsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointsRestOperations.cs index 64bdec25596b2..7d6a929e47094 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointsRestOperations.cs @@ -32,7 +32,7 @@ public RestorePointsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SnapshotsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SnapshotsRestOperations.cs index 23de2a0699dfe..5399c3b065344 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SnapshotsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SnapshotsRestOperations.cs @@ -32,7 +32,7 @@ public SnapshotsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-02"; + _apiVersion = apiVersion ?? "2024-03-02"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SshPublicKeysRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SshPublicKeysRestOperations.cs index b24a2f6ba32ef..4b71337e703a1 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SshPublicKeysRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SshPublicKeysRestOperations.cs @@ -32,7 +32,7 @@ public SshPublicKeysRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/UsageRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/UsageRestOperations.cs index 96f0cbabe61bd..f4250b8b29dec 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/UsageRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/UsageRestOperations.cs @@ -32,7 +32,7 @@ public UsageRestOperations(HttpPipeline pipeline, string applicationId, Uri endp { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionImagesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionImagesRestOperations.cs index 6223780f8c179..141d39fa96ac7 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionImagesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionImagesRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineExtensionImagesRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionsRestOperations.cs index 785f349eeb1fe..04cbbe0fdfe98 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineExtensionsRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesEdgeZoneRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesEdgeZoneRestOperations.cs index e4f069044c7bf..6195fc3e8b389 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesEdgeZoneRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesEdgeZoneRestOperations.cs @@ -33,7 +33,7 @@ public VirtualMachineImagesEdgeZoneRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesRestOperations.cs index a8d18646504b8..c277e671b4bca 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesRestOperations.cs @@ -33,7 +33,7 @@ public VirtualMachineImagesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineRunCommandsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineRunCommandsRestOperations.cs index dfeb827f71e04..9126e918b47e7 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineRunCommandsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineRunCommandsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineRunCommandsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetExtensionsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetExtensionsRestOperations.cs index 6a46adc62e3aa..ff18fda3756f7 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetExtensionsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetExtensionsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineScaleSetExtensionsRestOperations(HttpPipeline pipeline, str { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetRollingUpgradesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetRollingUpgradesRestOperations.cs index e2eb19c32a0b5..050e9a94fbd0e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetRollingUpgradesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetRollingUpgradesRestOperations.cs @@ -31,7 +31,7 @@ public VirtualMachineScaleSetRollingUpgradesRestOperations(HttpPipeline pipeline { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMExtensionsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMExtensionsRestOperations.cs index 246270f7ee8fa..811577aae8a0b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMExtensionsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMExtensionsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineScaleSetVMExtensionsRestOperations(HttpPipeline pipeline, s { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMRunCommandsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMRunCommandsRestOperations.cs index 56a0a3d416b4a..a0503c6427657 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMRunCommandsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMRunCommandsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineScaleSetVMRunCommandsRestOperations(HttpPipeline pipeline, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMsRestOperations.cs index 8b5289841d25a..11830c19b5880 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineScaleSetVMsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetsRestOperations.cs index 9784bf894a615..aad3198cf2d5f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineScaleSetsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs index f86d207e57158..065bdec13f2cf 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineSizesRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachinesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachinesRestOperations.cs index 7498b0c682a22..b73fbaea9e2f4 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachinesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachinesRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachinesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -850,7 +850,7 @@ internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resou /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// The name of the resource group. /// The name of the virtual machine. - /// Optional parameter to hibernate a virtual machine. (Feature in Preview). + /// Optional parameter to hibernate a virtual machine. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -876,7 +876,7 @@ public async Task DeallocateAsync(string subscriptionId, string resour /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// The name of the resource group. /// The name of the virtual machine. - /// Optional parameter to hibernate a virtual machine. (Feature in Preview). + /// Optional parameter to hibernate a virtual machine. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointCollection.cs index a1409486aec90..57f90a98b43d4 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointCollection.cs @@ -62,7 +62,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -111,7 +111,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -160,7 +160,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -206,7 +206,7 @@ public virtual async Task> GetAsync(string restor /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string restorePointName, Resto /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -296,7 +296,7 @@ public virtual async Task> ExistsAsync(string restorePointName, R /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -340,7 +340,7 @@ public virtual Response Exists(string restorePointName, RestorePointExpand /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupCollection.cs index 846b6473f2a1d..285fb9ca8b33e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(string r /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -260,7 +260,7 @@ public virtual Response Get(string restorePointGroupN /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -320,7 +320,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string restorePointGroupNa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -408,7 +408,7 @@ public virtual Response Exists(string restorePointGroupName, RestorePointG /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupResource.cs index ade5535b3ace6..0722cec7d663f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupResource.cs @@ -110,7 +110,7 @@ public virtual RestorePointCollection GetRestorePoints() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetRestorePointAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -174,7 +174,7 @@ public virtual Response GetRestorePoint(string restorePoin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> GetAsync(RestoreP /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(RestorePointGroupExpand? /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -298,7 +298,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -340,7 +340,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -382,7 +382,7 @@ public virtual async Task> UpdateAsync(Resto /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -424,7 +424,7 @@ public virtual Response Update(RestorePointGroupPatch /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -486,7 +486,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -548,7 +548,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -605,7 +605,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -662,7 +662,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -722,7 +722,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointResource.cs index a0dfe79c5edd4..96d839766abbe 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointResource.cs @@ -109,7 +109,7 @@ public virtual DiskRestorePointCollection GetDiskRestorePoints() /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> GetDiskRestorePoin /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -171,7 +171,7 @@ public virtual Response GetDiskRestorePoint(string dis /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(RestorePointE /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(RestorePointExpand? expand = n /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -295,7 +295,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -337,7 +337,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -383,7 +383,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotCollection.cs index 4c826c0fbb670..bf46295019427 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync(Wa /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string snapshotNa /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string snapshotName, CancellationT /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken can /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellationT /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string snapshotName, Cance /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string snapshotName, CancellationToken canc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsync(s /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotResource.cs index d2ea6fc743cbb..0cf569fa8f56e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationToke /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(WaitUntil /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Snapsh /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -405,7 +405,7 @@ public virtual async Task> GrantAccessAsync(WaitUntil wa /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -451,7 +451,7 @@ public virtual ArmOperation GrantAccess(WaitUntil waitUntil, GrantAcc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -493,7 +493,7 @@ public virtual async Task RevokeAccessAsync(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -535,7 +535,7 @@ public virtual ArmOperation RevokeAccess(WaitUntil waitUntil, CancellationToken /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -597,7 +597,7 @@ public virtual async Task> AddTagAsync(string key, st /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual Response AddTag(string key, string value, Cance /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -716,7 +716,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -773,7 +773,7 @@ public virtual Response SetTags(IDictionary ta /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -833,7 +833,7 @@ public virtual async Task> RemoveTagAsync(string key, /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyCollection.cs index 4489400b18f2d..c7f1c3b563993 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string sshPub /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string sshPublicKeyName, Cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string sshPublicKeyName, C /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string sshPublicKeyName, CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyResource.cs index 3971c1fe43c2c..53666c45338c2 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(SshPublicK /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual Response Update(SshPublicKeyPatch patch, Ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -394,7 +394,7 @@ public virtual async Task> GenerateK /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -433,7 +433,7 @@ public virtual Response GenerateKeyPair(SshGe /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -495,7 +495,7 @@ public virtual async Task> AddTagAsync(string key /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -557,7 +557,7 @@ public virtual Response AddTag(string key, string value, C /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -614,7 +614,7 @@ public virtual async Task> SetTagsAsync(IDictiona /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -671,7 +671,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -731,7 +731,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineCollection.cs index 565eb3cec043d..e0d03bff20a7a 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(string vmNa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -260,7 +260,7 @@ public virtual Response Get(string vmName, InstanceViewT /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -292,7 +292,7 @@ public virtual AsyncPageable GetAllAsync(string filter = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -324,7 +324,7 @@ public virtual Pageable GetAll(string filter = null, Get /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -368,7 +368,7 @@ public virtual async Task> ExistsAsync(string vmName, InstanceVie /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -412,7 +412,7 @@ public virtual Response Exists(string vmName, InstanceViewType? expand = n /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionCollection.cs index 1f731e7f0ebd8..3a4a8801e8de6 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateO /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string vmExtensionN /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(string expand = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> ExistsAsync(string vmExtensionName, st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string vmExtensionName, string expand = nul /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageCollection.cs index fd7bf6bdb16a4..d4bd17aaf9524 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageCollection.cs @@ -73,7 +73,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -120,7 +120,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual Response Get(string type, s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -196,7 +196,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -262,7 +262,7 @@ public virtual AsyncPageable GetAllAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -299,7 +299,7 @@ public virtual Pageable GetAll(string type /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -344,7 +344,7 @@ public virtual async Task> ExistsAsync(string type, string versio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -389,7 +389,7 @@ public virtual Response Exists(string type, string version, CancellationTo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -436,7 +436,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageResource.cs index 0a0254d169ddc..45c4be7074864 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionResource.cs index e2786223dd665..166e3281a3712 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(string expand = nul /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil wa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, stri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineResource.cs index 4efc50bb46b0d..11582832989df 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineResource.cs @@ -111,7 +111,7 @@ public virtual VirtualMachineExtensionCollection GetVirtualMachineExtensions() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetVirtualM /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual VirtualMachineRunCommandCollection GetVirtualMachineRunCommands() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetVirtual /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -246,7 +246,7 @@ public virtual Response GetVirtualMachineRunCo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual async Task> GetAsync(InstanceVie /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -328,7 +328,7 @@ public virtual Response Get(InstanceViewType? expand = n /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -371,7 +371,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -414,7 +414,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceDeletion = nu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -462,7 +462,7 @@ public virtual async Task> UpdateAsync(Wait /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -510,7 +510,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -556,7 +556,7 @@ public virtual async Task> CaptureAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -602,7 +602,7 @@ public virtual ArmOperation Capture(WaitUntil waitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -640,7 +640,7 @@ public virtual async Task> InstanceViewAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -678,7 +678,7 @@ public virtual Response InstanceView(CancellationTok /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -720,7 +720,7 @@ public virtual async Task ConvertToManagedDisksAsync(WaitUntil wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -762,7 +762,7 @@ public virtual ArmOperation ConvertToManagedDisks(WaitUntil waitUntil, Cancellat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -771,7 +771,7 @@ public virtual ArmOperation ConvertToManagedDisks(WaitUntil waitUntil, Cancellat /// /// /// 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. - /// Optional parameter to hibernate a virtual machine. (Feature in Preview). + /// Optional parameter to hibernate a virtual machine. /// The cancellation token to use. public virtual async Task DeallocateAsync(WaitUntil waitUntil, bool? hibernate = null, CancellationToken cancellationToken = default) { @@ -805,7 +805,7 @@ public virtual async Task DeallocateAsync(WaitUntil waitUntil, boo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -814,7 +814,7 @@ public virtual async Task DeallocateAsync(WaitUntil waitUntil, boo /// /// /// 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. - /// Optional parameter to hibernate a virtual machine. (Feature in Preview). + /// Optional parameter to hibernate a virtual machine. /// The cancellation token to use. public virtual ArmOperation Deallocate(WaitUntil waitUntil, bool? hibernate = null, CancellationToken cancellationToken = default) { @@ -848,7 +848,7 @@ public virtual ArmOperation Deallocate(WaitUntil waitUntil, bool? hibernate = nu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -886,7 +886,7 @@ public virtual async Task GeneralizeAsync(CancellationToken cancellati /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -924,7 +924,7 @@ public virtual Response Generalize(CancellationToken cancellationToken = default /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -953,7 +953,7 @@ public virtual AsyncPageable GetAvailableSizesAsync(Cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -982,7 +982,7 @@ public virtual Pageable GetAvailableSizes(CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1025,7 +1025,7 @@ public virtual async Task PowerOffAsync(WaitUntil waitUntil, bool? /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1068,7 +1068,7 @@ public virtual ArmOperation PowerOff(WaitUntil waitUntil, bool? skipShutdown = n /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1110,7 +1110,7 @@ public virtual async Task ReapplyAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1152,7 +1152,7 @@ public virtual ArmOperation Reapply(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1194,7 +1194,7 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1236,7 +1236,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1278,7 +1278,7 @@ public virtual async Task PowerOnAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1320,7 +1320,7 @@ public virtual ArmOperation PowerOn(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1362,7 +1362,7 @@ public virtual async Task RedeployAsync(WaitUntil waitUntil, Cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1404,7 +1404,7 @@ public virtual ArmOperation Redeploy(WaitUntil waitUntil, CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1447,7 +1447,7 @@ public virtual async Task ReimageAsync(WaitUntil waitUntil, Virtua /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1490,7 +1490,7 @@ public virtual ArmOperation Reimage(WaitUntil waitUntil, VirtualMachineReimageCo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1529,7 +1529,7 @@ public virtual async Task> RetrieveB /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1568,7 +1568,7 @@ public virtual Response RetrieveBootDiagnosti /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1610,7 +1610,7 @@ public virtual async Task PerformMaintenanceAsync(WaitUntil waitUn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1652,7 +1652,7 @@ public virtual ArmOperation PerformMaintenance(WaitUntil waitUntil, Cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1690,7 +1690,7 @@ public virtual async Task SimulateEvictionAsync(CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1728,7 +1728,7 @@ public virtual Response SimulateEviction(CancellationToken cancellationToken = d /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1770,7 +1770,7 @@ public virtual async Task> Asses /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1812,7 +1812,7 @@ public virtual ArmOperation AssessPatches(Wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1858,7 +1858,7 @@ public virtual async Task> Inst /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1904,7 +1904,7 @@ public virtual ArmOperation InstallPatches(W /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1950,7 +1950,7 @@ public virtual async Task> AttachDeta /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1996,7 +1996,7 @@ public virtual ArmOperation AttachDetachDataDisks( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2042,7 +2042,7 @@ public virtual async Task> RunComma /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2088,7 +2088,7 @@ public virtual ArmOperation RunCommand(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2150,7 +2150,7 @@ public virtual async Task> AddTagAsync(string k /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2212,7 +2212,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2269,7 +2269,7 @@ public virtual async Task> SetTagsAsync(IDictio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2326,7 +2326,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2386,7 +2386,7 @@ public virtual async Task> RemoveTagAsync(strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandCollection.cs index 4bf6938237df6..25e2de739a5d5 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string runCommandN /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(string expand = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string runCommandName, str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string runCommandName, string expand = null /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandResource.cs index 65adfa830f126..7713faaa9abfe 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(string expand = nu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetCollection.cs index 6b7cf36b8fa49..edd769bb5d4fd 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -260,7 +260,7 @@ public virtual Response Get(string virtualMachin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -320,7 +320,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string virtualMachineScale /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -408,7 +408,7 @@ public virtual Response Exists(string virtualMachineScaleSetName, VirtualM /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.Serialization.cs index d777953066473..920f6436ca2c3 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.Serialization.cs @@ -204,6 +204,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WritePropertyName("resiliencyPolicy"u8); writer.WriteObjectValue(ResiliencyPolicy, options); } + if (Optional.IsDefined(ZonalPlatformFaultDomainAlignMode)) + { + writer.WritePropertyName("zonalPlatformFaultDomainAlignMode"u8); + writer.WriteStringValue(ZonalPlatformFaultDomainAlignMode.Value.ToString()); + } + if (Optional.IsDefined(SkuProfile)) + { + writer.WritePropertyName("skuProfile"u8); + writer.WriteObjectValue(SkuProfile, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -276,6 +286,8 @@ internal static VirtualMachineScaleSetData DeserializeVirtualMachineScaleSetData DateTimeOffset? timeCreated = default; bool? constrainedMaximumCapacity = default; ResiliencyPolicy resiliencyPolicy = default; + ZonalPlatformFaultDomainAlignMode? zonalPlatformFaultDomainAlignMode = default; + ComputeSkuProfile skuProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -568,6 +580,24 @@ internal static VirtualMachineScaleSetData DeserializeVirtualMachineScaleSetData resiliencyPolicy = ResiliencyPolicy.DeserializeResiliencyPolicy(property0.Value, options); continue; } + if (property0.NameEquals("zonalPlatformFaultDomainAlignMode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zonalPlatformFaultDomainAlignMode = new ZonalPlatformFaultDomainAlignMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("skuProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + skuProfile = ComputeSkuProfile.DeserializeComputeSkuProfile(property0.Value, options); + continue; + } } continue; } @@ -611,6 +641,8 @@ internal static VirtualMachineScaleSetData DeserializeVirtualMachineScaleSetData timeCreated, constrainedMaximumCapacity, resiliencyPolicy, + zonalPlatformFaultDomainAlignMode, + skuProfile, serializedAdditionalRawData); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.cs index be377c04905e8..a718cc43b4439 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.cs @@ -69,7 +69,7 @@ public VirtualMachineScaleSetData(AzureLocation location) : base(location) /// The virtual machine scale set sku. /// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. /// The identity of the virtual machine scale set, if configured. - /// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set. + /// The virtual machine scale set zones. /// The extended location of the Virtual Machine Scale Set. /// Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header to ensure optimistic updates. /// The upgrade policy. @@ -93,8 +93,10 @@ public VirtualMachineScaleSetData(AzureLocation location) : base(location) /// Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. /// Optional property which must either be set to True or omitted. /// Policy for Resiliency. + /// Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. + /// Specifies the sku profile for the virtual machine scale set. /// Keeps track of any properties unknown to the library. - internal VirtualMachineScaleSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, IList zones, ExtendedLocation extendedLocation, string etag, VirtualMachineScaleSetUpgradePolicy upgradePolicy, ScheduledEventsPolicy scheduledEventsPolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, WritableSubResource proximityPlacementGroup, WritableSubResource hostGroup, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, OrchestrationMode? orchestrationMode, SpotRestorePolicy spotRestorePolicy, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained, ResiliencyPolicy resiliencyPolicy, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal VirtualMachineScaleSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, IList zones, ExtendedLocation extendedLocation, string etag, VirtualMachineScaleSetUpgradePolicy upgradePolicy, ScheduledEventsPolicy scheduledEventsPolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, WritableSubResource proximityPlacementGroup, WritableSubResource hostGroup, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, OrchestrationMode? orchestrationMode, SpotRestorePolicy spotRestorePolicy, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained, ResiliencyPolicy resiliencyPolicy, ZonalPlatformFaultDomainAlignMode? zonalPlatformFaultDomainAlignMode, ComputeSkuProfile skuProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Plan = plan; @@ -123,6 +125,8 @@ internal VirtualMachineScaleSetData(ResourceIdentifier id, string name, Resource TimeCreated = timeCreated; IsMaximumCapacityConstrained = isMaximumCapacityConstrained; ResiliencyPolicy = resiliencyPolicy; + ZonalPlatformFaultDomainAlignMode = zonalPlatformFaultDomainAlignMode; + SkuProfile = skuProfile; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -137,7 +141,7 @@ internal VirtualMachineScaleSetData() public ComputePlan Plan { get; set; } /// The identity of the virtual machine scale set, if configured. public ManagedServiceIdentity Identity { get; set; } - /// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set. + /// The virtual machine scale set zones. public IList Zones { get; } /// The extended location of the Virtual Machine Scale Set. public ExtendedLocation ExtendedLocation { get; set; } @@ -209,5 +213,9 @@ public ResourceIdentifier HostGroupId public bool? IsMaximumCapacityConstrained { get; set; } /// Policy for Resiliency. public ResiliencyPolicy ResiliencyPolicy { get; set; } + /// Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. + public ZonalPlatformFaultDomainAlignMode? ZonalPlatformFaultDomainAlignMode { get; set; } + /// Specifies the sku profile for the virtual machine scale set. + public ComputeSkuProfile SkuProfile { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionCollection.cs index 6765f5b4444bf..dbb48d66abd30 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string vmss /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(Cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> ExistsAsync(string vmssExtensionName, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string vmssExtensionName, string expand = n /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionResource.cs index 280324ab3e9a0..c817a93af9657 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(string expa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetResource.cs index 944e014e6c108..d242f8dfbbaad 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetResource.cs @@ -116,7 +116,7 @@ public virtual VirtualMachineScaleSetExtensionCollection GetVirtualMachineScaleS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -194,7 +194,7 @@ public virtual VirtualMachineScaleSetVmCollection GetVirtualMachineScaleSetVms() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task> GetVirtual /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -258,7 +258,7 @@ public virtual Response GetVirtualMachineScale /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -299,7 +299,7 @@ public virtual async Task> GetAsync(Vir /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -340,7 +340,7 @@ public virtual Response Get(VirtualMachineScaleS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -383,7 +383,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -426,7 +426,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceDeletion = nu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -474,7 +474,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -522,7 +522,7 @@ public virtual ArmOperation Update(WaitUntil wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -566,7 +566,7 @@ public virtual async Task DeallocateAsync(WaitUntil waitUntil, Vir /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -610,7 +610,7 @@ public virtual ArmOperation Deallocate(WaitUntil waitUntil, VirtualMachineScaleS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task DeleteInstancesAsync(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -704,7 +704,7 @@ public virtual ArmOperation DeleteInstances(WaitUntil waitUntil, VirtualMachineS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> GetInsta /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -780,7 +780,7 @@ public virtual Response GetInstanceView(Canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -810,7 +810,7 @@ public virtual AsyncPageable GetSkusAsync(Cancellatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -840,7 +840,7 @@ public virtual Pageable GetSkus(CancellationToken can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -870,7 +870,7 @@ public virtual AsyncPageable GetOSUpgradeH /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -900,7 +900,7 @@ public virtual Pageable GetOSUpgradeHistor /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -944,7 +944,7 @@ public virtual async Task PowerOffAsync(WaitUntil waitUntil, Virtu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -988,7 +988,7 @@ public virtual ArmOperation PowerOff(WaitUntil waitUntil, VirtualMachineScaleSet /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1031,7 +1031,7 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Virtua /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1074,7 +1074,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, VirtualMachineScaleSetV /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1117,7 +1117,7 @@ public virtual async Task PowerOnAsync(WaitUntil waitUntil, Virtua /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1160,7 +1160,7 @@ public virtual ArmOperation PowerOn(WaitUntil waitUntil, VirtualMachineScaleSetV /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1202,7 +1202,7 @@ public virtual async Task ReapplyAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1244,7 +1244,7 @@ public virtual ArmOperation Reapply(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1287,7 +1287,7 @@ public virtual async Task RedeployAsync(WaitUntil waitUntil, Virtu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1330,7 +1330,7 @@ public virtual ArmOperation Redeploy(WaitUntil waitUntil, VirtualMachineScaleSet /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1373,7 +1373,7 @@ public virtual async Task PerformMaintenanceAsync(WaitUntil waitUn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1416,7 +1416,7 @@ public virtual ArmOperation PerformMaintenance(WaitUntil waitUntil, VirtualMachi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1462,7 +1462,7 @@ public virtual async Task UpdateInstancesAsync(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1508,7 +1508,7 @@ public virtual ArmOperation UpdateInstances(WaitUntil waitUntil, VirtualMachineS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1551,7 +1551,7 @@ public virtual async Task ReimageAsync(WaitUntil waitUntil, Virtua /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1594,7 +1594,7 @@ public virtual ArmOperation Reimage(WaitUntil waitUntil, VirtualMachineScaleSetR /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1637,7 +1637,7 @@ public virtual async Task ReimageAllAsync(WaitUntil waitUntil, Vir /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1680,7 +1680,7 @@ public virtual ArmOperation ReimageAll(WaitUntil waitUntil, VirtualMachineScaleS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1723,7 +1723,7 @@ public virtual async Task ApproveRollingUpgradeAsync(WaitUntil wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1766,7 +1766,7 @@ public virtual ArmOperation ApproveRollingUpgrade(WaitUntil waitUntil, VirtualMa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1807,7 +1807,7 @@ public virtual async Task> ForceRecoveryServiceFa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1848,7 +1848,7 @@ public virtual Response ForceRecoveryServiceFabricPlatform /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1890,7 +1890,7 @@ public virtual async Task ConvertToSinglePlacementGroupAsync(VirtualMa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1932,7 +1932,7 @@ public virtual Response ConvertToSinglePlacementGroup(VirtualMachineScaleSetConv /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1978,7 +1978,7 @@ public virtual async Task SetOrchestrationServiceStateAsync(WaitUn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2024,7 +2024,7 @@ public virtual ArmOperation SetOrchestrationServiceState(WaitUntil waitUntil, Or /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2066,7 +2066,7 @@ public virtual async Task CancelVirtualMachineScaleSetRollingUpgra /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2108,7 +2108,7 @@ public virtual ArmOperation CancelVirtualMachineScaleSetRollingUpgrade(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2150,7 +2150,7 @@ public virtual async Task StartOSUpgradeAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2192,7 +2192,7 @@ public virtual ArmOperation StartOSUpgrade(WaitUntil waitUntil, CancellationToke /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2234,7 +2234,7 @@ public virtual async Task StartExtensionUpgradeVirtualMachineScale /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2276,7 +2276,7 @@ public virtual ArmOperation StartExtensionUpgradeVirtualMachineScaleSetRollingUp /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2338,7 +2338,7 @@ public virtual async Task> AddTagAsync( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2400,7 +2400,7 @@ public virtual Response AddTag(string key, strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2457,7 +2457,7 @@ public virtual async Task> SetTagsAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2514,7 +2514,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2574,7 +2574,7 @@ public virtual async Task> RemoveTagAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetRollingUpgradeResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetRollingUpgradeResource.cs index 97c4ed0949769..5cbfe6b8a9411 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetRollingUpgradeResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetRollingUpgradeResource.cs @@ -100,7 +100,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmCollection.cs index 51e6b4628a68b..070f900f0c1d6 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(string instanceId, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -292,7 +292,7 @@ public virtual AsyncPageable GetAllAsync(strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -325,7 +325,7 @@ public virtual Pageable GetAll(string filter = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -369,7 +369,7 @@ public virtual async Task> ExistsAsync(string instanceId, Instanc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -413,7 +413,7 @@ public virtual Response Exists(string instanceId, InstanceViewType? expand /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -459,7 +459,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmData.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmData.cs index cab2e26d9ea3a..433eb36304db7 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmData.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmData.cs @@ -90,8 +90,8 @@ public VirtualMachineScaleSetVmData(AzureLocation location) : base(location) /// Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15. /// Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. /// Specifies the protection policy of the virtual machine. - /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01. - /// Specifies the time at which the Virtual Machine resource was created.<br><br>Minimum api-version: 2021-11-01. + /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. + /// Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. /// Keeps track of any properties unknown to the library. internal VirtualMachineScaleSetVmData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string instanceId, ComputeSku sku, ComputePlan plan, IReadOnlyList resources, IReadOnlyList zones, ManagedServiceIdentity identity, string etag, bool? latestModelApplied, string vmId, VirtualMachineScaleSetVmInstanceView instanceView, VirtualMachineHardwareProfile hardwareProfile, VirtualMachineStorageProfile storageProfile, AdditionalCapabilities additionalCapabilities, VirtualMachineOSProfile osProfile, SecurityProfile securityProfile, VirtualMachineNetworkProfile networkProfile, VirtualMachineScaleSetVmNetworkProfileConfiguration networkProfileConfiguration, DiagnosticsProfile diagnosticsProfile, WritableSubResource availabilitySet, string provisioningState, string licenseType, string modelDefinitionApplied, VirtualMachineScaleSetVmProtectionPolicy protectionPolicy, string userData, DateTimeOffset? timeCreated, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { @@ -209,9 +209,9 @@ public ResourceIdentifier AvailabilitySetId public string ModelDefinitionApplied { get; } /// Specifies the protection policy of the virtual machine. public VirtualMachineScaleSetVmProtectionPolicy ProtectionPolicy { get; set; } - /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01. + /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. public string UserData { get; set; } - /// Specifies the time at which the Virtual Machine resource was created.<br><br>Minimum api-version: 2021-11-01. + /// Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. public DateTimeOffset? TimeCreated { get; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionCollection.cs index 86a7e9e99c90f..4d49e30808cb6 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string vm /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> ExistsAsync(string vmExtensionName, st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string vmExtensionName, string expand = nul /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionResource.cs index 7f43a04d52855..0f1fbe1ca699d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(string ex /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmResource.cs index de547cf1916ce..58ab3d17dd77c 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmResource.cs @@ -110,7 +110,7 @@ public virtual VirtualMachineScaleSetVmExtensionCollection GetVirtualMachineScal /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual VirtualMachineScaleSetVmRunCommandCollection GetVirtualMachineSca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -245,7 +245,7 @@ public virtual Response GetVirtualMa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual async Task> GetAsync(I /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -327,7 +327,7 @@ public virtual Response Get(InstanceViewType? /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -370,7 +370,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -413,7 +413,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceDeletion = nu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -461,7 +461,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -509,7 +509,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -552,7 +552,7 @@ public virtual async Task ReimageAsync(WaitUntil waitUntil, Virtua /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -595,7 +595,7 @@ public virtual ArmOperation Reimage(WaitUntil waitUntil, VirtualMachineScaleSetV /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -637,7 +637,7 @@ public virtual async Task ReimageAllAsync(WaitUntil waitUntil, Can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -679,7 +679,7 @@ public virtual ArmOperation ReimageAll(WaitUntil waitUntil, CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -721,7 +721,7 @@ public virtual async Task ApproveRollingUpgradeAsync(WaitUntil wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -763,7 +763,7 @@ public virtual ArmOperation ApproveRollingUpgrade(WaitUntil waitUntil, Cancellat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -805,7 +805,7 @@ public virtual async Task DeallocateAsync(WaitUntil waitUntil, Can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -847,7 +847,7 @@ public virtual ArmOperation Deallocate(WaitUntil waitUntil, CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -885,7 +885,7 @@ public virtual async Task> GetIns /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -923,7 +923,7 @@ public virtual Response GetInstanceView(Ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -966,7 +966,7 @@ public virtual async Task PowerOffAsync(WaitUntil waitUntil, bool? /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1009,7 +1009,7 @@ public virtual ArmOperation PowerOff(WaitUntil waitUntil, bool? skipShutdown = n /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1051,7 +1051,7 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1093,7 +1093,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1135,7 +1135,7 @@ public virtual async Task PowerOnAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1177,7 +1177,7 @@ public virtual ArmOperation PowerOn(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1219,7 +1219,7 @@ public virtual async Task RedeployAsync(WaitUntil waitUntil, Cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1261,7 +1261,7 @@ public virtual ArmOperation Redeploy(WaitUntil waitUntil, CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1300,7 +1300,7 @@ public virtual async Task> RetrieveB /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1339,7 +1339,7 @@ public virtual Response RetrieveBootDiagnosti /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1381,7 +1381,7 @@ public virtual async Task PerformMaintenanceAsync(WaitUntil waitUn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1423,7 +1423,7 @@ public virtual ArmOperation PerformMaintenance(WaitUntil waitUntil, Cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1461,7 +1461,7 @@ public virtual async Task SimulateEvictionAsync(CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1499,7 +1499,7 @@ public virtual Response SimulateEviction(CancellationToken cancellationToken = d /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1545,7 +1545,7 @@ public virtual async Task> AttachDeta /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1591,7 +1591,7 @@ public virtual ArmOperation AttachDetachDataDisks( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1637,7 +1637,7 @@ public virtual async Task> RunComma /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1683,7 +1683,7 @@ public virtual ArmOperation RunCommand(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1740,7 +1740,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1797,7 +1797,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1853,7 +1853,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1909,7 +1909,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1964,7 +1964,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandCollection.cs index b8cd173f63b86..11454781e3b16 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string r /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string runCommandName, str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string runCommandName, string expand = null /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandResource.cs index 35a0d64c8a940..ac49ad5d03c2d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -186,7 +186,7 @@ public virtual Response Get(string e /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -228,7 +228,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual ArmOperation Update(W /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -424,7 +424,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -486,7 +486,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -543,7 +543,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -600,7 +600,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -660,7 +660,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md b/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md index 8da64715947c4..f4a13219b07ec 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md +++ b/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md @@ -10,7 +10,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: Compute namespace: Azure.ResourceManager.Compute -require: https://github.com/Azure/azure-rest-api-specs/blob/4e44971c375e4dbb03b75f8c6b91d0bd225f247d/specification/compute/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/4f68529971f845e8757c2b2a746d78ceb91854cd/specification/compute/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -266,7 +266,6 @@ rename-mapping: ScheduledEventsProfile: ComputeScheduledEventsProfile ExpandTypeForListVMs: GetVirtualMachineExpandType ExpandTypesForListVm: GetVirtualMachineExpandType - SecurityPostureReference: ComputeSecurityPostureReference RestorePointSourceVmStorageProfile.dataDisks: DataDiskList SecurityPostureReference.id: -|arm-id CommunityGalleryImage.properties.identifier: ImageIdentifier @@ -277,6 +276,11 @@ rename-mapping: NetworkInterfaceAuxiliaryMode: ComputeNetworkInterfaceAuxiliaryMode CommunityGalleryInfo.publisherUri: PublisherUriString GalleryArtifactVersionFullSource.virtualMachineId: -|arm-id + SecurityPostureReference: ComputeSecurityPostureReference + SecurityPostureReference.excludeExtensions: ExcludeExtensionNames + SkuProfile : ComputeSkuProfile + SkuProfileVMSize : ComputeSkuProfileVMSize + AllocationStrategy : ComputeAllocationStrategy directive: # copy the systemData from common-types here so that it will be automatically replaced diff --git a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskCollectionTests.cs b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskCollectionTests.cs index 529ad3e1be9e7..2c176383b6547 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskCollectionTests.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskCollectionTests.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Compute.Tests { - [ClientTestFixture(true, "2022-07-02", "2021-04-01", "2019-07-01")] + [ClientTestFixture(true, "2024-03-02", "2022-07-02", "2021-04-01", "2019-07-01")] public class ManagedDiskCollectionTests : ComputeTestBase { public ManagedDiskCollectionTests(bool isAsync, string apiVersion) diff --git a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskOperationsTests.cs b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskOperationsTests.cs index 95ad9d63c5c61..03ad6425f1011 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskOperationsTests.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskOperationsTests.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Compute.Tests { - [ClientTestFixture(true, "2022-07-02", "2021-04-01", "2019-07-01")] + [ClientTestFixture(true, "2024-03-02", "2022-07-02", "2021-04-01", "2019-07-01")] public class ManagedDiskOperationsTests : ComputeTestBase { public ManagedDiskOperationsTests(bool isAsync, string apiVersion) From 90deda5c59bc4e0db7f69823f37e68ea4d365069 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 27 Aug 2024 00:43:36 -0700 Subject: [PATCH 33/71] Increment version for compute releases (#45685) --- sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md | 10 ++++++++++ .../src/Azure.ResourceManager.Compute.csproj | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md b/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md index 85ac476801721..8ed448e95d6de 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md +++ b/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.7.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.6.0 (2024-08-26) ### Features Added diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj b/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj index 1da48e78a4b0b..a3e572f2526f4 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj @@ -1,8 +1,8 @@ - 1.6.0 + 1.7.0-beta.1 - 1.5.0 + 1.6.0 Azure.ResourceManager.Compute Microsoft Azure management client SDK for Azure resource provider Microsoft.Compute. azure;management;compute From 669ea53427f57f49661f6747462eaaeecdfcbb63 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 27 Aug 2024 01:00:48 -0700 Subject: [PATCH 34/71] Update AutoRest C# version to 3.0.0-beta.20240826.5 (#45686) --- eng/Packages.Data.props | 2 +- eng/emitter-package-lock.json | 30 +++++++++++++++--------------- eng/emitter-package.json | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 0261171b2f476..c136e82bb36f1 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -227,7 +227,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 02f43e4a6f25f..07af6b875d706 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240818.1" + "@azure-tools/typespec-csharp": "0.2.0-beta.20240826.5" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.45.0", @@ -22,9 +22,9 @@ } }, "node_modules/@autorest/csharp": { - "version": "3.0.0-beta.20240818.1", - "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240818.1.tgz", - "integrity": "sha512-Mne78KvgVuPFP8LPB+jnVeFQ2Q6yfBZUpRD9Mbac9vCiP/jxcF0GHLaj3if+WRyB/meZOnn2CECD8v/CWnsWvw==" + "version": "3.0.0-beta.20240826.5", + "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240826.5.tgz", + "integrity": "sha512-a8ZaKPrnhqk8CPkn+uwVPIxCVdGygj8JsTHbqT1Q9Ilo3FjW3XiR+nr/L/Bk1IY03kM1+Xcq6w7QV6F1e6nXzQ==" }, "node_modules/@azure-tools/typespec-autorest": { "version": "0.45.0", @@ -117,12 +117,12 @@ } }, "node_modules/@azure-tools/typespec-csharp": { - "version": "0.2.0-beta.20240818.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240818.1.tgz", - "integrity": "sha512-gqDVxYwq944B0waiQDI9OEV+hmsLFlfXdjPggKRb6tZXgDrVHw8PgraXFmZUtnk7djXbvazECNQ/tI2yuUz8DQ==", + "version": "0.2.0-beta.20240826.5", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240826.5.tgz", + "integrity": "sha512-nIxClHrtj8jCbtA+mN8vl2E2BMZnsUW5vSMLjCkrIOMcKWi3uivtJsNgnSsS3DjjsnaRut5gq++3wKte8NURug==", "dependencies": { - "@autorest/csharp": "3.0.0-beta.20240818.1", - "@typespec/http-client-csharp": "0.1.9-alpha.20240815.3", + "@autorest/csharp": "3.0.0-beta.20240826.5", + "@typespec/http-client-csharp": "0.1.9-alpha.20240826.1", "json-serialize-refs": "0.1.0-0" }, "peerDependencies": { @@ -265,9 +265,9 @@ } }, "node_modules/@typespec/http-client-csharp": { - "version": "0.1.9-alpha.20240815.3", - "resolved": "https://registry.npmjs.org/@typespec/http-client-csharp/-/http-client-csharp-0.1.9-alpha.20240815.3.tgz", - "integrity": "sha512-YD+sl67JvENY+oGk/2Pqz1yMkklq62WW3bvRQwwCvckt3Cc6a+GEmovbF+VkgRbizxU48nmSbR61tZ5oJ56gUA==", + "version": "0.1.9-alpha.20240826.1", + "resolved": "https://registry.npmjs.org/@typespec/http-client-csharp/-/http-client-csharp-0.1.9-alpha.20240826.1.tgz", + "integrity": "sha512-i3XM4DXan5WKl/SNAFgyYEAyHXt51diQrMyR7TvCOCte6MJgYM1ilH66pV8AlhDCLscGXzIprurwX6hd7qmSUA==", "dependencies": { "json-serialize-refs": "0.1.0-0" }, @@ -636,9 +636,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { "braces": "^3.0.3", diff --git a/eng/emitter-package.json b/eng/emitter-package.json index a637f39a45e39..64cb0e292c135 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,7 +1,7 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240818.1" + "@azure-tools/typespec-csharp": "0.2.0-beta.20240826.5" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.45.0", From 4054d330949e895f932cab781e232e0b4d07c51d Mon Sep 17 00:00:00 2001 From: Timothy Mothra Date: Tue, 27 Aug 2024 14:45:47 -0700 Subject: [PATCH 35/71] [AzureMonitorDistro] fix log forwarder tests (#45681) * poc * saving wip * cleanup * cleanup * disable one failing test * cleanup * update AzureEventSourceLogForwarder to exclude CustomEvents * upgade comment --- .../AzureEventSourceLogForwarder.cs | 5 +- .../AzureSdkLoggingTests.cs | 245 ++++++++++-------- 2 files changed, 145 insertions(+), 105 deletions(-) diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs index e8d1f476644a5..c4c970cdfe98e 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs @@ -30,8 +30,9 @@ public AzureEventSourceLogForwarder(ILoggerFactory loggerFactory, LoggerFilterOp foreach (var rule in loggerFilterOptions?.Rules ?? Enumerable.Empty()) { - if (!string.IsNullOrEmpty(rule.CategoryName) && - (rule.CategoryName.StartsWith("Azure.") || rule.CategoryName.StartsWith("Microsoft.Azure."))) + if (!string.IsNullOrEmpty(rule.CategoryName) + && rule.CategoryName != "Azure.Monitor.OpenTelemetry.CustomEvents" // Exporter defines a custom filter rule to support CustomEvents. We MUST ignore this here. + && (rule.CategoryName.StartsWith("Azure.") || rule.CategoryName.StartsWith("Microsoft.Azure."))) { _hasAzureLoggerFilterOptionsRules = true; } diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs index c2c5fd0e6e786..bced439dd7ccc 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs @@ -11,18 +11,19 @@ using System.Threading.Tasks; using Azure.Core.Diagnostics; using Azure.Core.TestFramework; -using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Xunit; -using static Xunit.CustomXunitAttributes; namespace Azure.Monitor.OpenTelemetry.AspNetCore.Tests { public class AzureSdkLoggingTests { - [Theory(Skip = "Test is unstable and need to be re-written without the need to create a web server.")] + private readonly MockTransport _mockTransport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); + + [Theory] [InlineData(false, LogLevel.Debug, null)] [InlineData(false, LogLevel.Information, null)] [InlineData(false, LogLevel.Warning, "TestWarningEvent: hello")] @@ -31,181 +32,203 @@ public class AzureSdkLoggingTests [InlineData(true, LogLevel.Debug, "TestVerboseEvent: hello")] public async Task DistroLogForwarderIsAdded(bool addLoggingFilter, LogLevel eventLevel, string expectedMessage) { - var builder = WebApplication.CreateBuilder(); + // SETUP + var serviceCollection = new ServiceCollection(); using TestEventSource source = new TestEventSource(addLoggingFilter ? "Azure-LoggingFilter" : "Azure-Test"); - if (addLoggingFilter) + SetUpOTelAndLogging(serviceCollection, _mockTransport, LogLevel.Information, (loggingBuilder) => { - builder.Logging.AddFilter(source.Name.Replace('-', '.'), eventLevel); - } - var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); - SetUpOTelAndLogging(builder, transport, LogLevel.Information); + if (addLoggingFilter) + { + loggingBuilder.AddFilter(source.Name.Replace('-', '.'), eventLevel); + } + }); + + using var serviceProvider = serviceCollection.BuildServiceProvider(); - using var app = builder.Build(); - await app.StartAsync(); + // We must manually start any IHostedServices. This includes the AzureLogForwarder. + // In a normal app, Microsoft.Extensions.Hosting would handle this. + await StartHostedServicesAsync(serviceProvider); + // ACT Assert.True(source.IsEnabled()); source.LogMessage("hello", eventLevel); - WaitForRequest(transport); + WaitForRequest(_mockTransport); + + // ASSERT if (expectedMessage != null) { - Assert.Single(transport.Requests); - await AssertContentContains(transport.Requests.Single(), expectedMessage, eventLevel); + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), expectedMessage, eventLevel); } else { - await AssertContentDoesNotContain(transport.Requests, "hello"); + await AssertContentDoesNotContain(_mockTransport.Requests, "hello"); } } - [Theory(Skip = "Test is unstable and need to be re-written without the need to create a web server.")] + [Theory] [InlineData(LogLevel.Information, "TestInfoEvent: hello")] [InlineData(LogLevel.Warning, "TestWarningEvent: hello")] [InlineData(LogLevel.Debug, null)] public async Task PublicLogForwarderIsAdded(LogLevel eventLevel, string expectedMessage) { - var builder = WebApplication.CreateBuilder(); - var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); - SetUpOTelAndLogging(builder, transport, LogLevel.Information); + // SETUP + var serviceCollection = new ServiceCollection(); + SetUpOTelAndLogging(serviceCollection, _mockTransport, LogLevel.Information); - builder.Services.TryAddSingleton(); - using var app = builder.Build(); + serviceCollection.TryAddSingleton(); - Microsoft.Extensions.Azure.AzureEventSourceLogForwarder publicLogForwarder = - app.Services.GetRequiredService(); + using var serviceProvider = serviceCollection.BuildServiceProvider(); - Assert.NotNull(publicLogForwarder); - publicLogForwarder.Start(); - - await app.StartAsync(); + var logForwarder = serviceProvider.GetRequiredService(); + Assert.NotNull(logForwarder); + logForwarder.Start(); + // ACT using TestEventSource source = new TestEventSource("Azure-Test"); Assert.True(source.IsEnabled()); source.LogMessage("hello", eventLevel); + WaitForRequest(_mockTransport); - WaitForRequest(transport); + // ASSERT if (expectedMessage != null) { - Assert.Single(transport.Requests); - await AssertContentContains(transport.Requests.Single(), expectedMessage, eventLevel); + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), expectedMessage, eventLevel); } else { - await AssertContentDoesNotContain(transport.Requests, "hello"); + await AssertContentDoesNotContain(_mockTransport.Requests, "hello"); } } - [Fact(Skip = "Test is unstable and need to be re-written without the need to create a web server.")] - public async Task SelfDiagnosticsIsDisabled() + [Fact] + public void SelfDiagnosticsIsDisabled() { + // SETUP + bool logAzureFilterCalled = false; var enableLevel = LogLevel.Debug; - var builder = WebApplication.CreateBuilder(); - var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); - builder.Logging.ClearProviders(); - bool logAzureFilterCalled = false; - builder.Logging.AddFilter((name, level) => + var serviceCollection = new ServiceCollection(); + + serviceCollection.AddLogging(loggingBuilder => { - if (name != null && name.StartsWith("Azure")) + loggingBuilder.ClearProviders(); + loggingBuilder.AddFilter((name, level) => { - logAzureFilterCalled = true; - return level >= enableLevel; - } - return false; + if (name != null && name.StartsWith("Azure")) + { + logAzureFilterCalled = true; + return level >= enableLevel; + } + return false; + }); }); - builder.Services.AddOpenTelemetry().UseAzureMonitor(config => + + serviceCollection.AddOpenTelemetry().UseAzureMonitor(config => { - config.Transport = transport; - config.ConnectionString = $"InstrumentationKey={Guid.NewGuid()}"; + config.Transport = _mockTransport; + config.ConnectionString = $"InstrumentationKey={nameof(SelfDiagnosticsIsDisabled)}"; config.EnableLiveMetrics = true; Assert.False(config.Diagnostics.IsLoggingEnabled); Assert.False(config.Diagnostics.IsDistributedTracingEnabled); }); - using var app = builder.Build(); - await app.StartAsync(); + using var serviceProvider = serviceCollection.BuildServiceProvider(); + // ASSERT // let's get some live metric requests first to check that no logs were recorded for them - WaitForRequest(transport, r => r.Uri.Host == "rt.services.visualstudio.com"); + var liveMetricsRequests = WaitForRequest(_mockTransport, r => r.Uri.Host == "rt.services.visualstudio.com"); + Assert.Empty(liveMetricsRequests); // now let's wait for track requests - var trackRequests = WaitForRequest(transport, r => r.Uri.Host == "dc.services.visualstudio.com"); - Assert.Empty(trackRequests); + var breezeTrackRequests = WaitForRequest(_mockTransport, r => r.Uri.Host == "dc.services.visualstudio.com"); + Assert.Empty(breezeTrackRequests); // since LiveMetrics logging is disabled, we shouldn't even have logging policy trying to log anything. Assert.False(logAzureFilterCalled); } - [Fact(Skip = "Test is unstable and need to be re-written without the need to create a web server.")] + [Fact] public async Task DistroLogForwarderAppliesWildCardFilter() { - var builder = WebApplication.CreateBuilder(); - builder.Logging.AddFilter("Azure.*", LogLevel.Warning); - - var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); - SetUpOTelAndLogging(builder, transport, LogLevel.Information); - - using var app = builder.Build(); - await app.StartAsync(); + // SETUP + var serviceCollection = new ServiceCollection(); + SetUpOTelAndLogging(serviceCollection, _mockTransport, LogLevel.Information, (loggingBuilder) => loggingBuilder.AddFilter("Azure.*", LogLevel.Warning)); + using var serviceProvider = serviceCollection.BuildServiceProvider(); + + // We must manually start any IHostedServices. This includes the AzureLogForwarder. + // In a normal app, Microsoft.Extensions.Hosting would handle this. + var hostedServices = serviceProvider.GetServices(); + foreach (var hostedService in hostedServices) + { + await hostedService.StartAsync(CancellationToken.None); + } + // ACT using TestEventSource source = new TestEventSource("Azure-Test"); Assert.True(source.IsEnabled()); source.LogMessage("hello", LogLevel.Warning); - WaitForRequest(transport); + WaitForRequest(_mockTransport); - Assert.Single(transport.Requests); - await AssertContentContains(transport.Requests.Single(), "TestWarningEvent: hello", LogLevel.Warning); + // ASSERT + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), "TestWarningEvent: hello", LogLevel.Warning); } - [Fact(Skip = "Test is unstable and need to be re-written without the need to create a web server.")] + [Fact] public async Task SettingCustomLoggingFilterResetsDefaultWarningLevel() { - var builder = WebApplication.CreateBuilder(); - // Even when a single custom filter is set, it should reset the default warning level. - builder.Logging.AddFilter("Azure.One", LogLevel.Information); - - var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); - SetUpOTelAndLogging(builder, transport, LogLevel.Information); + // SETUP + var serviceCollection = new ServiceCollection(); + SetUpOTelAndLogging(serviceCollection, _mockTransport, LogLevel.Information, (loggingBuilder) => loggingBuilder.AddFilter("Azure.One", LogLevel.Information)); + using var serviceProvider = serviceCollection.BuildServiceProvider(); - using var app = builder.Build(); - await app.StartAsync(); + // We must manually start any IHostedServices. This includes the AzureLogForwarder. + // In a normal app, Microsoft.Extensions.Hosting would handle this. + await StartHostedServicesAsync(serviceProvider); + // ACT 1 // Azure-One is added as a logging filter, the default warning level is reset. // Informational-level logs from Azure-One sources are collected. using TestEventSource source1 = new TestEventSource("Azure-One"); Assert.True(source1.IsEnabled()); + // ASSERT 1 source1.LogMessage("hello one", LogLevel.Information); - WaitForRequest(transport); - Assert.Single(transport.Requests); - await AssertContentContains(transport.Requests.Single(), "TestInfoEvent: hello one", LogLevel.Information); - transport.Requests.Clear(); + WaitForRequest(_mockTransport); + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), "TestInfoEvent: hello one", LogLevel.Information); + _mockTransport.Requests.Clear(); + // ACT 2 // Azure-Two is not part of the logging filter. // Since the logging filter is customized for the Azure SDK, the default warning level is reset. // Informational-level logs from Azure-Two sources are collected. using TestEventSource source2 = new TestEventSource("Azure-Two"); Assert.True(source2.IsEnabled()); + // ASSERT 2 source2.LogMessage("hello two", LogLevel.Information); - WaitForRequest(transport); - Assert.Single(transport.Requests); - await AssertContentContains(transport.Requests.Single(), "TestInfoEvent: hello two", LogLevel.Information); + WaitForRequest(_mockTransport); + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), "TestInfoEvent: hello two", LogLevel.Information); } - [Fact(Skip = "Test is unstable and need to be re-written without the need to create a web server.")] + [Fact] public async Task CustomLoggingFilterOverridesDefaultWarningAndCapturesErrorLogs() { - var builder = WebApplication.CreateBuilder(); - // Even when a single custom filter is set, it should reset the default warning level. - builder.Logging.AddFilter("Azure.One", LogLevel.Error); - - var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); - SetUpOTelAndLogging(builder, transport, LogLevel.Information); + // SETUP + var serviceCollection = new ServiceCollection(); + SetUpOTelAndLogging(serviceCollection, _mockTransport, LogLevel.Information, (loggingBuilder) => loggingBuilder.AddFilter("Azure.One", LogLevel.Error)); + using var serviceProvider = serviceCollection.BuildServiceProvider(); - using var app = builder.Build(); - await app.StartAsync(); + // We must manually start any IHostedServices. This includes the AzureLogForwarder. + // In a normal app, Microsoft.Extensions.Hosting would handle this. + await StartHostedServicesAsync(serviceProvider); + // ACT using TestEventSource source1 = new TestEventSource("Azure-One"); Assert.True(source1.IsEnabled()); @@ -214,19 +237,21 @@ public async Task CustomLoggingFilterOverridesDefaultWarningAndCapturesErrorLogs source1.LogMessage("Hello Debug", LogLevel.Debug); source1.LogMessage("Hello Warning", LogLevel.Warning); source1.LogMessage("Hello Error", LogLevel.Error); - WaitForRequest(transport); - Assert.Single(transport.Requests); - await AssertContentContains(transport.Requests.Single(), "TestErrorEvent: Hello Error", LogLevel.Error); + WaitForRequest(_mockTransport); + + // ASSERT + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), "TestErrorEvent: Hello Error", LogLevel.Error); // Azure-Two is not part of the logging filter, it should capture all logs. using TestEventSource source2 = new TestEventSource("Azure-Two"); Assert.True(source2.IsEnabled()); - transport.Requests.Clear(); + _mockTransport.Requests.Clear(); source2.LogMessage("hello two", LogLevel.Information); - WaitForRequest(transport); - Assert.Single(transport.Requests); - await AssertContentContains(transport.Requests.Single(), "TestInfoEvent: hello two", LogLevel.Information); + WaitForRequest(_mockTransport); + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), "TestInfoEvent: hello two", LogLevel.Information); } private IEnumerable WaitForRequest(MockTransport transport, Func? filter = null) @@ -274,19 +299,24 @@ private static async Task AssertContentDoesNotContain(List requests } } - private static void SetUpOTelAndLogging(WebApplicationBuilder builder, MockTransport transport, LogLevel enableLevel) + private static void SetUpOTelAndLogging(ServiceCollection serviceCollection, MockTransport transport, LogLevel enableLevel, Action? extraLoggingConfig = null) { - builder.Logging.ClearProviders(); - builder.Logging.AddFilter((name, level) => + serviceCollection.AddLogging(loggingBuilder => { - if (name != null && name.StartsWith("Azure")) + //loggingBuilder.ClearProviders(); + loggingBuilder.AddFilter((name, level) => { - return level >= enableLevel; - } - return false; + if (name != null && name.StartsWith("Azure")) + { + return level >= enableLevel; + } + return false; + }); + + extraLoggingConfig?.Invoke(loggingBuilder); }); - builder.Services.AddOpenTelemetry().UseAzureMonitor(config => + serviceCollection.AddOpenTelemetry().UseAzureMonitor(config => { config.Transport = transport; config.ConnectionString = $"InstrumentationKey={Guid.NewGuid()}"; @@ -294,6 +324,15 @@ private static void SetUpOTelAndLogging(WebApplicationBuilder builder, MockTrans }); } + private static async Task StartHostedServicesAsync(ServiceProvider serviceProvider) + { + var hostedServices = serviceProvider.GetServices(); + foreach (var hostedService in hostedServices) + { + await hostedService.StartAsync(CancellationToken.None); + } + } + internal class TestEventSource : AzureEventSource { private readonly string EventSourceName; From fc918e612fee03eb7c27dd314cb32b568183df55 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:49:36 -0700 Subject: [PATCH 36/71] Sync eng/common directory with azure-sdk-tools for PR 8875 (#45693) * chore(): add playwright-testing to product slugs * Update eng/common/scripts/Test-SampleMetadata.ps1 --------- Co-authored-by: Siddharth Singha Roy Co-authored-by: Wes Haggard --- eng/common/scripts/Test-SampleMetadata.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/common/scripts/Test-SampleMetadata.ps1 b/eng/common/scripts/Test-SampleMetadata.ps1 index 8499b70a4926e..c091ca51def0e 100644 --- a/eng/common/scripts/Test-SampleMetadata.ps1 +++ b/eng/common/scripts/Test-SampleMetadata.ps1 @@ -422,6 +422,8 @@ begin { "office-word", "office-yammer", "passport-azure-ad", + "playwright", + "playwright-testing", "power-apps", "power-automate", "power-bi", From f03fab7f97508c9a4befe3cad05ebcfba1d2ad1a Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Tue, 27 Aug 2024 16:18:58 -0700 Subject: [PATCH 37/71] Turn off warnings from sdl disablement (#45568) --- eng/pipelines/templates/stages/1es-redirect.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/pipelines/templates/stages/1es-redirect.yml b/eng/pipelines/templates/stages/1es-redirect.yml index b21c58f8f814f..a9025c74954b3 100644 --- a/eng/pipelines/templates/stages/1es-redirect.yml +++ b/eng/pipelines/templates/stages/1es-redirect.yml @@ -60,6 +60,8 @@ extends: # See https://dev.azure.com/securitytools/SecurityIntegration/_wiki/wikis/Guardian/1378/Glob-Format # Exclude Microsoft.Azure.KeyVault.Core.dll track 1 dependency that we no longer support but is causing issues analyzeTargetGlob: +:file|**/*.dll;+:file|**/*.exe;-:f|**/net452/Microsoft.Azure.KeyVault.Core.dll;-:f|**/net461/Microsoft.Azure.KeyVault.Core.dll;-:f|**/tools/NuGet.exe;-:f|**/tools/gpg/**/*.dll;-:f|**/tools/gpg/**/*.exe;-:f|**/tools/azcopy/**/*.exe;-:f|**/tools/azcopy/**/*.dll;-:f|**/aotcompatibility/**/*.exe + # Turn off the build warnings caused by disabling some sdl checks + createAdoIssuesForJustificationsForDisablement: false eslint: enabled: false justificationForDisabling: 'ESLint injected task has failures because it uses an old version of mkdirp. We should not fail for tools not controlled by the repo. See: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3499746' From 9fb184db21888352fac0a3ae8cc8d5f7c93428d4 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 27 Aug 2024 19:54:43 -0700 Subject: [PATCH 38/71] Update AutoRest C# version to 3.0.0-beta.20240827.2 (#45700) --- eng/Packages.Data.props | 2 +- eng/emitter-package-lock.json | 16 ++++++++-------- eng/emitter-package.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index c136e82bb36f1..f7a3a05a9c133 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -227,7 +227,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 07af6b875d706..c399c37a46035 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240826.5" + "@azure-tools/typespec-csharp": "0.2.0-beta.20240827.2" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.45.0", @@ -22,9 +22,9 @@ } }, "node_modules/@autorest/csharp": { - "version": "3.0.0-beta.20240826.5", - "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240826.5.tgz", - "integrity": "sha512-a8ZaKPrnhqk8CPkn+uwVPIxCVdGygj8JsTHbqT1Q9Ilo3FjW3XiR+nr/L/Bk1IY03kM1+Xcq6w7QV6F1e6nXzQ==" + "version": "3.0.0-beta.20240827.2", + "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240827.2.tgz", + "integrity": "sha512-uHw5y6nT2Y2w+5hWVXNTakC8/Jyu/V7wNOT4JHcrvn8ORDlnD/JVWPkkerbmVuf9dMgVF4YjQ2KLpMFmzHvWog==" }, "node_modules/@azure-tools/typespec-autorest": { "version": "0.45.0", @@ -117,11 +117,11 @@ } }, "node_modules/@azure-tools/typespec-csharp": { - "version": "0.2.0-beta.20240826.5", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240826.5.tgz", - "integrity": "sha512-nIxClHrtj8jCbtA+mN8vl2E2BMZnsUW5vSMLjCkrIOMcKWi3uivtJsNgnSsS3DjjsnaRut5gq++3wKte8NURug==", + "version": "0.2.0-beta.20240827.2", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240827.2.tgz", + "integrity": "sha512-o0En4LsSVUc+GU0vO/3T7QznmgOvemXaEFTbb2oF8vqrw5ZEKWDqKptXiDbwHEAUI3nv7LaunX4ijMA9j0xBIQ==", "dependencies": { - "@autorest/csharp": "3.0.0-beta.20240826.5", + "@autorest/csharp": "3.0.0-beta.20240827.2", "@typespec/http-client-csharp": "0.1.9-alpha.20240826.1", "json-serialize-refs": "0.1.0-0" }, diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 64cb0e292c135..a75e8a3e13f68 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,7 +1,7 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240826.5" + "@azure-tools/typespec-csharp": "0.2.0-beta.20240827.2" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.45.0", From dd70ed4fcc1a9e5ca6282b368b762c941638402d Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 28 Aug 2024 00:37:45 -0700 Subject: [PATCH 39/71] Update AutoRest C# version to 3.0.0-beta.20240827.3 (#45702) * Update Generator Version 3.0.0-beta.20240827.3 * Update SDK codes pu_sq_5 * update --------- Co-authored-by: pshao25 <97225342+pshao25@users.noreply.github.com> --- eng/Packages.Data.props | 2 +- eng/emitter-package-lock.json | 16 ++-- eng/emitter-package.json | 2 +- .../Azure.ResourceManager.netstandard2.0.cs | 82 +++++++++++++++++++ .../Azure.ResourceManager/assets.json | 2 +- .../Generated/Models/ArmPlan.Serialization.cs | 11 ++- .../Generated/Models/ArmSku.Serialization.cs | 11 ++- .../EncryptionProperties.Serialization.cs | 11 ++- .../KeyVaultProperties.Serialization.cs | 11 ++- .../OperationStatusResult.Serialization.cs | 11 ++- .../Models/ResourceData.Serialization.cs | 41 ++++++++++ ...emAssignedServiceIdentity.Serialization.cs | 11 ++- .../Models/SystemData.Serialization.cs | 11 ++- .../TrackedResourceData.Serialization.cs | 35 ++++++++ .../UserAssignedIdentity.Serialization.cs | 11 ++- .../ManagementGroupData.Serialization.cs | 47 +++-------- ...mentGroupSubscriptionData.Serialization.cs | 47 +++-------- ...ateManagementGroupDetails.Serialization.cs | 11 ++- .../Models/DescendantData.Serialization.cs | 47 +++-------- .../DescendantListResult.Serialization.cs | 11 ++- ...DescendantParentGroupInfo.Serialization.cs | 11 ++- .../Models/EntityData.Serialization.cs | 47 +++-------- .../Models/EntityListResult.Serialization.cs | 11 ++- ...ptionUnderManagementGroup.Serialization.cs | 11 ++- .../ManagementGroupChildInfo.Serialization.cs | 11 ++- ...nagementGroupChildOptions.Serialization.cs | 11 ++- ...roupCreateOrUpdateContent.Serialization.cs | 11 ++- .../ManagementGroupInfo.Serialization.cs | 11 ++- ...ManagementGroupListResult.Serialization.cs | 11 ++- ...upNameAvailabilityContent.Serialization.cs | 11 ++- ...oupNameAvailabilityResult.Serialization.cs | 11 ++- ...tGroupParentCreateOptions.Serialization.cs | 11 ++- .../ManagementGroupPatch.Serialization.cs | 11 ++- ...anagementGroupPathElement.Serialization.cs | 11 ++- ...ParentManagementGroupInfo.Serialization.cs | 11 ++- .../DataPolicyManifestData.Serialization.cs | 47 +++-------- .../Generated/FeatureData.Serialization.cs | 47 +++-------- .../GenericResourceData.Serialization.cs | 65 +++------------ .../ManagementLockData.Serialization.cs | 47 +++-------- .../Models/ApiProfile.Serialization.cs | 11 ++- .../ArmPolicyParameter.Serialization.cs | 11 ++- .../ArmPolicyParameterValue.Serialization.cs | 11 ++- .../AvailabilityZoneMappings.Serialization.cs | 11 ++- .../AzureRoleDefinition.Serialization.cs | 11 ++- ...esourceFunctionDefinition.Serialization.cs | 11 ++- .../DataPolicyManifestEffect.Serialization.cs | 11 ++- ...aPolicyManifestListResult.Serialization.cs | 11 ++- .../Models/ExportTemplate.Serialization.cs | 11 ++- .../Models/ExtendedLocation.Serialization.cs | 11 ++- ...atureOperationsListResult.Serialization.cs | 11 ++- .../Models/FeatureProperties.Serialization.cs | 11 ++- .../Models/LocationExpanded.Serialization.cs | 11 ++- .../LocationListResult.Serialization.cs | 11 ++- .../Models/LocationMetadata.Serialization.cs | 11 ++- .../Models/ManagedByTenant.Serialization.cs | 11 ++- .../ManagementLockListResult.Serialization.cs | 11 ++- .../ManagementLockOwner.Serialization.cs | 11 ++- .../NonComplianceMessage.Serialization.cs | 11 ++- .../Models/PairedRegion.Serialization.cs | 11 ++- ...rDefinitionsValueMetadata.Serialization.cs | 11 ++- .../Models/Permission.Serialization.cs | 11 ++- ...olicyAssignmentListResult.Serialization.cs | 11 ++- .../PolicyAssignmentPatch.Serialization.cs | 11 ++- .../PolicyDefinitionGroup.Serialization.cs | 11 ++- ...olicyDefinitionListResult.Serialization.cs | 11 ++- ...PolicyDefinitionReference.Serialization.cs | 11 ++- .../Models/PolicyOverride.Serialization.cs | 11 ++- ...cySetDefinitionListResult.Serialization.cs | 11 ++- .../Models/PredefinedTag.Serialization.cs | 11 ++- .../PredefinedTagCount.Serialization.cs | 11 ++- .../PredefinedTagValue.Serialization.cs | 11 ++- .../PredefinedTagsListResult.Serialization.cs | 11 ++- ...ProviderConsentDefinition.Serialization.cs | 11 ++- .../ProviderExtendedLocation.Serialization.cs | 11 ++- .../ProviderPermission.Serialization.cs | 11 ++- ...viderPermissionListResult.Serialization.cs | 11 ++- ...oviderRegistrationContent.Serialization.cs | 11 ++- .../ProviderResourceType.Serialization.cs | 11 ++- ...derResourceTypeListResult.Serialization.cs | 11 ++- ...ResourceGroupExportResult.Serialization.cs | 11 ++- .../ResourceGroupListResult.Serialization.cs | 11 ++- .../ResourceGroupPatch.Serialization.cs | 11 ++- .../ResourceGroupProperties.Serialization.cs | 11 ++- .../ResourceListResult.Serialization.cs | 11 ++- ...urceNameValidationContent.Serialization.cs | 11 ++- ...ourceNameValidationResult.Serialization.cs | 11 ++- ...esourceProviderListResult.Serialization.cs | 11 ++- .../Models/ResourceSelector.Serialization.cs | 11 ++- ...esourceSelectorExpression.Serialization.cs | 11 ++- .../Models/ResourceTypeAlias.Serialization.cs | 11 ++- .../ResourceTypeAliasPath.Serialization.cs | 11 ++- ...urceTypeAliasPathMetadata.Serialization.cs | 11 ++- .../ResourceTypeAliasPattern.Serialization.cs | 11 ++- .../ResourceTypeAliases.Serialization.cs | 11 ++- .../ResourcesMoveContent.Serialization.cs | 11 ++- .../Models/ResourcesSku.Serialization.cs | 11 ++- .../SubscriptionListResult.Serialization.cs | 11 ++- .../SubscriptionPolicies.Serialization.cs | 11 ++- .../Generated/Models/Tag.Serialization.cs | 11 ++- .../Models/TagResourcePatch.Serialization.cs | 11 ++- .../Models/TenantListResult.Serialization.cs | 11 ++- .../TenantResourceProvider.Serialization.cs | 11 ++- ...esourceProviderListResult.Serialization.cs | 11 ++- ...ackedResourceExtendedData.Serialization.cs | 60 +++----------- .../Models/ZoneMapping.Serialization.cs | 11 ++- .../PolicyAssignmentData.Serialization.cs | 47 +++-------- .../PolicyDefinitionData.Serialization.cs | 47 +++-------- .../PolicySetDefinitionData.Serialization.cs | 47 +++-------- .../ResourceGroupData.Serialization.cs | 60 +++----------- .../ResourceProviderData.Serialization.cs | 11 ++- .../SubscriptionData.Serialization.cs | 11 ++- .../TagResourceData.Serialization.cs | 47 +++-------- .../Generated/TenantData.Serialization.cs | 11 ++- .../Azure.ResourceManager/src/autorest.md | 1 + .../SerializationTestType1.json | 8 +- .../SerializationTestType2.json | 14 ++-- 116 files changed, 1149 insertions(+), 768 deletions(-) create mode 100644 sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ResourceData.Serialization.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/TrackedResourceData.Serialization.cs diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index f7a3a05a9c133..42974732c555b 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -227,7 +227,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index c399c37a46035..3162de2965e79 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240827.2" + "@azure-tools/typespec-csharp": "0.2.0-beta.20240827.3" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.45.0", @@ -22,9 +22,9 @@ } }, "node_modules/@autorest/csharp": { - "version": "3.0.0-beta.20240827.2", - "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240827.2.tgz", - "integrity": "sha512-uHw5y6nT2Y2w+5hWVXNTakC8/Jyu/V7wNOT4JHcrvn8ORDlnD/JVWPkkerbmVuf9dMgVF4YjQ2KLpMFmzHvWog==" + "version": "3.0.0-beta.20240827.3", + "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240827.3.tgz", + "integrity": "sha512-QrcQi8JNGrAZtms0soDP4lnKBIU2gZyupGlYX2/ZEdtCwNj23aYu53c2XXr7sHPz/5MXPvS2MxV6nSjwLIGjXQ==" }, "node_modules/@azure-tools/typespec-autorest": { "version": "0.45.0", @@ -117,11 +117,11 @@ } }, "node_modules/@azure-tools/typespec-csharp": { - "version": "0.2.0-beta.20240827.2", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240827.2.tgz", - "integrity": "sha512-o0En4LsSVUc+GU0vO/3T7QznmgOvemXaEFTbb2oF8vqrw5ZEKWDqKptXiDbwHEAUI3nv7LaunX4ijMA9j0xBIQ==", + "version": "0.2.0-beta.20240827.3", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240827.3.tgz", + "integrity": "sha512-zI3oxLO6pNoDS5n7cSmvrp9npC+iVFrv1Omm0Llj1rgRSL7gPWcs6GA1zU2+51PvyEn7+tFeDvzIKdNZMZmNUw==", "dependencies": { - "@autorest/csharp": "3.0.0-beta.20240827.2", + "@autorest/csharp": "3.0.0-beta.20240827.3", "@typespec/http-client-csharp": "0.1.9-alpha.20240826.1", "json-serialize-refs": "0.1.0-0" }, diff --git a/eng/emitter-package.json b/eng/emitter-package.json index a75e8a3e13f68..b7ee0092d404b 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,7 +1,7 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240827.2" + "@azure-tools/typespec-csharp": "0.2.0-beta.20240827.3" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.45.0", diff --git a/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs b/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs index 07f2be1da6e8f..5014bef15852c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs @@ -162,6 +162,7 @@ internal ManagementGroupData() { } public Azure.ResourceManager.ManagementGroups.Models.ManagementGroupInfo Details { get { throw null; } } public string DisplayName { get { throw null; } } public System.Guid? TenantId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.ManagementGroupData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.ManagementGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -222,6 +223,7 @@ internal ManagementGroupSubscriptionData() { } public Azure.Core.ResourceIdentifier ParentId { get { throw null; } } public string State { get { throw null; } } public string Tenant { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.ManagementGroupSubscriptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.ManagementGroupSubscriptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -257,6 +259,7 @@ public CreateManagementGroupDetails() { } public string UpdatedBy { get { throw null; } } public System.DateTimeOffset? UpdatedOn { get { throw null; } } public int? Version { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.CreateManagementGroupDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.CreateManagementGroupDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -268,6 +271,7 @@ public partial class DescendantData : Azure.ResourceManager.Models.ResourceData, internal DescendantData() { } public string DisplayName { get { throw null; } } public Azure.Core.ResourceIdentifier ParentId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.DescendantData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.DescendantData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -287,6 +291,7 @@ internal EntityData() { } public System.Collections.Generic.IReadOnlyList ParentNameChain { get { throw null; } } public Azure.ResourceManager.ManagementGroups.Models.EntityPermission? Permissions { get { throw null; } } public System.Guid? TenantId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.EntityData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.EntityData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -349,6 +354,7 @@ internal ManagementGroupChildInfo() { } public string DisplayName { get { throw null; } } public string Id { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupChildInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupChildInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -363,6 +369,7 @@ internal ManagementGroupChildOptions() { } public string DisplayName { get { throw null; } } public string Id { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupChildOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupChildOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -410,6 +417,7 @@ public ManagementGroupCreateOrUpdateContent() { } public string Name { get { throw null; } set { } } public Azure.Core.ResourceType? ResourceType { get { throw null; } } public System.Guid? TenantId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -445,6 +453,7 @@ internal ManagementGroupInfo() { } public string UpdatedBy { get { throw null; } } public System.DateTimeOffset? UpdatedOn { get { throw null; } } public int? Version { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -456,6 +465,7 @@ public partial class ManagementGroupNameAvailabilityContent : System.ClientModel public ManagementGroupNameAvailabilityContent() { } public string Name { get { throw null; } set { } } public Azure.Core.ResourceType? ResourceType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -468,6 +478,7 @@ internal ManagementGroupNameAvailabilityResult() { } public string Message { get { throw null; } } public bool? NameAvailable { get { throw null; } } public Azure.ResourceManager.ManagementGroups.Models.ManagementGroupNameUnavailableReason? Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -485,6 +496,7 @@ public ManagementGroupParentCreateOptions() { } public string DisplayName { get { throw null; } } public string Id { get { throw null; } set { } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupParentCreateOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupParentCreateOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -496,6 +508,7 @@ public partial class ManagementGroupPatch : System.ClientModel.Primitives.IJsonM public ManagementGroupPatch() { } public string DisplayName { get { throw null; } set { } } public string ParentGroupId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -507,6 +520,7 @@ public partial class ManagementGroupPathElement : System.ClientModel.Primitives. internal ManagementGroupPathElement() { } public string DisplayName { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupPathElement System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupPathElement System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -519,6 +533,7 @@ internal ParentManagementGroupInfo() { } public string DisplayName { get { throw null; } } public string Id { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ParentManagementGroupInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ParentManagementGroupInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -604,6 +619,7 @@ public partial class EncryptionProperties : System.ClientModel.Primitives.IJsonM public EncryptionProperties() { } public Azure.ResourceManager.Models.KeyVaultProperties KeyVaultProperties { get { throw null; } set { } } public Azure.ResourceManager.Models.EncryptionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.EncryptionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.EncryptionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -637,6 +653,7 @@ public partial class KeyVaultProperties : System.ClientModel.Primitives.IJsonMod public KeyVaultProperties() { } public string Identity { get { throw null; } set { } } public string KeyIdentifier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.KeyVaultProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.KeyVaultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -689,6 +706,7 @@ public OperationStatusResult(string status) { } public float? PercentComplete { get { throw null; } } public System.DateTimeOffset? StartOn { get { throw null; } } public string Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.OperationStatusResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.OperationStatusResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -703,6 +721,7 @@ protected ResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core public string Name { get { throw null; } } public Azure.Core.ResourceType ResourceType { get { throw null; } } public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } } public static partial class ResourceManagerModelFactory { @@ -771,6 +790,7 @@ public SystemAssignedServiceIdentity(Azure.ResourceManager.Models.SystemAssigned public System.Guid? PrincipalId { get { throw null; } } public Azure.ResourceManager.Models.SystemAssignedServiceIdentityType SystemAssignedServiceIdentityType { get { throw null; } set { } } public System.Guid? TenantId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.SystemAssignedServiceIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.SystemAssignedServiceIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -806,6 +826,7 @@ public SystemData() { } public string LastModifiedBy { get { throw null; } } public Azure.ResourceManager.Models.CreatedByType? LastModifiedByType { get { throw null; } } public System.DateTimeOffset? LastModifiedOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.SystemData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.SystemData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -819,12 +840,14 @@ protected TrackedResourceData(Azure.Core.AzureLocation location) { } protected TrackedResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location) { } public Azure.Core.AzureLocation Location { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } } public partial class UserAssignedIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public UserAssignedIdentity() { } public System.Guid? ClientId { get { throw null; } } public System.Guid? PrincipalId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.UserAssignedIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.UserAssignedIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -869,6 +892,7 @@ internal DataPolicyManifestData() { } public string PolicyMode { get { throw null; } } public System.Collections.Generic.IReadOnlyList ResourceTypeAliases { get { throw null; } } public System.Collections.Generic.IReadOnlyList Standard { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.DataPolicyManifestData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.DataPolicyManifestData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -909,6 +933,7 @@ public partial class FeatureData : Azure.ResourceManager.Models.ResourceData, Sy { internal FeatureData() { } public string FeatureState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.FeatureData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.FeatureData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -974,6 +999,7 @@ public GenericResourceData(Azure.Core.AzureLocation location) : base (default(Az public System.BinaryData Properties { get { throw null; } set { } } public string ProvisioningState { get { throw null; } } public Azure.ResourceManager.Resources.Models.ResourcesSku Sku { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.GenericResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.GenericResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1075,6 +1101,7 @@ public ManagementLockData(Azure.ResourceManager.Resources.Models.ManagementLockL public Azure.ResourceManager.Resources.Models.ManagementLockLevel Level { get { throw null; } set { } } public string Notes { get { throw null; } set { } } public System.Collections.Generic.IList Owners { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.ManagementLockData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.ManagementLockData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1136,6 +1163,7 @@ public PolicyAssignmentData() { } public string PolicyDefinitionId { get { throw null; } set { } } public System.Collections.Generic.IList ResourceSelectors { get { throw null; } } public string Scope { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.PolicyAssignmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.PolicyAssignmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1173,6 +1201,7 @@ public PolicyDefinitionData() { } public System.Collections.Generic.IDictionary Parameters { get { throw null; } } public System.BinaryData PolicyRule { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.PolicyType? PolicyType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.PolicyDefinitionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.PolicyDefinitionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1189,6 +1218,7 @@ public PolicySetDefinitionData() { } public System.Collections.Generic.IList PolicyDefinitionGroups { get { throw null; } } public System.Collections.Generic.IList PolicyDefinitions { get { throw null; } } public Azure.ResourceManager.Resources.Models.PolicyType? PolicyType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.PolicySetDefinitionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.PolicySetDefinitionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1217,6 +1247,7 @@ public partial class ResourceGroupData : Azure.ResourceManager.Models.TrackedRes public ResourceGroupData(Azure.Core.AzureLocation location) { } public string ManagedBy { get { throw null; } set { } } public string ResourceGroupProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.ResourceGroupData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.ResourceGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1286,6 +1317,7 @@ public ResourceProviderData() { } public string RegistrationPolicy { get { throw null; } } public string RegistrationState { get { throw null; } } public System.Collections.Generic.IReadOnlyList ResourceTypes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.ResourceProviderData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.ResourceProviderData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1345,6 +1377,7 @@ internal SubscriptionData() { } public Azure.ResourceManager.Resources.Models.SubscriptionPolicies SubscriptionPolicies { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } public System.Guid? TenantId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.SubscriptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.SubscriptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1498,6 +1531,7 @@ public partial class TagResourceData : Azure.ResourceManager.Models.ResourceData { public TagResourceData(Azure.ResourceManager.Resources.Models.Tag properties) { } public System.Collections.Generic.IDictionary TagValues { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.TagResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.TagResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1528,6 +1562,7 @@ internal TenantData() { } public Azure.ResourceManager.Resources.Models.TenantCategory? TenantCategory { get { throw null; } } public System.Guid? TenantId { get { throw null; } } public string TenantType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.TenantData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.TenantData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1642,6 +1677,7 @@ public partial class ApiProfile : System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ApiProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1655,6 +1691,7 @@ public ArmPolicyParameter() { } public System.BinaryData DefaultValue { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.ParameterDefinitionsValueMetadata Metadata { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.ArmPolicyParameterType? ParameterType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmPolicyParameter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmPolicyParameter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1688,6 +1725,7 @@ public partial class ArmPolicyParameterValue : System.ClientModel.Primitives.IJs { public ArmPolicyParameterValue() { } public System.BinaryData Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmPolicyParameterValue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmPolicyParameterValue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1714,6 +1752,7 @@ public partial class AvailabilityZoneMappings : System.ClientModel.Primitives.IJ internal AvailabilityZoneMappings() { } public string LogicalZone { get { throw null; } } public string PhysicalZone { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.AvailabilityZoneMappings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.AvailabilityZoneMappings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1728,6 +1767,7 @@ internal AzureRoleDefinition() { } public string Name { get { throw null; } } public System.Collections.Generic.IReadOnlyList Permissions { get { throw null; } } public System.Collections.Generic.IReadOnlyList Scopes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.AzureRoleDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.AzureRoleDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1741,6 +1781,7 @@ internal DataManifestCustomResourceFunctionDefinition() { } public System.Collections.Generic.IReadOnlyList DefaultProperties { get { throw null; } } public Azure.Core.ResourceType? FullyQualifiedResourceType { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.DataManifestCustomResourceFunctionDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.DataManifestCustomResourceFunctionDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1752,6 +1793,7 @@ public partial class DataPolicyManifestEffect : System.ClientModel.Primitives.IJ internal DataPolicyManifestEffect() { } public System.BinaryData DetailsSchema { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.DataPolicyManifestEffect System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.DataPolicyManifestEffect System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1783,6 +1825,7 @@ public partial class ExportTemplate : System.ClientModel.Primitives.IJsonModel Resources { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ExportTemplate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ExportTemplate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1794,6 +1837,7 @@ public partial class ExtendedLocation : System.ClientModel.Primitives.IJsonModel public ExtendedLocation() { } public Azure.ResourceManager.Resources.Models.ExtendedLocationType? ExtendedLocationType { get { throw null; } set { } } public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ExtendedLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ExtendedLocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1828,6 +1872,7 @@ internal LocationExpanded() { } public string Name { get { throw null; } } public string RegionalDisplayName { get { throw null; } } public string SubscriptionId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } public static implicit operator Azure.Core.AzureLocation (Azure.ResourceManager.Resources.Models.LocationExpanded location) { throw null; } Azure.ResourceManager.Resources.Models.LocationExpanded System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1847,6 +1892,7 @@ internal LocationMetadata() { } public string PhysicalLocation { get { throw null; } } public Azure.ResourceManager.Resources.Models.RegionCategory? RegionCategory { get { throw null; } } public Azure.ResourceManager.Resources.Models.RegionType? RegionType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.LocationMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.LocationMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1862,6 +1908,7 @@ public partial class ManagedByTenant : System.ClientModel.Primitives.IJsonModel< { internal ManagedByTenant() { } public System.Guid? TenantId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ManagedByTenant System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ManagedByTenant System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1891,6 +1938,7 @@ public partial class ManagementLockOwner : System.ClientModel.Primitives.IJsonMo { public ManagementLockOwner() { } public string ApplicationId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ManagementLockOwner System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ManagementLockOwner System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1902,6 +1950,7 @@ public partial class NonComplianceMessage : System.ClientModel.Primitives.IJsonM public NonComplianceMessage(string message) { } public string Message { get { throw null; } set { } } public string PolicyDefinitionReferenceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.NonComplianceMessage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.NonComplianceMessage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1914,6 +1963,7 @@ internal PairedRegion() { } public string Id { get { throw null; } } public string Name { get { throw null; } } public string SubscriptionId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PairedRegion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PairedRegion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1928,6 +1978,7 @@ public ParameterDefinitionsValueMetadata() { } public string Description { get { throw null; } set { } } public string DisplayName { get { throw null; } set { } } public string StrongType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ParameterDefinitionsValueMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ParameterDefinitionsValueMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1941,6 +1992,7 @@ internal Permission() { } public System.Collections.Generic.IReadOnlyList AllowedDataActions { get { throw null; } } public System.Collections.Generic.IReadOnlyList DeniedActions { get { throw null; } } public System.Collections.Generic.IReadOnlyList DeniedDataActions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.Permission System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.Permission System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1954,6 +2006,7 @@ public PolicyAssignmentPatch() { } public Azure.Core.AzureLocation? Location { get { throw null; } set { } } public System.Collections.Generic.IList Overrides { get { throw null; } } public System.Collections.Generic.IList ResourceSelectors { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyAssignmentPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyAssignmentPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1968,6 +2021,7 @@ public PolicyDefinitionGroup(string name) { } public string Description { get { throw null; } set { } } public string DisplayName { get { throw null; } set { } } public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyDefinitionGroup System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyDefinitionGroup System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1981,6 +2035,7 @@ public PolicyDefinitionReference(string policyDefinitionId) { } public System.Collections.Generic.IDictionary Parameters { get { throw null; } } public string PolicyDefinitionId { get { throw null; } set { } } public string PolicyDefinitionReferenceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyDefinitionReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyDefinitionReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1993,6 +2048,7 @@ public PolicyOverride() { } public Azure.ResourceManager.Resources.Models.PolicyOverrideKind? Kind { get { throw null; } set { } } public System.Collections.Generic.IList Selectors { get { throw null; } } public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyOverride System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyOverride System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2043,6 +2099,7 @@ internal PredefinedTag() { } public string Id { get { throw null; } } public string TagName { get { throw null; } } public System.Collections.Generic.IReadOnlyList Values { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PredefinedTag System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PredefinedTag System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2054,6 +2111,7 @@ public partial class PredefinedTagCount : System.ClientModel.Primitives.IJsonMod internal PredefinedTagCount() { } public string PredefinedTagCountType { get { throw null; } } public int? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PredefinedTagCount System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PredefinedTagCount System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2066,6 +2124,7 @@ internal PredefinedTagValue() { } public Azure.ResourceManager.Resources.Models.PredefinedTagCount Count { get { throw null; } } public string Id { get { throw null; } } public string TagValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PredefinedTagValue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PredefinedTagValue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2098,6 +2157,7 @@ internal ProviderExtendedLocation() { } public System.Collections.Generic.IReadOnlyList ExtendedLocations { get { throw null; } } public Azure.Core.AzureLocation? Location { get { throw null; } } public string ProviderExtendedLocationType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderExtendedLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderExtendedLocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2111,6 +2171,7 @@ internal ProviderPermission() { } public Azure.ResourceManager.Resources.Models.AzureRoleDefinition ManagedByRoleDefinition { get { throw null; } } public Azure.ResourceManager.Resources.Models.ProviderAuthorizationConsentState? ProviderAuthorizationConsentState { get { throw null; } } public Azure.ResourceManager.Resources.Models.AzureRoleDefinition RoleDefinition { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderPermission System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderPermission System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2121,6 +2182,7 @@ public partial class ProviderRegistrationContent : System.ClientModel.Primitives { public ProviderRegistrationContent() { } public bool? ConsentToAuthorization { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderRegistrationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderRegistrationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2140,6 +2202,7 @@ internal ProviderResourceType() { } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } public string ResourceType { get { throw null; } } public System.Collections.Generic.IReadOnlyList ZoneMappings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderResourceType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderResourceType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2188,6 +2251,7 @@ public partial class ResourceGroupExportResult : System.ClientModel.Primitives.I internal ResourceGroupExportResult() { } public Azure.ResponseError Error { get { throw null; } } public System.BinaryData Template { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceGroupExportResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceGroupExportResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2201,6 +2265,7 @@ public ResourceGroupPatch() { } public string Name { get { throw null; } set { } } public string ResourceGroupProvisioningState { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceGroupPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceGroupPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2212,6 +2277,7 @@ public partial class ResourceNameValidationContent : System.ClientModel.Primitiv public ResourceNameValidationContent(string name, Azure.Core.ResourceType resourceType) { } public string Name { get { throw null; } } public Azure.Core.ResourceType ResourceType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceNameValidationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceNameValidationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2224,6 +2290,7 @@ internal ResourceNameValidationResult() { } public string Name { get { throw null; } } public Azure.Core.ResourceType? ResourceType { get { throw null; } } public Azure.ResourceManager.Resources.Models.ResourceNameValidationStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceNameValidationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceNameValidationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2253,6 +2320,7 @@ public partial class ResourceSelector : System.ClientModel.Primitives.IJsonModel public ResourceSelector() { } public string Name { get { throw null; } set { } } public System.Collections.Generic.IList Selectors { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceSelector System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceSelector System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2265,6 +2333,7 @@ public ResourceSelectorExpression() { } public System.Collections.Generic.IList In { get { throw null; } } public Azure.ResourceManager.Resources.Models.ResourceSelectorKind? Kind { get { throw null; } set { } } public System.Collections.Generic.IList NotIn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceSelectorExpression System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceSelectorExpression System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2298,6 +2367,7 @@ public ResourcesMoveContent() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public string TargetResourceGroup { get { throw null; } set { } } public Azure.Core.ResourceIdentifier TargetResourceGroupId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourcesMoveContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourcesMoveContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2313,6 +2383,7 @@ public ResourcesSku() { } public string Name { get { throw null; } set { } } public string Size { get { throw null; } set { } } public string Tier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourcesSku System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourcesSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2328,6 +2399,7 @@ internal ResourceTypeAlias() { } public Azure.ResourceManager.Resources.Models.ResourceTypeAliasPattern DefaultPattern { get { throw null; } } public string Name { get { throw null; } } public System.Collections.Generic.IReadOnlyList Paths { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAlias System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAlias System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2339,6 +2411,7 @@ public partial class ResourceTypeAliases : System.ClientModel.Primitives.IJsonMo internal ResourceTypeAliases() { } public System.Collections.Generic.IReadOnlyList Aliases { get { throw null; } } public string ResourceType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliases System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliases System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2352,6 +2425,7 @@ internal ResourceTypeAliasPath() { } public Azure.ResourceManager.Resources.Models.ResourceTypeAliasPathMetadata Metadata { get { throw null; } } public string Path { get { throw null; } } public Azure.ResourceManager.Resources.Models.ResourceTypeAliasPattern Pattern { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliasPath System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliasPath System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2381,6 +2455,7 @@ public partial class ResourceTypeAliasPathMetadata : System.ClientModel.Primitiv internal ResourceTypeAliasPathMetadata() { } public Azure.ResourceManager.Resources.Models.ResourceTypeAliasPathAttributes? Attributes { get { throw null; } } public Azure.ResourceManager.Resources.Models.ResourceTypeAliasPathTokenType? TokenType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliasPathMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliasPathMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2417,6 +2492,7 @@ internal ResourceTypeAliasPattern() { } public Azure.ResourceManager.Resources.Models.ResourceTypeAliasPatternType? PatternType { get { throw null; } } public string Phrase { get { throw null; } } public string Variable { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliasPattern System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliasPattern System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2457,6 +2533,7 @@ internal SubscriptionPolicies() { } public string LocationPlacementId { get { throw null; } } public string QuotaId { get { throw null; } } public Azure.ResourceManager.Resources.Models.SpendingLimit? SpendingLimit { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.SubscriptionPolicies System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.SubscriptionPolicies System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2475,6 +2552,7 @@ public partial class Tag : System.ClientModel.Primitives.IJsonModel TagValues { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.Tag System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.Tag System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2505,6 +2583,7 @@ public partial class TagResourcePatch : System.ClientModel.Primitives.IJsonModel public TagResourcePatch() { } public Azure.ResourceManager.Resources.Models.TagPatchMode? PatchMode { get { throw null; } set { } } public System.Collections.Generic.IDictionary TagValues { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.TagResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.TagResourcePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2522,6 +2601,7 @@ public partial class TenantResourceProvider : System.ClientModel.Primitives.IJso internal TenantResourceProvider() { } public string Namespace { get { throw null; } } public System.Collections.Generic.IReadOnlyList ResourceTypes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.TenantResourceProvider System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.TenantResourceProvider System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2532,6 +2612,7 @@ public partial class TrackedResourceExtendedData : Azure.ResourceManager.Models. { public TrackedResourceExtendedData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Resources.Models.ExtendedLocation ExtendedLocation { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.TrackedResourceExtendedData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.TrackedResourceExtendedData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2554,6 +2635,7 @@ public partial class ZoneMapping : System.ClientModel.Primitives.IJsonModel Zones { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ZoneMapping System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ZoneMapping System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/resourcemanager/Azure.ResourceManager/assets.json b/sdk/resourcemanager/Azure.ResourceManager/assets.json index 2d8a648b6a673..66dcda9ed0e7d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/assets.json +++ b/sdk/resourcemanager/Azure.ResourceManager/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/resourcemanager/Azure.ResourceManager", - "Tag": "net/resourcemanager/Azure.ResourceManager_9f5b8a2748" + "Tag": "net/resourcemanager/Azure.ResourceManager_9a9a9534b3" } diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmPlan.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmPlan.Serialization.cs index dc584dcc860ce..217569f811f2b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmPlan.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmPlan.Serialization.cs @@ -21,6 +21,15 @@ public partial class ArmPlan : 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. + private void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions o throw new FormatException($"The model {nameof(ArmPlan)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); writer.WritePropertyName("publisher"u8); @@ -45,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions o writer.WritePropertyName("version"u8); writer.WriteStringValue(Version); } - writer.WriteEndObject(); } ArmPlan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmSku.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmSku.Serialization.cs index f4afe703f634b..a35b5bbfc5edd 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmSku.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmSku.Serialization.cs @@ -21,6 +21,15 @@ public partial class ArmSku : 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. + private void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions op throw new FormatException($"The model {nameof(ArmSku)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); if (Optional.IsDefined(Tier)) @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions op writer.WritePropertyName("capacity"u8); writer.WriteNumberValue(Capacity.Value); } - writer.WriteEndObject(); } ArmSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/EncryptionProperties.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/EncryptionProperties.Serialization.cs index a46d2ea2f45ed..3c32233283bed 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/EncryptionProperties.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/EncryptionProperties.Serialization.cs @@ -21,6 +21,15 @@ public partial class EncryptionProperties : IUtf8JsonSerializable, IJsonModel ((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") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(EncryptionProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -39,7 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("keyVaultProperties"u8); writer.WriteObjectValue(KeyVaultProperties, options); } - writer.WriteEndObject(); } EncryptionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/KeyVaultProperties.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/KeyVaultProperties.Serialization.cs index f1067c6268687..e52fc8d5eaaba 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/KeyVaultProperties.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/KeyVaultProperties.Serialization.cs @@ -21,6 +21,15 @@ public partial class KeyVaultProperties : IUtf8JsonSerializable, IJsonModel ((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") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(KeyIdentifier)) { writer.WritePropertyName("keyIdentifier"u8); @@ -39,7 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("identity"u8); writer.WriteStringValue(Identity); } - writer.WriteEndObject(); } KeyVaultProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/OperationStatusResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/OperationStatusResult.Serialization.cs index 60921fdb42607..5d2e48074192c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/OperationStatusResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/OperationStatusResult.Serialization.cs @@ -22,6 +22,15 @@ public partial class OperationStatusResult : IUtf8JsonSerializable, IJsonModel ((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") @@ -29,7 +38,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(OperationStatusResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -75,7 +83,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WritePropertyName("error"u8); JsonSerializer.Serialize(writer, Error); } - writer.WriteEndObject(); } OperationStatusResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ResourceData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ResourceData.Serialization.cs new file mode 100644 index 0000000000000..1b659410bc2e1 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ResourceData.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Models +{ + public partial class ResourceData + { + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + writer.WriteObjectValue(SystemData, options); + } + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemAssignedServiceIdentity.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemAssignedServiceIdentity.Serialization.cs index f0c42063ad7b0..6701d8c5c931e 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemAssignedServiceIdentity.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemAssignedServiceIdentity.Serialization.cs @@ -21,6 +21,15 @@ public partial class SystemAssignedServiceIdentity : IUtf8JsonSerializable, IJso 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") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(SystemAssignedServiceIdentity)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(PrincipalId)) { writer.WritePropertyName("principalId"u8); @@ -41,7 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WritePropertyName("type"u8); writer.WriteStringValue(SystemAssignedServiceIdentityType.ToString()); - writer.WriteEndObject(); } SystemAssignedServiceIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemData.Serialization.cs index fae51ca8d1b52..35cc14393ece7 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemData.Serialization.cs @@ -21,6 +21,15 @@ public partial class SystemData : 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") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(SystemData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(CreatedBy)) { writer.WritePropertyName("createdBy"u8); @@ -59,7 +67,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption writer.WritePropertyName("lastModifiedAt"u8); writer.WriteStringValue(LastModifiedOn.Value, "O"); } - writer.WriteEndObject(); } SystemData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/TrackedResourceData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/TrackedResourceData.Serialization.cs new file mode 100644 index 0000000000000..a6af3ca008b52 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/TrackedResourceData.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Models +{ + public partial class TrackedResourceData + { + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/UserAssignedIdentity.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/UserAssignedIdentity.Serialization.cs index 6b853c1179fd5..a824a159f2fa9 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/UserAssignedIdentity.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/UserAssignedIdentity.Serialization.cs @@ -21,6 +21,15 @@ public partial class UserAssignedIdentity : IUtf8JsonSerializable, IJsonModel ((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") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(UserAssignedIdentity)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(PrincipalId)) { writer.WritePropertyName("principalId"u8); @@ -39,7 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("clientId"u8); writer.WriteStringValue(ClientId.Value); } - writer.WriteEndObject(); } UserAssignedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupData.Serialization.cs index 5129769060e30..b821e7137ac1e 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupData.Serialization.cs @@ -22,6 +22,15 @@ public partial class ManagementGroupData : IUtf8JsonSerializable, IJsonModel ((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") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ManagementGroupData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(TenantId)) @@ -85,22 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ManagementGroupData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupSubscriptionData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupSubscriptionData.Serialization.cs index 1e7ebde1d067e..e040a8b158e0f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupSubscriptionData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupSubscriptionData.Serialization.cs @@ -21,6 +21,15 @@ public partial class ManagementGroupSubscriptionData : IUtf8JsonSerializable, IJ 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") @@ -28,27 +37,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(ManagementGroupSubscriptionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Tenant)) @@ -79,22 +68,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteStringValue(State); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ManagementGroupSubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/CreateManagementGroupDetails.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/CreateManagementGroupDetails.Serialization.cs index b6e34c1da5b97..89f53c7d85fa0 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/CreateManagementGroupDetails.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/CreateManagementGroupDetails.Serialization.cs @@ -18,6 +18,15 @@ public partial class CreateManagementGroupDetails : IUtf8JsonSerializable, IJson 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(CreateManagementGroupDetails)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } CreateManagementGroupDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantData.Serialization.cs index 4c20ad50f41bf..bb5557a1800ff 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantData.Serialization.cs @@ -20,6 +20,15 @@ public partial class DescendantData : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,27 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(DescendantData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(DisplayName)) @@ -75,22 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp } } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DescendantData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantListResult.Serialization.cs index 50ddfc9368f63..92056dd7f8762 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class DescendantListResult : 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(DescendantListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } DescendantListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantParentGroupInfo.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantParentGroupInfo.Serialization.cs index 5492efa99877d..353586aa81772 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantParentGroupInfo.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantParentGroupInfo.Serialization.cs @@ -19,6 +19,15 @@ internal partial class DescendantParentGroupInfo : IUtf8JsonSerializable, IJsonM 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(DescendantParentGroupInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } DescendantParentGroupInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityData.Serialization.cs index 807aac22bddf1..a61f39b87daed 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityData.Serialization.cs @@ -22,6 +22,15 @@ public partial class EntityData : 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") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(EntityData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(TenantId)) @@ -176,22 +165,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption } } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } EntityData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityListResult.Serialization.cs index d80cac8b38cdb..7c15a6e99b67f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class EntityListResult : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(EntityListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -63,7 +71,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } EntityListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ListSubscriptionUnderManagementGroup.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ListSubscriptionUnderManagementGroup.Serialization.cs index 2106e495e1b60..0fbd0a1f54deb 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ListSubscriptionUnderManagementGroup.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ListSubscriptionUnderManagementGroup.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ListSubscriptionUnderManagementGroup : IUtf8JsonSerializa 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(ListSubscriptionUnderManagementGroup)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } ListSubscriptionUnderManagementGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildInfo.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildInfo.Serialization.cs index 70f9f04a00bf9..9d7fc918de90d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildInfo.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildInfo.Serialization.cs @@ -20,6 +20,15 @@ public partial class ManagementGroupChildInfo : IUtf8JsonSerializable, IJsonMode 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ManagementGroupChildInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ChildType)) { writer.WritePropertyName("type"u8); @@ -73,7 +81,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ManagementGroupChildInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildOptions.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildOptions.Serialization.cs index 17439f340c2f6..f75a5a0e332cc 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildOptions.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildOptions.Serialization.cs @@ -18,6 +18,15 @@ public partial class ManagementGroupChildOptions : IUtf8JsonSerializable, IJsonM 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(ManagementGroupChildOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ChildType)) { writer.WritePropertyName("type"u8); @@ -71,7 +79,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } ManagementGroupChildOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupCreateOrUpdateContent.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupCreateOrUpdateContent.Serialization.cs index c857140ad780a..37b1d4e0765ec 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupCreateOrUpdateContent.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupCreateOrUpdateContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ManagementGroupCreateOrUpdateContent : IUtf8JsonSerializabl 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(ManagementGroupCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -98,7 +106,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } ManagementGroupCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupInfo.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupInfo.Serialization.cs index f71888cf550fd..089e90d98f8bd 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupInfo.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupInfo.Serialization.cs @@ -20,6 +20,15 @@ public partial class ManagementGroupInfo : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ManagementGroupInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -114,7 +122,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } ManagementGroupInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupListResult.Serialization.cs index 03d1eed762643..1b1dab3c918e4 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ManagementGroupListResult : IUtf8JsonSerializable, IJsonM 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ManagementGroupListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ManagementGroupListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityContent.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityContent.Serialization.cs index 253bdf2100897..baca7787b53be 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityContent.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ManagementGroupNameAvailabilityContent : IUtf8JsonSerializa 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter wri throw new FormatException($"The model {nameof(ManagementGroupNameAvailabilityContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter wri #endif } } - writer.WriteEndObject(); } ManagementGroupNameAvailabilityContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityResult.Serialization.cs index bff8c9c215cc8..3f7d2b9ec5710 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityResult.Serialization.cs @@ -19,6 +19,15 @@ public partial class ManagementGroupNameAvailabilityResult : IUtf8JsonSerializab 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writ throw new FormatException($"The model {nameof(ManagementGroupNameAvailabilityResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(NameAvailable)) { writer.WritePropertyName("nameAvailable"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writ #endif } } - writer.WriteEndObject(); } ManagementGroupNameAvailabilityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupParentCreateOptions.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupParentCreateOptions.Serialization.cs index 3edcf60c92f12..654c53eaa8170 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupParentCreateOptions.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupParentCreateOptions.Serialization.cs @@ -18,6 +18,15 @@ public partial class ManagementGroupParentCreateOptions : IUtf8JsonSerializable, 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(ManagementGroupParentCreateOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } ManagementGroupParentCreateOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPatch.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPatch.Serialization.cs index 1d51cde61cdf0..85407dd2ecd53 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPatch.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class ManagementGroupPatch : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ManagementGroupPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(DisplayName)) { if (DisplayName != null) @@ -65,7 +73,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ManagementGroupPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPathElement.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPathElement.Serialization.cs index 5fadd8d286e70..ae6d04246990d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPathElement.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPathElement.Serialization.cs @@ -19,6 +19,15 @@ public partial class ManagementGroupPathElement : IUtf8JsonSerializable, IJsonMo 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ManagementGroupPathElement)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } ManagementGroupPathElement IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ParentManagementGroupInfo.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ParentManagementGroupInfo.Serialization.cs index aa270fbd667bc..c3010695ea905 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ParentManagementGroupInfo.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ParentManagementGroupInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ParentManagementGroupInfo : IUtf8JsonSerializable, IJsonMod 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ParentManagementGroupInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ParentManagementGroupInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/DataPolicyManifestData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/DataPolicyManifestData.Serialization.cs index 266792ba98e85..aa7e1ba7216aa 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/DataPolicyManifestData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/DataPolicyManifestData.Serialization.cs @@ -22,6 +22,15 @@ public partial class DataPolicyManifestData : 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") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(DataPolicyManifestData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsCollectionDefined(Namespaces)) @@ -126,22 +115,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader } writer.WriteEndObject(); writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DataPolicyManifestData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/FeatureData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/FeatureData.Serialization.cs index e0039199f0fe4..c87759c4767c4 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/FeatureData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/FeatureData.Serialization.cs @@ -21,6 +21,15 @@ public partial class FeatureData : IUtf8JsonSerializable, IJsonModel ((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") @@ -28,48 +37,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio throw new FormatException($"The model {nameof(FeatureData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } FeatureData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/GenericResourceData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/GenericResourceData.Serialization.cs index 3014ba60e6b90..ef5379cc971d9 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/GenericResourceData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/GenericResourceData.Serialization.cs @@ -22,6 +22,15 @@ public partial class GenericResourceData : IUtf8JsonSerializable, IJsonModel ((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") @@ -29,7 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(GenericResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Plan)) { writer.WritePropertyName("plan"u8); @@ -82,60 +91,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState); } - if (Optional.IsDefined(ExtendedLocation)) - { - writer.WritePropertyName("extendedLocation"u8); - JsonSerializer.Serialize(writer, ExtendedLocation); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } GenericResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ManagementLockData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ManagementLockData.Serialization.cs index 3c43bb5fafd98..eb06348691e2c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ManagementLockData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ManagementLockData.Serialization.cs @@ -22,6 +22,15 @@ public partial class ManagementLockData : IUtf8JsonSerializable, IJsonModel ((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") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ManagementLockData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("level"u8); @@ -70,22 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndArray(); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ManagementLockData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ApiProfile.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ApiProfile.Serialization.cs index bbdbaaa57e618..c600827fc43af 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ApiProfile.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ApiProfile.Serialization.cs @@ -19,6 +19,15 @@ public partial class ApiProfile : 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(ApiProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProfileVersion)) { writer.WritePropertyName("profileVersion"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption #endif } } - writer.WriteEndObject(); } ApiProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameter.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameter.Serialization.cs index 42242a9fe1c23..2bc1b07b2dee1 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameter.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameter.Serialization.cs @@ -20,6 +20,15 @@ public partial class ArmPolicyParameter : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ArmPolicyParameter)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ParameterType)) { writer.WritePropertyName("type"u8); @@ -87,7 +95,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } ArmPolicyParameter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameterValue.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameterValue.Serialization.cs index 990c06226a677..33ff180a2e49b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameterValue.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameterValue.Serialization.cs @@ -19,6 +19,15 @@ public partial class ArmPolicyParameterValue : 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(ArmPolicyParameterValue)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Value)) { writer.WritePropertyName("value"u8); @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } ArmPolicyParameterValue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AvailabilityZoneMappings.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AvailabilityZoneMappings.Serialization.cs index 09809fa8e6070..9548c514dd28c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AvailabilityZoneMappings.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AvailabilityZoneMappings.Serialization.cs @@ -19,6 +19,15 @@ public partial class AvailabilityZoneMappings : IUtf8JsonSerializable, IJsonMode 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(AvailabilityZoneMappings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(LogicalZone)) { writer.WritePropertyName("logicalZone"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } AvailabilityZoneMappings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AzureRoleDefinition.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AzureRoleDefinition.Serialization.cs index cc877d7a56425..6599e8a99be32 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AzureRoleDefinition.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AzureRoleDefinition.Serialization.cs @@ -20,6 +20,15 @@ public partial class AzureRoleDefinition : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(AzureRoleDefinition)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -78,7 +86,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } AzureRoleDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataManifestCustomResourceFunctionDefinition.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataManifestCustomResourceFunctionDefinition.Serialization.cs index 378c6855e015f..12a1c62f63f80 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataManifestCustomResourceFunctionDefinition.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataManifestCustomResourceFunctionDefinition.Serialization.cs @@ -20,6 +20,15 @@ public partial class DataManifestCustomResourceFunctionDefinition : IUtf8JsonSer 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWrit throw new FormatException($"The model {nameof(DataManifestCustomResourceFunctionDefinition)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWrit #endif } } - writer.WriteEndObject(); } DataManifestCustomResourceFunctionDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestEffect.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestEffect.Serialization.cs index dbfd3b5df3dbf..22d002a8c7996 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestEffect.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestEffect.Serialization.cs @@ -19,6 +19,15 @@ public partial class DataPolicyManifestEffect : IUtf8JsonSerializable, IJsonMode 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(DataPolicyManifestEffect)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -59,7 +67,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } DataPolicyManifestEffect IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestListResult.Serialization.cs index 85b2b17f218ef..b214c45c7532b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class DataPolicyManifestListResult : IUtf8JsonSerializable, IJs 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(DataPolicyManifestListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } DataPolicyManifestListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExportTemplate.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExportTemplate.Serialization.cs index e91c5e0983de6..69d14b4d81b8d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExportTemplate.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExportTemplate.Serialization.cs @@ -18,6 +18,15 @@ public partial class ExportTemplate : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(ExportTemplate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Resources)) { writer.WritePropertyName("resources"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp #endif } } - writer.WriteEndObject(); } ExportTemplate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExtendedLocation.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExtendedLocation.Serialization.cs index 14075d978d7f7..572afd4d6d692 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExtendedLocation.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExtendedLocation.Serialization.cs @@ -21,6 +21,15 @@ public partial class ExtendedLocation : IUtf8JsonSerializable, IJsonModel ((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") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(ExtendedLocation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ExtendedLocationType)) { writer.WritePropertyName("type"u8); @@ -39,7 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - writer.WriteEndObject(); } ExtendedLocation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureOperationsListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureOperationsListResult.Serialization.cs index f49d662b40279..ec5df203f0bfd 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureOperationsListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureOperationsListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class FeatureOperationsListResult : IUtf8JsonSerializable, IJso 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(FeatureOperationsListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } FeatureOperationsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureProperties.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureProperties.Serialization.cs index fad3a49911cf3..01814c34bbe03 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureProperties.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureProperties.Serialization.cs @@ -19,6 +19,15 @@ internal partial class FeatureProperties : IUtf8JsonSerializable, IJsonModel ((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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(FeatureProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(State)) { writer.WritePropertyName("state"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } FeatureProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationExpanded.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationExpanded.Serialization.cs index 423e05df82964..d257299b3e638 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationExpanded.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationExpanded.Serialization.cs @@ -20,6 +20,15 @@ public partial class LocationExpanded : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(LocationExpanded)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -88,7 +96,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } LocationExpanded IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationListResult.Serialization.cs index 1be0960de8092..8ac53b8a5030c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class LocationListResult : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(LocationListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } LocationListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationMetadata.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationMetadata.Serialization.cs index aaf304ef5f975..439a6cf2aef02 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationMetadata.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationMetadata.Serialization.cs @@ -20,6 +20,15 @@ public partial class LocationMetadata : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(LocationMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(RegionType)) { writer.WritePropertyName("regionType"u8); @@ -93,7 +101,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } LocationMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagedByTenant.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagedByTenant.Serialization.cs index 2493ad9c7abf7..f837a94dceb22 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagedByTenant.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagedByTenant.Serialization.cs @@ -19,6 +19,15 @@ public partial class ManagedByTenant : IUtf8JsonSerializable, IJsonModel ((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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(ManagedByTenant)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } ManagedByTenant IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockListResult.Serialization.cs index 6c3ede533dce6..5e9a7022143cc 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ManagementLockListResult : IUtf8JsonSerializable, IJsonMo 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ManagementLockListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ManagementLockListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockOwner.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockOwner.Serialization.cs index 2da4ddcb740f4..0f36e68057651 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockOwner.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockOwner.Serialization.cs @@ -19,6 +19,15 @@ public partial class ManagementLockOwner : IUtf8JsonSerializable, IJsonModel ((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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ManagementLockOwner)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ApplicationId)) { writer.WritePropertyName("applicationId"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } ManagementLockOwner IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/NonComplianceMessage.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/NonComplianceMessage.Serialization.cs index 471857158db0a..6c911878a73bd 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/NonComplianceMessage.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/NonComplianceMessage.Serialization.cs @@ -19,6 +19,15 @@ public partial class NonComplianceMessage : IUtf8JsonSerializable, IJsonModel ((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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(NonComplianceMessage)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); if (Optional.IsDefined(PolicyDefinitionReferenceId)) @@ -49,7 +57,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } NonComplianceMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PairedRegion.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PairedRegion.Serialization.cs index 54fdae29cac46..60229b864f696 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PairedRegion.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PairedRegion.Serialization.cs @@ -19,6 +19,15 @@ public partial class PairedRegion : IUtf8JsonSerializable, IJsonModel ((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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti throw new FormatException($"The model {nameof(PairedRegion)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti #endif } } - writer.WriteEndObject(); } PairedRegion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ParameterDefinitionsValueMetadata.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ParameterDefinitionsValueMetadata.Serialization.cs index 1d57667406756..d984d9aa717d2 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ParameterDefinitionsValueMetadata.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ParameterDefinitionsValueMetadata.Serialization.cs @@ -19,6 +19,15 @@ public partial class ParameterDefinitionsValueMetadata : IUtf8JsonSerializable, 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(ParameterDefinitionsValueMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(DisplayName)) { writer.WritePropertyName("displayName"u8); @@ -59,7 +67,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, } #endif } - writer.WriteEndObject(); } ParameterDefinitionsValueMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Permission.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Permission.Serialization.cs index ff0c633a4e5e0..7afb0b328f522 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Permission.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Permission.Serialization.cs @@ -20,6 +20,15 @@ public partial class Permission : 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(Permission)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(AllowedActions)) { writer.WritePropertyName("actions"u8); @@ -83,7 +91,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption #endif } } - writer.WriteEndObject(); } Permission IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentListResult.Serialization.cs index 026ffd9060554..6a5c7acd560d7 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PolicyAssignmentListResult : IUtf8JsonSerializable, IJson 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(PolicyAssignmentListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } PolicyAssignmentListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentPatch.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentPatch.Serialization.cs index c83f43a5d00a0..5efdac1bffa52 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentPatch.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentPatch.Serialization.cs @@ -19,6 +19,15 @@ public partial class PolicyAssignmentPatch : IUtf8JsonSerializable, IJsonModel

((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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(PolicyAssignmentPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); @@ -75,7 +83,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } PolicyAssignmentPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionGroup.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionGroup.Serialization.cs index f145fa561b384..4b3b6c8e1d51f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionGroup.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionGroup.Serialization.cs @@ -19,6 +19,15 @@ public partial class PolicyDefinitionGroup : IUtf8JsonSerializable, IJsonModel

((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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(PolicyDefinitionGroup)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); if (Optional.IsDefined(DisplayName)) @@ -64,7 +72,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } PolicyDefinitionGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionListResult.Serialization.cs index 269dff46a32f9..9d7db8d819807 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PolicyDefinitionListResult : IUtf8JsonSerializable, IJson 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(PolicyDefinitionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } PolicyDefinitionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionReference.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionReference.Serialization.cs index 372b5609de249..4f4def3f3d7d6 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionReference.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionReference.Serialization.cs @@ -20,6 +20,15 @@ public partial class PolicyDefinitionReference : IUtf8JsonSerializable, IJsonMod 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(PolicyDefinitionReference)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("policyDefinitionId"u8); writer.WriteStringValue(PolicyDefinitionId); if (Optional.IsCollectionDefined(Parameters)) @@ -71,7 +79,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } PolicyDefinitionReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyOverride.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyOverride.Serialization.cs index 5d464bffec9f9..6eef80f3372b4 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyOverride.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyOverride.Serialization.cs @@ -20,6 +20,15 @@ public partial class PolicyOverride : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(PolicyOverride)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Kind)) { writer.WritePropertyName("kind"u8); @@ -63,7 +71,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp #endif } } - writer.WriteEndObject(); } PolicyOverride IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicySetDefinitionListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicySetDefinitionListResult.Serialization.cs index 4093c6a5d9a0d..13a11dccf141f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicySetDefinitionListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicySetDefinitionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PolicySetDefinitionListResult : IUtf8JsonSerializable, IJ 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(PolicySetDefinitionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } PolicySetDefinitionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTag.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTag.Serialization.cs index 22368e5eeea2e..6205ab088dea9 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTag.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTag.Serialization.cs @@ -20,6 +20,15 @@ public partial class PredefinedTag : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt throw new FormatException($"The model {nameof(PredefinedTag)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt #endif } } - writer.WriteEndObject(); } PredefinedTag IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagCount.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagCount.Serialization.cs index 71b47001713fc..98e7ccc1ed4b0 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagCount.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagCount.Serialization.cs @@ -19,6 +19,15 @@ public partial class PredefinedTagCount : IUtf8JsonSerializable, IJsonModel ((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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(PredefinedTagCount)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(PredefinedTagCountType)) { writer.WritePropertyName("type"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } PredefinedTagCount IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagValue.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagValue.Serialization.cs index 9e82f3ad0c4af..516e9a1ef0c83 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagValue.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagValue.Serialization.cs @@ -19,6 +19,15 @@ public partial class PredefinedTagValue : IUtf8JsonSerializable, IJsonModel ((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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(PredefinedTagValue)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } PredefinedTagValue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagsListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagsListResult.Serialization.cs index 2a5682cf99a9b..59964ee8efcb4 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagsListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagsListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PredefinedTagsListResult : IUtf8JsonSerializable, IJsonMo 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(PredefinedTagsListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } PredefinedTagsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderConsentDefinition.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderConsentDefinition.Serialization.cs index 6e5f9de82dccf..de2ed81bac6e4 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderConsentDefinition.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderConsentDefinition.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ProviderConsentDefinition : IUtf8JsonSerializable, IJsonM 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ProviderConsentDefinition)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ConsentToAuthorization)) { writer.WritePropertyName("consentToAuthorization"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ProviderConsentDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderExtendedLocation.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderExtendedLocation.Serialization.cs index 570887448d626..d66f3e57f06ee 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderExtendedLocation.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderExtendedLocation.Serialization.cs @@ -20,6 +20,15 @@ public partial class ProviderExtendedLocation : IUtf8JsonSerializable, IJsonMode 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ProviderExtendedLocation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); @@ -63,7 +71,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ProviderExtendedLocation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermission.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermission.Serialization.cs index 5c537c9d9a538..7212bb4b7dfbd 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermission.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermission.Serialization.cs @@ -19,6 +19,15 @@ public partial class ProviderPermission : IUtf8JsonSerializable, IJsonModel ((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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ProviderPermission)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ApplicationId)) { writer.WritePropertyName("applicationId"u8); @@ -62,7 +70,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } ProviderPermission IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermissionListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermissionListResult.Serialization.cs index d8fb647e5d9f7..0a0d6be0dc291 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermissionListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermissionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ProviderPermissionListResult : IUtf8JsonSerializable, IJs 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(ProviderPermissionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } ProviderPermissionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderRegistrationContent.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderRegistrationContent.Serialization.cs index a77bae917cb73..63848539a3008 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderRegistrationContent.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderRegistrationContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ProviderRegistrationContent : IUtf8JsonSerializable, IJsonM 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(ProviderRegistrationContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ThirdPartyProviderConsent)) { writer.WritePropertyName("thirdPartyProviderConsent"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } ProviderRegistrationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceType.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceType.Serialization.cs index 6f21cb1c7aebd..587103f1d4437 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceType.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceType.Serialization.cs @@ -20,6 +20,15 @@ public partial class ProviderResourceType : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ProviderResourceType)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ResourceType)) { writer.WritePropertyName("resourceType"u8); @@ -129,7 +137,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ProviderResourceType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceTypeListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceTypeListResult.Serialization.cs index 64eeb60a4b171..91da7e4227650 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceTypeListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceTypeListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ProviderResourceTypeListResult : IUtf8JsonSerializable, I 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ProviderResourceTypeListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ProviderResourceTypeListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupExportResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupExportResult.Serialization.cs index 2a3ddd692bd4d..5ff8191bd24fd 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupExportResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupExportResult.Serialization.cs @@ -19,6 +19,15 @@ public partial class ResourceGroupExportResult : IUtf8JsonSerializable, IJsonMod 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ResourceGroupExportResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Template)) { writer.WritePropertyName("template"u8); @@ -59,7 +67,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ResourceGroupExportResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupListResult.Serialization.cs index e47f543391f0b..1e5edf92f0130 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ResourceGroupListResult : IUtf8JsonSerializable, IJsonMod 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(ResourceGroupListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } ResourceGroupListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupPatch.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupPatch.Serialization.cs index bb7f65ae6202a..a8e19e6a3d00c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupPatch.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupPatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourceGroupPatch : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ResourceGroupPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -67,7 +75,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } ResourceGroupPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupProperties.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupProperties.Serialization.cs index 526b2c0624683..9cccfe5f38e2a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupProperties.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupProperties.Serialization.cs @@ -19,6 +19,15 @@ internal partial class ResourceGroupProperties : IUtf8JsonSerializable, IJsonMod 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(ResourceGroupProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } ResourceGroupProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceListResult.Serialization.cs index 813066388772a..d68ec7411af60 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ResourceListResult : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } ResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationContent.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationContent.Serialization.cs index e44d153d46bd9..58476d3125271 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationContent.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourceNameValidationContent : IUtf8JsonSerializable, IJso 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(ResourceNameValidationContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); writer.WritePropertyName("type"u8); @@ -45,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } ResourceNameValidationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationResult.Serialization.cs index 9e0ad373f0010..809ae5172ea55 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationResult.Serialization.cs @@ -19,6 +19,15 @@ public partial class ResourceNameValidationResult : IUtf8JsonSerializable, IJson 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(ResourceNameValidationResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } ResourceNameValidationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceProviderListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceProviderListResult.Serialization.cs index 051a237125d88..8fae636ae0b62 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceProviderListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceProviderListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ResourceProviderListResult : IUtf8JsonSerializable, IJson 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ResourceProviderListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } ResourceProviderListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelector.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelector.Serialization.cs index 33fe62011e9e8..e6fe974926c95 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelector.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelector.Serialization.cs @@ -20,6 +20,15 @@ public partial class ResourceSelector : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(ResourceSelector)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } ResourceSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelectorExpression.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelectorExpression.Serialization.cs index 8a1f357d8fa26..22fbba122b493 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelectorExpression.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelectorExpression.Serialization.cs @@ -20,6 +20,15 @@ public partial class ResourceSelectorExpression : IUtf8JsonSerializable, IJsonMo 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ResourceSelectorExpression)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Kind)) { writer.WritePropertyName("kind"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } ResourceSelectorExpression IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAlias.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAlias.Serialization.cs index 568b8e4b201af..571372dcdac68 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAlias.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAlias.Serialization.cs @@ -20,6 +20,15 @@ public partial class ResourceTypeAlias : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(ResourceTypeAlias)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -78,7 +86,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } ResourceTypeAlias IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPath.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPath.Serialization.cs index cd879b6704891..aff7e430f43ed 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPath.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPath.Serialization.cs @@ -20,6 +20,15 @@ public partial class ResourceTypeAliasPath : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(ResourceTypeAliasPath)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Path)) { writer.WritePropertyName("path"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } ResourceTypeAliasPath IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPathMetadata.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPathMetadata.Serialization.cs index 6ffdc6bd20bb2..701f22e596454 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPathMetadata.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPathMetadata.Serialization.cs @@ -19,6 +19,15 @@ public partial class ResourceTypeAliasPathMetadata : IUtf8JsonSerializable, IJso 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(ResourceTypeAliasPathMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(TokenType)) { writer.WritePropertyName("type"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } ResourceTypeAliasPathMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPattern.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPattern.Serialization.cs index c329c891d237a..ba9f9b86ab88b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPattern.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPattern.Serialization.cs @@ -19,6 +19,15 @@ public partial class ResourceTypeAliasPattern : IUtf8JsonSerializable, IJsonMode 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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ResourceTypeAliasPattern)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Phrase)) { writer.WritePropertyName("phrase"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ResourceTypeAliasPattern IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliases.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliases.Serialization.cs index ff3b568b5a033..68449ede23044 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliases.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliases.Serialization.cs @@ -20,6 +20,15 @@ public partial class ResourceTypeAliases : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ResourceTypeAliases)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ResourceType)) { writer.WritePropertyName("resourceType"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } ResourceTypeAliases IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesMoveContent.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesMoveContent.Serialization.cs index 4ee53eed7f345..af0cb969981db 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesMoveContent.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesMoveContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourcesMoveContent : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ResourcesMoveContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Resources)) { writer.WritePropertyName("resources"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ResourcesMoveContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesSku.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesSku.Serialization.cs index b9f10cfa1d67c..660e8e54ca1da 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesSku.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesSku.Serialization.cs @@ -19,6 +19,15 @@ public partial class ResourcesSku : IUtf8JsonSerializable, IJsonModel ((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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti throw new FormatException($"The model {nameof(ResourcesSku)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -72,7 +80,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti #endif } } - writer.WriteEndObject(); } ResourcesSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionListResult.Serialization.cs index e90c336119e82..d3c9eab490d6a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class SubscriptionListResult : IUtf8JsonSerializable, IJsonMode 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(SubscriptionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -55,7 +63,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } SubscriptionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionPolicies.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionPolicies.Serialization.cs index d197adfc44806..4c76f9420d163 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionPolicies.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionPolicies.Serialization.cs @@ -19,6 +19,15 @@ public partial class SubscriptionPolicies : IUtf8JsonSerializable, IJsonModel ((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") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(SubscriptionPolicies)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(LocationPlacementId)) { writer.WritePropertyName("locationPlacementId"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } SubscriptionPolicies IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Tag.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Tag.Serialization.cs index fa37f1950ae06..a59c794f9c4a8 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Tag.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Tag.Serialization.cs @@ -20,6 +20,15 @@ public partial class Tag : 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions optio throw new FormatException($"The model {nameof(Tag)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(TagValues)) { writer.WritePropertyName("tags"u8); @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions optio #endif } } - writer.WriteEndObject(); } Tag IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TagResourcePatch.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TagResourcePatch.Serialization.cs index 231978c1cf8a4..6b38b23fe44f7 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TagResourcePatch.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TagResourcePatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class TagResourcePatch : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(TagResourcePatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(PatchMode)) { writer.WritePropertyName("operation"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } TagResourcePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantListResult.Serialization.cs index 4fb72a8f9201e..b9c54190beef0 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class TenantListResult : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(TenantListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -55,7 +63,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } TenantListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProvider.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProvider.Serialization.cs index ff2e393a3e13a..f83eac99ea15d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProvider.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProvider.Serialization.cs @@ -20,6 +20,15 @@ public partial class TenantResourceProvider : 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(TenantResourceProvider)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Namespace)) { writer.WritePropertyName("namespace"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } TenantResourceProvider IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProviderListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProviderListResult.Serialization.cs index 0562f86cd566f..c025e50416f34 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProviderListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProviderListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class TenantResourceProviderListResult : IUtf8JsonSerializable, 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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(TenantResourceProviderListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } TenantResourceProviderListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TrackedResourceExtendedData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TrackedResourceExtendedData.Serialization.cs index de3348ac496f6..d5bb046198b5c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TrackedResourceExtendedData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TrackedResourceExtendedData.Serialization.cs @@ -21,6 +21,15 @@ public partial class TrackedResourceExtendedData : IUtf8JsonSerializable, IJsonM 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") @@ -28,61 +37,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(TrackedResourceExtendedData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(ExtendedLocation)) { writer.WritePropertyName("extendedLocation"u8); JsonSerializer.Serialize(writer, ExtendedLocation); } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } TrackedResourceExtendedData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ZoneMapping.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ZoneMapping.Serialization.cs index 1433a299b116c..c45254f78852f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ZoneMapping.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ZoneMapping.Serialization.cs @@ -20,6 +20,15 @@ public partial class ZoneMapping : IUtf8JsonSerializable, IJsonModel ((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") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio throw new FormatException($"The model {nameof(ZoneMapping)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio #endif } } - writer.WriteEndObject(); } ZoneMapping IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyAssignmentData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyAssignmentData.Serialization.cs index df267a4d49770..7e9808995fe8b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyAssignmentData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyAssignmentData.Serialization.cs @@ -22,6 +22,15 @@ public partial class PolicyAssignmentData : IUtf8JsonSerializable, IJsonModel ((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") @@ -29,7 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(PolicyAssignmentData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); @@ -40,26 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("identity"u8); JsonSerializer.Serialize(writer, ManagedIdentity); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(DisplayName)) @@ -151,22 +140,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteEndArray(); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } PolicyAssignmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyDefinitionData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyDefinitionData.Serialization.cs index 3836c542f8cc6..e4935a90368b9 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyDefinitionData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyDefinitionData.Serialization.cs @@ -22,6 +22,15 @@ public partial class PolicyDefinitionData : IUtf8JsonSerializable, IJsonModel ((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") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(PolicyDefinitionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(PolicyType)) @@ -108,22 +97,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteEndObject(); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } PolicyDefinitionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicySetDefinitionData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicySetDefinitionData.Serialization.cs index d7ce790cb2d4c..13f1c68035bf2 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicySetDefinitionData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicySetDefinitionData.Serialization.cs @@ -22,6 +22,15 @@ public partial class PolicySetDefinitionData : 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") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(PolicySetDefinitionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(PolicyType)) @@ -111,22 +100,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndArray(); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } PolicySetDefinitionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceGroupData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceGroupData.Serialization.cs index 5470a8e357385..30db19d72c006 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceGroupData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceGroupData.Serialization.cs @@ -22,6 +22,15 @@ public partial class ResourceGroupData : IUtf8JsonSerializable, IJsonModel ((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") @@ -29,7 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(ResourceGroupData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); @@ -40,55 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WritePropertyName("managedBy"u8); writer.WriteStringValue(ManagedBy); } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ResourceGroupData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceProviderData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceProviderData.Serialization.cs index efa3d7ecc575b..09a197ac5b38a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceProviderData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceProviderData.Serialization.cs @@ -21,6 +21,15 @@ public partial class ResourceProviderData : IUtf8JsonSerializable, IJsonModel ((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") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ResourceProviderData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -79,7 +87,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ResourceProviderData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionData.Serialization.cs index 8e0b296a7177d..7f1b670bbf7c8 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionData.Serialization.cs @@ -21,6 +21,15 @@ public partial class SubscriptionData : IUtf8JsonSerializable, IJsonModel ((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") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(SubscriptionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -100,7 +108,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } SubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TagResourceData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TagResourceData.Serialization.cs index c05bd1e2d23fb..5d759587ddc1b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TagResourceData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TagResourceData.Serialization.cs @@ -21,6 +21,15 @@ public partial class TagResourceData : IUtf8JsonSerializable, IJsonModel ((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") @@ -28,45 +37,9 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(TagResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } TagResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantData.Serialization.cs index 9268e49f2df5a..b264d2aaf9ea4 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantData.Serialization.cs @@ -21,6 +21,15 @@ public partial class TenantData : 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") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(TenantData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -99,7 +107,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption #endif } } - writer.WriteEndObject(); } TenantData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md b/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md index 3735f0952b5c4..890262e0e366b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md +++ b/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md @@ -13,6 +13,7 @@ head-as-boolean: false modelerfour: lenient-model-deduplication: true use-model-reader-writer: true +use-write-core: true deserialize-null-collection-as-null-value: true enable-bicep-serialization: true diff --git a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType1.json b/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType1.json index 247352e809cb2..4eb18e12d02ef 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType1.json +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType1.json @@ -1,4 +1,6 @@ -{ +{ + "tags": {}, + "location": "eastus", "plan": { "name": "NameForPlan", "publisher": "PublisherForPlan", @@ -15,7 +17,5 @@ "family": "FamilyForSku", "model": "ModelForSku", "capacity": 15464547 - }, - "tags": {}, - "location": "eastus" + } } diff --git a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType2.json b/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType2.json index bf11cf30ce47e..472418a3dbda6 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType2.json +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType2.json @@ -1,4 +1,9 @@ -{ +{ + "tags": { + "key1": "value1", + "key2": "value2" + }, + "location": "eastus", "plan": { "name": "NameForPlan", "publisher": "PublisherForPlan", @@ -15,10 +20,5 @@ "family": "FamilyForSku", "model": "ModelForSku", "capacity": 15464547 - }, - "tags": { - "key1": "value1", - "key2": "value2" - }, - "location": "eastus" + } } From 11e5659fcbac9624872a052133942892926dd773 Mon Sep 17 00:00:00 2001 From: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> Date: Wed, 28 Aug 2024 10:45:04 -0400 Subject: [PATCH 40/71] Update System.Text.Json (#45416) * Update System.Text.Json and System.Memory.Data * fix core tests * fix * updates * data factory fix * fix obsolete values p1 * revert System.Memory.Data upgrade :( * update * changelog * Update sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryLinkedServiceReference.Serialization.cs Co-authored-by: Christopher Scott * Update DataFactoryLinkedServiceReference.Serialization.cs --------- Co-authored-by: Christopher Scott --- eng/Packages.Data.props | 2 +- .../Azure.Security.Attestation/src/AttestationToken.cs | 3 ++- .../src/DataFactoryKeyVaultSecret.Serialization.cs | 4 ++-- .../src/DataFactoryLinkedServiceReference.Serialization.cs | 2 +- .../tests/DataFactoryElementTests.cs | 6 +++--- sdk/core/Azure.Core/CHANGELOG.md | 1 + .../internal/Convenience/SSE/ClientResultCollectionTests.cs | 6 +++--- .../Azure.AI.Personalizer/src/Azure.AI.Personalizer.csproj | 2 ++ .../Azure.AI.Personalizer/src/Models/RlNetProcessor.cs | 3 ++- .../Azure.AI.Personalizer/src/Models/RlObjectConverter.cs | 3 ++- 10 files changed, 19 insertions(+), 13 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 42974732c555b..22fd978ea74da 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -98,7 +98,7 @@ - + diff --git a/sdk/attestation/Azure.Security.Attestation/src/AttestationToken.cs b/sdk/attestation/Azure.Security.Attestation/src/AttestationToken.cs index 7ad749047d522..f972e740f6a95 100644 --- a/sdk/attestation/Azure.Security.Attestation/src/AttestationToken.cs +++ b/sdk/attestation/Azure.Security.Attestation/src/AttestationToken.cs @@ -13,6 +13,7 @@ using System.Linq; using System.ComponentModel; using Azure.Core.Pipeline; +using System.Text.Json.Serialization; namespace Azure.Security.Attestation { @@ -658,7 +659,7 @@ private static string GenerateSecuredJsonWebToken(BinaryData body, AttestationTo }; var serializationOptions = new JsonSerializerOptions { - IgnoreNullValues = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }; byte[] jwtHeader = JsonSerializer.SerializeToUtf8Bytes(header, serializationOptions); string encodedHeader = Base64Url.Encode(jwtHeader); diff --git a/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryKeyVaultSecret.Serialization.cs b/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryKeyVaultSecret.Serialization.cs index 18e4ef20c2e61..b71d6428aca4d 100644 --- a/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryKeyVaultSecret.Serialization.cs +++ b/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryKeyVaultSecret.Serialization.cs @@ -35,7 +35,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } DataFactoryLinkedServiceReference? store = default; DataFactoryElement? secretName = default; - Optional> secretVersion = default; + DataFactoryElement? secretVersion = default; string? type = default; foreach (var property in element.EnumerateObject()) { @@ -64,7 +64,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) continue; } } - return new DataFactoryKeyVaultSecret(type, store, secretName, secretVersion.Value); + return new DataFactoryKeyVaultSecret(type, store, secretName, secretVersion); } internal partial class DataFactoryKeyVaultSecretConverter : JsonConverter diff --git a/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryLinkedServiceReference.Serialization.cs b/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryLinkedServiceReference.Serialization.cs index 76724f0c94cfe..6eb0435168476 100644 --- a/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryLinkedServiceReference.Serialization.cs +++ b/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryLinkedServiceReference.Serialization.cs @@ -54,7 +54,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { if (property.NameEquals("type"u8)) { - kind = new DataFactoryLinkedServiceReferenceKind(property.Value.GetString()); + kind = new DataFactoryLinkedServiceReferenceKind(property.Value.GetString() ?? string.Empty); continue; } if (property.NameEquals("referenceName"u8)) diff --git a/sdk/core/Azure.Core.Expressions.DataFactory/tests/DataFactoryElementTests.cs b/sdk/core/Azure.Core.Expressions.DataFactory/tests/DataFactoryElementTests.cs index 57fe13ad079f9..54a7b6088bd63 100644 --- a/sdk/core/Azure.Core.Expressions.DataFactory/tests/DataFactoryElementTests.cs +++ b/sdk/core/Azure.Core.Expressions.DataFactory/tests/DataFactoryElementTests.cs @@ -1021,10 +1021,10 @@ private static void AssertListOfStringDfe(DataFactoryElement> dfe) private static void AssertBinaryDataDfe(DataFactoryElement dfe) { - var model = dfe.Literal!.ToObjectFromJson(); + TestModel? model = dfe.Literal!.ToObjectFromJson(); Assert.IsNotNull(model); - Assert.AreEqual(1, model.A); - Assert.IsTrue(model.B); + Assert.AreEqual(1, model?.A); + Assert.IsTrue(model?.B); } [Test] diff --git a/sdk/core/Azure.Core/CHANGELOG.md b/sdk/core/Azure.Core/CHANGELOG.md index d35fa12939afc..c723c964a0bc3 100644 --- a/sdk/core/Azure.Core/CHANGELOG.md +++ b/sdk/core/Azure.Core/CHANGELOG.md @@ -10,6 +10,7 @@ ### Other Changes +- Upgraded dependency on System.Text.Json to 6.0.9 - Added a new constructor on `AzureEventSourceListener` for callers that don't need the formatted message ([#45191](https://github.com/Azure/azure-sdk-for-net/pull/45191)). ## 1.42.0 (2024-08-01) diff --git a/sdk/core/System.ClientModel/tests/internal/Convenience/SSE/ClientResultCollectionTests.cs b/sdk/core/System.ClientModel/tests/internal/Convenience/SSE/ClientResultCollectionTests.cs index d9f896e7769e8..03a28295bb769 100644 --- a/sdk/core/System.ClientModel/tests/internal/Convenience/SSE/ClientResultCollectionTests.cs +++ b/sdk/core/System.ClientModel/tests/internal/Convenience/SSE/ClientResultCollectionTests.cs @@ -121,10 +121,10 @@ public async Task EnumeratesDataValues() int i = 0; await foreach (BinaryData data in result.GetRawResponse().EnumerateDataEvents()) { - MockJsonModel model = data.ToObjectFromJson(); + MockJsonModel? model = data.ToObjectFromJson(); - Assert.AreEqual(i, model.IntValue); - Assert.AreEqual(i.ToString(), model.StringValue); + Assert.AreEqual(i, model?.IntValue); + Assert.AreEqual(i.ToString(), model?.StringValue); i++; } diff --git a/sdk/personalizer/Azure.AI.Personalizer/src/Azure.AI.Personalizer.csproj b/sdk/personalizer/Azure.AI.Personalizer/src/Azure.AI.Personalizer.csproj index 7340bc57ca40b..9ec946133f5ee 100644 --- a/sdk/personalizer/Azure.AI.Personalizer/src/Azure.AI.Personalizer.csproj +++ b/sdk/personalizer/Azure.AI.Personalizer/src/Azure.AI.Personalizer.csproj @@ -22,6 +22,8 @@ + + diff --git a/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlNetProcessor.cs b/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlNetProcessor.cs index 3c946b9f9bbe5..6961378d954cc 100644 --- a/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlNetProcessor.cs +++ b/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlNetProcessor.cs @@ -8,6 +8,7 @@ using System.Globalization; using System.Linq; using System.Text.Json; +using System.Text.Json.Serialization; using Rl.Net; namespace Azure.AI.Personalizer @@ -95,7 +96,7 @@ public Response Rank(PersonalizerRankMultiSlotO { new JsonBinaryDataConverter(), }, - IgnoreNullValues = true + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }; var contextJson = JsonSerializer.Serialize(decisionContext, jsonSerializerOptions); ActionFlags flags = options.DeferActivation == true ? ActionFlags.Deferred : ActionFlags.Default; diff --git a/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlObjectConverter.cs b/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlObjectConverter.cs index 7d88a0c68ba19..7e8a182e24fe3 100644 --- a/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlObjectConverter.cs +++ b/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlObjectConverter.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using Azure.Core; +using System.Text.Json.Serialization; namespace Azure.AI.Personalizer { @@ -24,7 +25,7 @@ public static string ConvertToContextJson(IList contextFeatures, Lis { new JsonBinaryDataConverter(), }, - IgnoreNullValues = true + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }; return JsonSerializer.Serialize(decisionContext, jsonSerializerOptions); } From 7cbc5e0af32ab0e4dc741e4d9594fc1ca0d23519 Mon Sep 17 00:00:00 2001 From: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:02:59 -0400 Subject: [PATCH 41/71] docs updates (#45710) --- .../src/Administration/QueueRuntimeProperties.cs | 3 ++- .../src/Administration/SubscriptionRuntimeProperties.cs | 2 +- .../src/Administration/TopicRuntimeProperties.cs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/QueueRuntimeProperties.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/QueueRuntimeProperties.cs index 23924c3e71b80..39a7b06588da7 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/QueueRuntimeProperties.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/QueueRuntimeProperties.cs @@ -66,7 +66,8 @@ internal QueueRuntimeProperties(string name) public DateTimeOffset UpdatedAt { get; internal set; } ///

- /// The when the entity was last accessed. + /// The of the last time a message was sent or + /// the last time there was a receive request to this queue. /// public DateTimeOffset AccessedAt { get; internal set; } } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/SubscriptionRuntimeProperties.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/SubscriptionRuntimeProperties.cs index 800e310fbf4fe..7f34826428ae5 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/SubscriptionRuntimeProperties.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/SubscriptionRuntimeProperties.cs @@ -52,7 +52,7 @@ internal SubscriptionRuntimeProperties(string topicName, string subscriptionName public long TransferDeadLetterMessageCount { get; internal set; } /// - /// The when the entity was last accessed. + /// The of the last time there was a receive request to this subscription. /// public DateTimeOffset AccessedAt { get; internal set; } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/TopicRuntimeProperties.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/TopicRuntimeProperties.cs index b09dd8cf1d2ee..d24dc7d723f7a 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/TopicRuntimeProperties.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/TopicRuntimeProperties.cs @@ -21,7 +21,7 @@ internal TopicRuntimeProperties(string name) public string Name { get; internal set; } /// - /// The when the entity was last accessed. + /// The at which a message was last sent to the topic. /// public DateTimeOffset AccessedAt { get; internal set; } From 1047507c0df26e19da41d03687ec1d043e9bd33a Mon Sep 17 00:00:00 2001 From: Anne Thompson <21269347+annelo-msft@users.noreply.github.com> Date: Wed, 28 Aug 2024 08:16:45 -0700 Subject: [PATCH 42/71] Azure.Core | Remove unused HttpClient request callback (#45696) * remove unused HttpClient request option * CHANGELOG --- sdk/core/Azure.Core/CHANGELOG.md | 1 + sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/core/Azure.Core/CHANGELOG.md b/sdk/core/Azure.Core/CHANGELOG.md index c723c964a0bc3..29ecdafa3da1a 100644 --- a/sdk/core/Azure.Core/CHANGELOG.md +++ b/sdk/core/Azure.Core/CHANGELOG.md @@ -12,6 +12,7 @@ - Upgraded dependency on System.Text.Json to 6.0.9 - Added a new constructor on `AzureEventSourceListener` for callers that don't need the formatted message ([#45191](https://github.com/Azure/azure-sdk-for-net/pull/45191)). +- Remove unused callback from `HttpRequestMessage` options in `HttpClientTransport` transport. ## 1.42.0 (2024-08-01) diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs b/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs index 0d2e840e1185b..07f21a103c9a2 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs @@ -18,8 +18,6 @@ namespace Azure.Core.Pipeline /// public partial class HttpClientTransport : HttpPipelineTransport, IDisposable { - internal const string MessageForServerCertificateCallback = "MessageForServerCertificateCallback"; - /// /// A shared instance of with default parameters. /// @@ -85,7 +83,6 @@ private async ValueTask ProcessSyncOrAsync(HttpMessage message, bool async) #pragma warning restore CA1801 { using HttpRequestMessage httpRequest = BuildRequestMessage(message); - SetPropertiesOrOptions(httpRequest, MessageForServerCertificateCallback, message); HttpResponseMessage responseMessage; Stream? contentStream = null; message.ClearResponse(); From 7cdd9967b408897168d635702cd796c603b89193 Mon Sep 17 00:00:00 2001 From: Jocelyn <41338290+jaschrep-msft@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:25:04 -0400 Subject: [PATCH 43/71] TransferManager fixes (#45714) * channel reader tasks not static channel readers tasks were static fields but held nonstatic method execution and cancelled with object disposal. * remove channel getters and setters in transfermanager setters imply these are meant to change over object lifetime, but there is no code that does so and such a change is incompatible with the object lifetime tasks * remove unused checkpointer options field this was maybe leftover from when options were passed around for reconstruction of checkpointer across packages? that doesn't seem to be the case anymore. it's a private field and is never accessed outside of constructor. * unused property --- .../src/TransferManager.cs | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs b/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs index 886ec4ff88e5d..9ec0316402faf 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs @@ -20,35 +20,31 @@ namespace Azure.Storage.DataMovement /// public class TransferManager : IAsyncDisposable { - // Indicates whether the current thread is processing Jobs. - private static Task _currentTaskIsProcessingJob; - - // Indicates whether the current thread is processing Jobs Parts. - private static Task _currentTaskIsProcessingJobPart; - - // Indicates whether the current thread is processing Jobs Chunks. - private static Task _currentTaskIsProcessingJobChunk; + // Async channel reader tasks. These loop for the lifetime of the object. + private readonly Task _currentTaskIsProcessingJob; + private readonly Task _currentTaskIsProcessingJobPart; + private readonly Task _currentTaskIsProcessingJobChunk; /// /// Channel of Jobs waiting to divided into job parts/files. /// /// Limit 1 task to convert jobs to job parts. /// - private Channel _jobsToProcessChannel { get; set; } + private readonly Channel _jobsToProcessChannel; /// /// Channel of Job parts / files to be divided into chunks / requests /// /// Limit 64 tasks to convert job parts to chunks. /// - private Channel _partsToProcessChannel { get; set; } + private readonly Channel _partsToProcessChannel; /// /// Channel of Job chunks / requests to send to the service. /// /// Limit 4-300/Max amount of tasks allowed to process chunks. /// - private Channel> _chunksToProcessChannel { get; set; } + private readonly Channel> _chunksToProcessChannel; /// /// This value can fluctuate depending on if we've reached max capacity @@ -67,7 +63,6 @@ public class TransferManager : IAsyncDisposable /// If unspecified will default to LocalTransferCheckpointer at {currentpath}/.azstoragedml /// internal TransferCheckpointer _checkpointer; - private TransferCheckpointStoreOptions _checkpointerOptions; internal readonly List _resumeProviders; @@ -85,11 +80,7 @@ public class TransferManager : IAsyncDisposable private CancellationTokenSource _channelCancellationTokenSource; private CancellationToken _cancellationToken => _channelCancellationTokenSource.Token; - /// - /// Array pools for reading from streams to upload - /// - internal ArrayPool UploadArrayPool => _arrayPool; - private ArrayPool _arrayPool; + private readonly ArrayPool _arrayPool; internal ClientDiagnostics ClientDiagnostics { get; } @@ -127,8 +118,8 @@ public TransferManager(TransferManagerOptions options = default) _currentTaskIsProcessingJobPart = Task.Run(() => NotifyOfPendingJobPartProcessing()); _currentTaskIsProcessingJobChunk = Task.Run(() => NotifyOfPendingJobChunkProcessing()); _maxJobChunkTasks = options?.MaximumConcurrency ?? DataMovementConstants.MaxJobChunkTasks; - _checkpointerOptions = options?.CheckpointerOptions != default ? new TransferCheckpointStoreOptions(options.CheckpointerOptions) : default; - _checkpointer = _checkpointerOptions != default ? _checkpointerOptions.GetCheckpointer() : CreateDefaultCheckpointer(); + TransferCheckpointStoreOptions checkpointerOptions = options?.CheckpointerOptions != default ? new TransferCheckpointStoreOptions(options.CheckpointerOptions) : default; + _checkpointer = checkpointerOptions != default ? checkpointerOptions.GetCheckpointer() : CreateDefaultCheckpointer(); _resumeProviders = options?.ResumeProviders != null ? new(options.ResumeProviders) : new(); _dataTransfers = new Dictionary(); _arrayPool = ArrayPool.Shared; From 198d91a04852a4890e8ce6e73264c8a0220db553 Mon Sep 17 00:00:00 2001 From: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:01:26 -0400 Subject: [PATCH 44/71] Add SCM to aot checks (#45716) --- sdk/core/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index 99c66b9e72341..be4ac396948f4 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -58,6 +58,8 @@ extends: AOTTestInputs: - ArtifactName: Azure.Core ExpectedWarningsFilepath: /Azure.Core/tests/compatibility/ExpectedAotWarnings.txt + - ArtifactName: System.ClientModel + ExpectedWarningsFilepath: None TestSetupSteps: - template: /sdk/storage/tests-install-azurite.yml From 0015eacad6aeec6a227d8dfa07ed9d723025805b Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:11:06 -0700 Subject: [PATCH 45/71] Sync eng/common directory with azure-sdk-tools for PR 8878 (#45722) * Apply a few changes to Get-PRPackageProperties to make it more customizable for our users. Remove wonky gap + extra spacing that should pass the patch application process now that we've manually aligned common.ps1 * account for feedback -- rename CanaryPackages to AdditionalValidationPackages * dependentPackagesforInclusion -> additionalValidationPackages --------- Co-authored-by: Scott Beddall --- eng/common/scripts/Package-Properties.ps1 | 21 ++++++++++++++------- eng/common/scripts/common.ps1 | 3 ++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index 2250b4f80ba68..6a70070beb562 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -15,7 +15,7 @@ class PackageProps [boolean]$IsNewSdk [string]$ArtifactName [string]$ReleaseStatus - [string[]]$DependentPackages + [string[]]$AdditionalValidationPackages PackageProps([string]$name, [string]$version, [string]$directoryPath, [string]$serviceDirectory) { @@ -113,7 +113,7 @@ function Get-PrPkgProperties([string]$InputDiffJson) { $diff = Get-Content $InputDiffJson | ConvertFrom-Json $targetedFiles = $diff.ChangedFiles - $dependentPackagesForInclusion = @() + $additionalValidationPackages = @() $lookup = @{} foreach ($pkg in $allPackageProperties) @@ -129,19 +129,26 @@ function Get-PrPkgProperties([string]$InputDiffJson) { if ($shouldInclude) { $packagesWithChanges += $pkg - if ($pkg.DependentPackages) { - $dependentPackagesForInclusion += $pkg.DependentPackages + if ($pkg.AdditionalValidationPackages) { + $additionalValidationPackages += $pkg.AdditionalValidationPackages } } } } - foreach ($addition in $dependentPackagesForInclusion) { - if ($lookup[$addition]) { - $packagesWithChanges += $lookup[$addition] + foreach ($addition in $additionalValidationPackages) { + $key = $addition.Replace($RepoRoot, "").SubString(1) + + if ($lookup[$key]) { + $packagesWithChanges += $lookup[$key] } } + if ($AdditionalValidationPackagesFromPackageSetFn -and (Test-Path "Function:$AdditionalValidationPackagesFromPackageSetFn")) + { + $packagesWithChanges += &$AdditionalValidationPackagesFromPackageSetFn $packagesWithChanges $diff + } + return $packagesWithChanges } diff --git a/eng/common/scripts/common.ps1 b/eng/common/scripts/common.ps1 index 0025d1c6fe663..831b4719f88a2 100644 --- a/eng/common/scripts/common.ps1 +++ b/eng/common/scripts/common.ps1 @@ -62,7 +62,8 @@ $GetEmitterAdditionalOptionsFn = "Get-${Language}-EmitterAdditionalOptions" $GetEmitterNameFn = "Get-${Language}-EmitterName" $GetDirectoriesForGenerationFn = "Get-${Language}-DirectoriesForGeneration" $UpdateGeneratedSdksFn = "Update-${Language}-GeneratedSdks" -$IsApiviewStatusCheckRequiredFn = "Get-${Language}-ApiviewStatusCheckRequirement" +$IsApiviewStatusCheckRequiredFn = "Get-${Language}-ApiviewStatusCheckRequirement" +$AdditionalValidationPackagesFromPackageSetFn = "Get-${Language}-AdditionalValidationPackagesFromPackageSet" # Expected to be set in eng/scripts/docs/Docs-Onboarding.ps1 $SetDocsPackageOnboarding = "Set-${Language}-DocsPackageOnboarding" From 67ad5395bacf18163f5d8a958b96fb77e4cbe4e2 Mon Sep 17 00:00:00 2001 From: jecmenicanikola <122357154+jecmenicanikola@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:55:17 -0700 Subject: [PATCH 46/71] Update samples (#45721) --- sdk/maps/Azure.Maps.Search/README.md | 53 +++++++++++++++---- .../samples/MapsSearchSamples.md | 53 +++++++++++++++---- .../tests/Samples/SearchClientSamples.cs | 53 +++++++++++++++---- 3 files changed, 129 insertions(+), 30 deletions(-) diff --git a/sdk/maps/Azure.Maps.Search/README.md b/sdk/maps/Azure.Maps.Search/README.md index 05f6ff8d7b1ab..900f7fbf0d596 100644 --- a/sdk/maps/Azure.Maps.Search/README.md +++ b/sdk/maps/Azure.Maps.Search/README.md @@ -144,10 +144,11 @@ You can familiarize yourself with different APIs using our [samples](https://git ### Example Get Geocoding ```C# Snippet:GetGeocoding -var query = "15171 NE 24th St, Redmond, WA 98052, United States"; -Response result = client.GetGeocoding(query); -Console.WriteLine("Result for query: \"{0}\"", query); -Console.WriteLine(result); +Response searchResult = client.GetGeocoding("1 Microsoft Way, Redmond, WA 98052"); +for (int i = 0; i < searchResult.Value.Features.Count; i++) +{ + Console.WriteLine("Coordinate:" + string.Join(",", searchResult.Value.Features[i].Geometry.Coordinates)); +} ``` ### Example Get Geocoding Batch @@ -161,11 +162,19 @@ List queries = new List }, new GeocodingQuery() { - Coordinates = new GeoPosition(121.5, 25.0) + AddressLine = "400 Broad St" }, }; Response results = client.GetGeocodingBatch(queries); -Console.WriteLine(results); + +//Print coordinates +for (var i = 0; i < results.Value.BatchItems.Count; i++) +{ + for (var j = 0; j < results.Value.BatchItems[i].Features.Count; j++) + { + Console.WriteLine("Coordinates: " + string.Join(",", results.Value.BatchItems[i].Features[j].Geometry.Coordinates)); + } +} ``` ### Example Get Polygon @@ -173,10 +182,20 @@ Console.WriteLine(results); ```C# Snippet:GetPolygon GetPolygonOptions options = new GetPolygonOptions() { - Coordinates = new GeoPosition(121.5, 25.0) + Coordinates = new GeoPosition(-122.204141, 47.61256), + ResultType = BoundaryResultTypeEnum.Locality, + Resolution = ResolutionEnum.Small, }; Response result = client.GetPolygon(options); -Console.WriteLine(result); +var count = ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates.Count; +for (var i = 0; i < count; i++) +{ + var coorCount = ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates[i].Count; + for (var j = 0; j < coorCount; j++) + { + Console.WriteLine(string.Join(",", ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates[i][j])); + } +} ``` ### Example Get Reverse Geocoding @@ -184,6 +203,12 @@ Console.WriteLine(result); ```C# Snippet:GetReverseGeocoding GeoPosition coordinates = new GeoPosition(-122.138685, 47.6305637); Response result = client.GetReverseGeocoding(coordinates); + +//Print addresses +for (int i = 0; i < result.Value.Features.Count; i++) +{ + Console.WriteLine(result.Value.Features[i].Properties.Address.FormattedAddress); +} ``` ### Example Get Reverse Geocoding Batch @@ -193,14 +218,22 @@ List items = new List { new ReverseGeocodingQuery() { - Coordinates = new GeoPosition(121.53, 25.0) + Coordinates = new GeoPosition(-122.349309, 47.620498) }, new ReverseGeocodingQuery() { - Coordinates = new GeoPosition(121.5, 25.0) + Coordinates = new GeoPosition(-122.138679, 47.630356), + ResultTypes = new List(){ ReverseGeocodingResultTypeEnum.Address, ReverseGeocodingResultTypeEnum.Neighborhood } }, }; Response result = client.GetReverseGeocodingBatch(items); + +//Print addresses +for (var i = 0; i < result.Value.BatchItems.Count; i++) +{ + Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.AddressLine); + Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.Neighborhood); +} ``` ## Troubleshooting diff --git a/sdk/maps/Azure.Maps.Search/samples/MapsSearchSamples.md b/sdk/maps/Azure.Maps.Search/samples/MapsSearchSamples.md index 4dd6f46e4d63e..7558a9564c29c 100644 --- a/sdk/maps/Azure.Maps.Search/samples/MapsSearchSamples.md +++ b/sdk/maps/Azure.Maps.Search/samples/MapsSearchSamples.md @@ -34,10 +34,11 @@ MapsSearchClient client = new MapsSearchClient(credential, clientId); Most of the time, we only want to search for a specific address. We can call `GetGeocoding` (or `GetGeocodingAsync` for asynchronous call): ```C# Snippet:GetGeocoding -var query = "15171 NE 24th St, Redmond, WA 98052, United States"; -Response result = client.GetGeocoding(query); -Console.WriteLine("Result for query: \"{0}\"", query); -Console.WriteLine(result); +Response searchResult = client.GetGeocoding("1 Microsoft Way, Redmond, WA 98052"); +for (int i = 0; i < searchResult.Value.Features.Count; i++) +{ + Console.WriteLine("Coordinate:" + string.Join(",", searchResult.Value.Features[i].Geometry.Coordinates)); +} ``` You can also search multiple addresses. If the queries are less than 100, use `GetGeocodingBatch` (or `GetGeocodingBatchAsync` for asynchronous call): @@ -51,11 +52,19 @@ List queries = new List }, new GeocodingQuery() { - Coordinates = new GeoPosition(121.5, 25.0) + AddressLine = "400 Broad St" }, }; Response results = client.GetGeocodingBatch(queries); -Console.WriteLine(results); + +//Print coordinates +for (var i = 0; i < results.Value.BatchItems.Count; i++) +{ + for (var j = 0; j < results.Value.BatchItems[i].Features.Count; j++) + { + Console.WriteLine("Coordinates: " + string.Join(",", results.Value.BatchItems[i].Features[j].Geometry.Coordinates)); + } +} ``` ## Get Polygon @@ -63,10 +72,20 @@ Console.WriteLine(results); ```C# Snippet:GetPolygon GetPolygonOptions options = new GetPolygonOptions() { - Coordinates = new GeoPosition(121.5, 25.0) + Coordinates = new GeoPosition(-122.204141, 47.61256), + ResultType = BoundaryResultTypeEnum.Locality, + Resolution = ResolutionEnum.Small, }; Response result = client.GetPolygon(options); -Console.WriteLine(result); +var count = ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates.Count; +for (var i = 0; i < count; i++) +{ + var coorCount = ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates[i].Count; + for (var j = 0; j < coorCount; j++) + { + Console.WriteLine(string.Join(",", ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates[i][j])); + } +} ``` ## Get Reverse Geocoding @@ -77,6 +96,12 @@ Translate a coordinate (example: 37.786505, -122.3862) into a human understandab ```C# Snippet:GetReverseGeocoding GeoPosition coordinates = new GeoPosition(-122.138685, 47.6305637); Response result = client.GetReverseGeocoding(coordinates); + +//Print addresses +for (int i = 0; i < result.Value.Features.Count; i++) +{ + Console.WriteLine(result.Value.Features[i].Properties.Address.FormattedAddress); +} ``` You can also search multiple coordinates. If the queries are less than 100, use `GetReverseGeocodingBatch` (or `GetReverseGeocodingBatchAsync` for asynchronous call): @@ -86,12 +111,20 @@ List items = new List { new ReverseGeocodingQuery() { - Coordinates = new GeoPosition(121.53, 25.0) + Coordinates = new GeoPosition(-122.349309, 47.620498) }, new ReverseGeocodingQuery() { - Coordinates = new GeoPosition(121.5, 25.0) + Coordinates = new GeoPosition(-122.138679, 47.630356), + ResultTypes = new List(){ ReverseGeocodingResultTypeEnum.Address, ReverseGeocodingResultTypeEnum.Neighborhood } }, }; Response result = client.GetReverseGeocodingBatch(items); + +//Print addresses +for (var i = 0; i < result.Value.BatchItems.Count; i++) +{ + Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.AddressLine); + Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.Neighborhood); +} ``` diff --git a/sdk/maps/Azure.Maps.Search/tests/Samples/SearchClientSamples.cs b/sdk/maps/Azure.Maps.Search/tests/Samples/SearchClientSamples.cs index ea1bf4f5d509c..ddfd042d8d257 100644 --- a/sdk/maps/Azure.Maps.Search/tests/Samples/SearchClientSamples.cs +++ b/sdk/maps/Azure.Maps.Search/tests/Samples/SearchClientSamples.cs @@ -87,10 +87,11 @@ public void GetGeocoding() var clientId = TestEnvironment.MapAccountClientId; var client = new MapsSearchClient(TestEnvironment.Credential, clientId, clientOptions); #region Snippet:GetGeocoding - var query = "15171 NE 24th St, Redmond, WA 98052, United States"; - Response result = client.GetGeocoding(query); - Console.WriteLine("Result for query: \"{0}\"", query); - Console.WriteLine(result); + Response searchResult = client.GetGeocoding("1 Microsoft Way, Redmond, WA 98052"); + for (int i = 0; i < searchResult.Value.Features.Count; i++) + { + Console.WriteLine("Coordinate:" + string.Join(",", searchResult.Value.Features[i].Geometry.Coordinates)); + } #endregion } @@ -112,11 +113,19 @@ public void GetGeocodingBatch() }, new GeocodingQuery() { - Coordinates = new GeoPosition(121.5, 25.0) + AddressLine = "400 Broad St" }, }; Response results = client.GetGeocodingBatch(queries); - Console.WriteLine(results); + + //Print coordinates + for (var i = 0; i < results.Value.BatchItems.Count; i++) + { + for (var j = 0; j < results.Value.BatchItems[i].Features.Count; j++) + { + Console.WriteLine("Coordinates: " + string.Join(",", results.Value.BatchItems[i].Features[j].Geometry.Coordinates)); + } + } #endregion } @@ -132,10 +141,20 @@ public void GetPolygon() #region Snippet:GetPolygon GetPolygonOptions options = new GetPolygonOptions() { - Coordinates = new GeoPosition(121.5, 25.0) + Coordinates = new GeoPosition(-122.204141, 47.61256), + ResultType = BoundaryResultTypeEnum.Locality, + Resolution = ResolutionEnum.Small, }; Response result = client.GetPolygon(options); - Console.WriteLine(result); + var count = ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates.Count; + for (var i = 0; i < count; i++) + { + var coorCount = ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates[i].Count; + for (var j = 0; j < coorCount; j++) + { + Console.WriteLine(string.Join(",", ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates[i][j])); + } + } #endregion } @@ -151,6 +170,12 @@ public void GetReverseGeocoding() #region Snippet:GetReverseGeocoding GeoPosition coordinates = new GeoPosition(-122.138685, 47.6305637); Response result = client.GetReverseGeocoding(coordinates); + + //Print addresses + for (int i = 0; i < result.Value.Features.Count; i++) + { + Console.WriteLine(result.Value.Features[i].Properties.Address.FormattedAddress); + } #endregion } @@ -168,14 +193,22 @@ public void GetReverseGeocodingBatch() { new ReverseGeocodingQuery() { - Coordinates = new GeoPosition(121.53, 25.0) + Coordinates = new GeoPosition(-122.349309, 47.620498) }, new ReverseGeocodingQuery() { - Coordinates = new GeoPosition(121.5, 25.0) + Coordinates = new GeoPosition(-122.138679, 47.630356), + ResultTypes = new List(){ ReverseGeocodingResultTypeEnum.Address, ReverseGeocodingResultTypeEnum.Neighborhood } }, }; Response result = client.GetReverseGeocodingBatch(items); + + //Print addresses + for (var i = 0; i < result.Value.BatchItems.Count; i++) + { + Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.AddressLine); + Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.Neighborhood); + } #endregion } } From bae46d07934d350cac8c4681bf4424a86e878d8f Mon Sep 17 00:00:00 2001 From: Jingchuan Huang Date: Thu, 29 Aug 2024 13:26:26 +0800 Subject: [PATCH 47/71] Implement Pipeline Group API in Azure Monitor SDK. (#45198) --- .../CHANGELOG.md | 8 +- ....ResourceManager.Monitor.netstandard2.0.cs | 448 ++++++++++- .../Sample_MonitorWorkspaceResource.cs | 24 +- ...mple_MonitorWorkspaceResourceCollection.cs | 34 +- .../Samples/Sample_PipelineGroupCollection.cs | 540 +++++++++++++ .../Samples/Sample_PipelineGroupResource.cs | 192 +++++ .../src/Generated/ArmMonitorModelFactory.cs | 115 ++- .../Extensions/MockableMonitorArmClient.cs | 12 + .../MockableMonitorResourceGroupResource.cs | 77 +- .../MockableMonitorSubscriptionResource.cs | 68 +- .../Generated/Extensions/MonitorExtensions.cs | 196 ++++- ...MonitorWorkspaceResourceOperationSource.cs | 38 + .../PipelineGroupOperationSource.cs | 38 + .../Models/BatchProcessor.Serialization.cs | 141 ++++ .../src/Generated/Models/BatchProcessor.cs | 69 ++ .../Models/MonitorProvisioningState.cs | 20 +- ...torWorkspaceLogsApiConfig.Serialization.cs | 143 ++++ .../Models/MonitorWorkspaceLogsApiConfig.cs | 96 +++ ...itorWorkspaceLogsExporter.Serialization.cs | 149 ++++ .../Models/MonitorWorkspaceLogsExporter.cs | 83 ++ ...xporterCacheConfiguration.Serialization.cs | 141 ++++ ...WorkspaceLogsExporterCacheConfiguration.cs | 69 ++ ...rConcurrencyConfiguration.Serialization.cs | 141 ++++ ...aceLogsExporterConcurrencyConfiguration.cs | 69 ++ ...torWorkspaceLogsRecordMap.Serialization.cs | 127 +++ .../Models/MonitorWorkspaceLogsRecordMap.cs | 82 ++ ...rWorkspaceLogsResourceMap.Serialization.cs | 127 +++ .../Models/MonitorWorkspaceLogsResourceMap.cs | 82 ++ ...torWorkspaceLogsSchemaMap.Serialization.cs | 179 +++++ .../Models/MonitorWorkspaceLogsSchemaMap.cs | 86 +++ ...itorWorkspaceLogsScopeMap.Serialization.cs | 127 +++ .../Models/MonitorWorkspaceLogsScopeMap.cs | 82 ++ .../MonitorWorkspaceMetricProperties.cs | 2 +- .../Models/MonitorWorkspaceMetrics.cs | 4 +- ...nitorWorkspacePrivateEndpointConnection.cs | 8 +- .../MonitorWorkspacePublicNetworkAccess.cs | 6 +- ...rkspaceResourceListResult.Serialization.cs | 10 +- .../MonitorWorkspaceResourceListResult.cs | 16 +- ...torWorkspaceResourcePatch.Serialization.cs | 32 +- .../Models/MonitorWorkspaceResourcePatch.cs | 8 +- .../Models/OtlpReceiver.Serialization.cs | 119 +++ .../src/Generated/Models/OtlpReceiver.cs | 75 ++ .../PipelineGroupExporter.Serialization.cs | 157 ++++ .../Generated/Models/PipelineGroupExporter.cs | 95 +++ .../Models/PipelineGroupExporterType.cs | 51 ++ .../PipelineGroupExternalNetworkingMode.cs | 48 ++ .../PipelineGroupListResult.Serialization.cs | 144 ++++ .../Models/PipelineGroupListResult.cs | 80 ++ ...upNetworkingConfiguration.Serialization.cs | 148 ++++ .../PipelineGroupNetworkingConfiguration.cs | 86 +++ ...elineGroupNetworkingRoute.Serialization.cs | 156 ++++ .../Models/PipelineGroupNetworkingRoute.cs | 87 +++ .../PipelineGroupPatch.Serialization.cs | 290 +++++++ .../Generated/Models/PipelineGroupPatch.cs | 94 +++ .../PipelineGroupProcessor.Serialization.cs | 142 ++++ .../Models/PipelineGroupProcessor.cs | 85 ++ .../Models/PipelineGroupProcessorType.cs | 48 ++ .../PipelineGroupReceiver.Serialization.cs | 178 +++++ .../Generated/Models/PipelineGroupReceiver.cs | 100 +++ .../Models/PipelineGroupReceiverType.cs | 60 ++ .../PipelineGroupService.Serialization.cs | 144 ++++ .../Generated/Models/PipelineGroupService.cs | 86 +++ ...PersistenceConfigurations.Serialization.cs | 119 +++ ...neGroupServicePersistenceConfigurations.cs | 75 ++ ...elineGroupServicePipeline.Serialization.cs | 194 +++++ .../Models/PipelineGroupServicePipeline.cs | 101 +++ .../PipelineGroupServicePipelineType.cs | 48 ++ .../Generated/Models/StreamEncodingType.cs | 63 ++ .../src/Generated/Models/SyslogProtocol.cs | 51 ++ .../Models/SyslogReceiver.Serialization.cs | 134 ++++ .../src/Generated/Models/SyslogReceiver.cs | 79 ++ .../Models/TcpExporter.Serialization.cs | 119 +++ .../src/Generated/Models/TcpExporter.cs | 75 ++ .../Models/UdpReceiver.Serialization.cs | 149 ++++ .../src/Generated/Models/UdpReceiver.cs | 83 ++ .../src/Generated/MonitorWorkspaceResource.cs | 28 +- .../MonitorWorkspaceResourceCollection.cs | 56 +- ...itorWorkspaceResourceData.Serialization.cs | 52 +- .../Generated/MonitorWorkspaceResourceData.cs | 24 +- .../src/Generated/PipelineGroupCollection.cs | 494 ++++++++++++ .../PipelineGroupData.Serialization.cs | 386 ++++++++++ .../src/Generated/PipelineGroupData.cs | 116 +++ .../PipelineGroupResource.Serialization.cs | 26 + .../src/Generated/PipelineGroupResource.cs | 707 +++++++++++++++++ .../AzureMonitorWorkspacesRestOperations.cs | 172 ++--- .../PipelineGroupsRestOperations.cs | 723 ++++++++++++++++++ .../src/autorest.md | 67 +- 87 files changed, 10234 insertions(+), 269 deletions(-) create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupCollection.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupResource.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/MonitorWorkspaceResourceOperationSource.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/PipelineGroupOperationSource.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporter.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporter.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsRecordMap.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsRecordMap.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsResourceMap.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsResourceMap.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsScopeMap.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsScopeMap.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporterType.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExternalNetworkingMode.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupListResult.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupListResult.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessor.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessor.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessorType.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiverType.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePersistenceConfigurations.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePersistenceConfigurations.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipelineType.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/StreamEncodingType.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogProtocol.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogReceiver.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogReceiver.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupCollection.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.Serialization.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/PipelineGroupsRestOperations.cs diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md b/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md index 5fbd583c138b8..dc596fec5fc5b 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md +++ b/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md @@ -1,14 +1,10 @@ # Release History -## 1.4.0-beta.1 (Unreleased) +## 1.4.0-beta.1 (2024-09-03) ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added azure monitor pipeline group APIs (version `2023-10-01-preview`) ## 1.3.1 (2024-04-29) diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/api/Azure.ResourceManager.Monitor.netstandard2.0.cs b/sdk/monitor/Azure.ResourceManager.Monitor/api/Azure.ResourceManager.Monitor.netstandard2.0.cs index b1f316e48b803..4a5808a2009fa 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/api/Azure.ResourceManager.Monitor.netstandard2.0.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/api/Azure.ResourceManager.Monitor.netstandard2.0.cs @@ -761,6 +761,12 @@ public static partial class MonitorExtensions public static System.Threading.Tasks.Task> GetNotificationStatusAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string notificationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.Threading.Tasks.Task> GetNotificationStatusAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string notificationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetPipelineGroup(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPipelineGroupAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Monitor.PipelineGroupResource GetPipelineGroupResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Monitor.PipelineGroupCollection GetPipelineGroups(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetPipelineGroups(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetPipelineGroupsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetPrivateLinkScopeOperationStatus(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string asyncOperationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetPrivateLinkScopeOperationStatusAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string asyncOperationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetScheduledQueryRule(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1021,8 +1027,10 @@ public partial class MonitorWorkspaceResourceData : Azure.ResourceManager.Models public MonitorWorkspaceResourceData(Azure.Core.AzureLocation location) { } public string AccountId { get { throw null; } } public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceDefaultIngestionSettings DefaultIngestionSettings { get { throw null; } } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceIngestionSettings DefaultIngestionSettingsPropertiesDefaultIngestionSettings { get { throw null; } } public Azure.ETag? ETag { get { throw null; } } public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics Metrics { get { throw null; } } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetricProperties MetricsPropertiesMetrics { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } public Azure.ResourceManager.Monitor.Models.MonitorProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.Monitor.Models.MonitorWorkspacePublicNetworkAccess? PublicNetworkAccess { get { throw null; } } @@ -1032,6 +1040,65 @@ public MonitorWorkspaceResourceData(Azure.Core.AzureLocation location) { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class PipelineGroupCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected PipelineGroupCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string pipelineGroupName, Azure.ResourceManager.Monitor.PipelineGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string pipelineGroupName, Azure.ResourceManager.Monitor.PipelineGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class PipelineGroupData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupData(Azure.Core.AzureLocation location) { } + public System.Collections.Generic.IList Exporters { get { throw null; } } + public Azure.ResourceManager.Resources.Models.ExtendedLocation ExtendedLocation { get { throw null; } set { } } + public System.Collections.Generic.IList NetworkingConfigurations { get { throw null; } } + public System.Collections.Generic.IList Processors { get { throw null; } } + public Azure.ResourceManager.Monitor.Models.MonitorProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList Receivers { get { throw null; } } + public int? Replicas { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.PipelineGroupService Service { get { throw null; } set { } } + Azure.ResourceManager.Monitor.PipelineGroupData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.PipelineGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineGroupResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected PipelineGroupResource() { } + public virtual Azure.ResourceManager.Monitor.PipelineGroupData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string pipelineGroupName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Monitor.PipelineGroupData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.PipelineGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Monitor.Models.PipelineGroupPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Monitor.Models.PipelineGroupPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ScheduledQueryRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ScheduledQueryRuleCollection() { } @@ -1170,6 +1237,7 @@ protected MockableMonitorArmClient() { } public virtual Azure.ResourceManager.Monitor.MonitorPrivateLinkScopedResource GetMonitorPrivateLinkScopedResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Monitor.MonitorPrivateLinkScopeResource GetMonitorPrivateLinkScopeResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Monitor.MonitorWorkspaceResource GetMonitorWorkspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Monitor.PipelineGroupResource GetPipelineGroupResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Monitor.ScheduledQueryRuleResource GetScheduledQueryRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Monitor.VmInsightsOnboardingStatusResource GetVmInsightsOnboardingStatus(Azure.Core.ResourceIdentifier scope) { throw null; } public virtual Azure.ResourceManager.Monitor.VmInsightsOnboardingStatusResource GetVmInsightsOnboardingStatusResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -1212,6 +1280,9 @@ protected MockableMonitorResourceGroupResource() { } public virtual Azure.Response GetNotificationStatus(string notificationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> GetNotificationStatusAsync(string notificationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetPipelineGroup(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPipelineGroupAsync(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Monitor.PipelineGroupCollection GetPipelineGroups() { throw null; } public virtual Azure.Response GetPrivateLinkScopeOperationStatus(string asyncOperationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetPrivateLinkScopeOperationStatusAsync(string asyncOperationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetScheduledQueryRule(string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1256,6 +1327,8 @@ protected MockableMonitorSubscriptionResource() { } public virtual Azure.Response GetNotificationStatus(string notificationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> GetNotificationStatusAsync(string notificationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetPipelineGroups(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetPipelineGroupsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetScheduledQueryRules(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetScheduledQueryRulesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -1451,11 +1524,14 @@ public static partial class ArmMonitorModelFactory public static Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetricProperties MonitorWorkspaceMetricProperties(string prometheusQueryEndpoint = null, string internalId = null) { throw null; } public static Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics MonitorWorkspaceMetrics(string prometheusQueryEndpoint = null, string internalId = null) { throw null; } public static Azure.ResourceManager.Monitor.Models.MonitorWorkspacePrivateEndpointConnection MonitorWorkspacePrivateEndpointConnection(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable groupIds = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.Monitor.Models.MonitorPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.Monitor.Models.MonitorPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.Monitor.Models.MonitorPrivateEndpointConnectionProvisioningState?)) { throw null; } - public static Azure.ResourceManager.Monitor.MonitorWorkspaceResourceData MonitorWorkspaceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), string accountId = null, Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics metrics = null, Azure.ResourceManager.Monitor.Models.MonitorProvisioningState? provisioningState = default(Azure.ResourceManager.Monitor.Models.MonitorProvisioningState?), Azure.ResourceManager.Monitor.Models.MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.Monitor.Models.MonitorWorkspacePublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Monitor.Models.MonitorWorkspacePublicNetworkAccess?)) { throw null; } + public static Azure.ResourceManager.Monitor.MonitorWorkspaceResourceData MonitorWorkspaceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.Monitor.Models.MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings = null, Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics metrics = null, string accountId = null, Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetricProperties metricsPropertiesMetrics = null, Azure.ResourceManager.Monitor.Models.MonitorProvisioningState? provisioningState = default(Azure.ResourceManager.Monitor.Models.MonitorProvisioningState?), Azure.ResourceManager.Monitor.Models.MonitorWorkspaceIngestionSettings defaultIngestionSettingsPropertiesDefaultIngestionSettings = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.Monitor.Models.MonitorWorkspacePublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Monitor.Models.MonitorWorkspacePublicNetworkAccess?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Monitor.MonitorWorkspaceResourceData MonitorWorkspaceResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ETag? etag, string accountId, Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics metrics, Azure.ResourceManager.Monitor.Models.MonitorProvisioningState? provisioningState, Azure.ResourceManager.Monitor.Models.MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.Monitor.Models.MonitorWorkspacePublicNetworkAccess? publicNetworkAccess) { throw null; } public static Azure.ResourceManager.Monitor.Models.NotificationActionDetail NotificationActionDetail(string mechanismType = null, string name = null, string status = null, string subState = null, System.DateTimeOffset? sendOn = default(System.DateTimeOffset?), string detail = null) { throw null; } public static Azure.ResourceManager.Monitor.Models.NotificationContent NotificationContent(string alertType = null, System.Collections.Generic.IEnumerable emailReceivers = null, System.Collections.Generic.IEnumerable smsReceivers = null, System.Collections.Generic.IEnumerable webhookReceivers = null, System.Collections.Generic.IEnumerable itsmReceivers = null, System.Collections.Generic.IEnumerable azureAppPushReceivers = null, System.Collections.Generic.IEnumerable automationRunbookReceivers = null, System.Collections.Generic.IEnumerable voiceReceivers = null, System.Collections.Generic.IEnumerable logicAppReceivers = null, System.Collections.Generic.IEnumerable azureFunctionReceivers = null, System.Collections.Generic.IEnumerable armRoleReceivers = null, System.Collections.Generic.IEnumerable eventHubReceivers = null) { throw null; } public static Azure.ResourceManager.Monitor.Models.NotificationContext NotificationContext(string notificationSource = null, string contextType = null) { throw null; } public static Azure.ResourceManager.Monitor.Models.NotificationStatus NotificationStatus(Azure.ResourceManager.Monitor.Models.NotificationContext context = null, string state = null, System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable actionDetails = null) { throw null; } + public static Azure.ResourceManager.Monitor.PipelineGroupData PipelineGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation = null, int? replicas = default(int?), System.Collections.Generic.IEnumerable receivers = null, System.Collections.Generic.IEnumerable processors = null, System.Collections.Generic.IEnumerable exporters = null, Azure.ResourceManager.Monitor.Models.PipelineGroupService service = null, System.Collections.Generic.IEnumerable networkingConfigurations = null, Azure.ResourceManager.Monitor.Models.MonitorProvisioningState? provisioningState = default(Azure.ResourceManager.Monitor.Models.MonitorProvisioningState?)) { throw null; } public static Azure.ResourceManager.Monitor.Models.PredictiveValue PredictiveValue(System.DateTimeOffset timeStamp = default(System.DateTimeOffset), double value = 0) { throw null; } public static Azure.ResourceManager.Monitor.ScheduledQueryRuleData ScheduledQueryRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Monitor.Models.ScheduledQueryRuleKind? kind = default(Azure.ResourceManager.Monitor.Models.ScheduledQueryRuleKind?), Azure.ETag? etag = default(Azure.ETag?), string createdWithApiVersion = null, bool? isLegacyLogAnalyticsRule = default(bool?), string description = null, string displayName = null, Azure.ResourceManager.Monitor.Models.AlertSeverity? severity = default(Azure.ResourceManager.Monitor.Models.AlertSeverity?), bool? isEnabled = default(bool?), System.Collections.Generic.IEnumerable scopes = null, System.TimeSpan? evaluationFrequency = default(System.TimeSpan?), System.TimeSpan? windowSize = default(System.TimeSpan?), System.TimeSpan? overrideQueryTimeRange = default(System.TimeSpan?), System.Collections.Generic.IEnumerable targetResourceTypes = null, System.Collections.Generic.IEnumerable criteriaAllOf = null, System.TimeSpan? muteActionsDuration = default(System.TimeSpan?), Azure.ResourceManager.Monitor.Models.ScheduledQueryRuleActions actions = null, bool? isWorkspaceAlertsStorageConfigured = default(bool?), bool? checkWorkspaceAlertsStorageConfigured = default(bool?), bool? skipQueryValidation = default(bool?), bool? autoMitigate = default(bool?)) { throw null; } public static Azure.ResourceManager.Monitor.Models.ScheduledQueryRulePatch ScheduledQueryRulePatch(System.Collections.Generic.IDictionary tags = null, string createdWithApiVersion = null, bool? isLegacyLogAnalyticsRule = default(bool?), string description = null, string displayName = null, Azure.ResourceManager.Monitor.Models.AlertSeverity? severity = default(Azure.ResourceManager.Monitor.Models.AlertSeverity?), bool? isEnabled = default(bool?), System.Collections.Generic.IEnumerable scopes = null, System.TimeSpan? evaluationFrequency = default(System.TimeSpan?), System.TimeSpan? windowSize = default(System.TimeSpan?), System.TimeSpan? overrideQueryTimeRange = default(System.TimeSpan?), System.Collections.Generic.IEnumerable targetResourceTypes = null, System.Collections.Generic.IEnumerable criteriaAllOf = null, System.TimeSpan? muteActionsDuration = default(System.TimeSpan?), Azure.ResourceManager.Monitor.Models.ScheduledQueryRuleActions actions = null, bool? isWorkspaceAlertsStorageConfigured = default(bool?), bool? checkWorkspaceAlertsStorageConfigured = default(bool?), bool? skipQueryValidation = default(bool?), bool? autoMitigate = default(bool?)) { throw null; } @@ -1570,6 +1646,17 @@ internal AutoscaleSettingPredicativeResult() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class BatchProcessor : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BatchProcessor() { } + public int? BatchSize { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.BatchProcessor System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.BatchProcessor System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ConditionFailingPeriods : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ConditionFailingPeriods() { } @@ -3363,9 +3450,101 @@ internal MonitorWorkspaceIngestionSettings() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MonitorWorkspaceLogsApiConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsApiConfig(System.Uri dataCollectionEndpointUri, string stream, string dataCollectionRule, Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsSchemaMap schema) { } + public System.Uri DataCollectionEndpointUri { get { throw null; } set { } } + public string DataCollectionRule { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsSchemaMap Schema { get { throw null; } set { } } + public string Stream { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsApiConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsApiConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsExporter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsExporter(Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsApiConfig api) { } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsApiConfig Api { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporterCacheConfiguration Cache { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporterConcurrencyConfiguration Concurrency { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsExporterCacheConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsExporterCacheConfiguration() { } + public int? MaxStorageUsage { get { throw null; } set { } } + public int? RetentionPeriod { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporterCacheConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporterCacheConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsExporterConcurrencyConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsExporterConcurrencyConfiguration() { } + public int? BatchQueueSize { get { throw null; } set { } } + public int? WorkerCount { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporterConcurrencyConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporterConcurrencyConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsRecordMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsRecordMap(string from, string to) { } + public string From { get { throw null; } set { } } + public string To { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsRecordMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsRecordMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsResourceMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsResourceMap(string from, string to) { } + public string From { get { throw null; } set { } } + public string To { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsResourceMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsResourceMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsSchemaMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsSchemaMap(System.Collections.Generic.IEnumerable recordMap) { } + public System.Collections.Generic.IList RecordMap { get { throw null; } } + public System.Collections.Generic.IList ResourceMap { get { throw null; } } + public System.Collections.Generic.IList ScopeMap { get { throw null; } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsSchemaMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsSchemaMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsScopeMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsScopeMap(string from, string to) { } + public string From { get { throw null; } set { } } + public string To { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsScopeMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsScopeMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class MonitorWorkspaceMetricProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal MonitorWorkspaceMetricProperties() { } + public MonitorWorkspaceMetricProperties() { } public string InternalId { get { throw null; } } public string PrometheusQueryEndpoint { get { throw null; } } Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetricProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3376,7 +3555,7 @@ internal MonitorWorkspaceMetricProperties() { } } public partial class MonitorWorkspaceMetrics : Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetricProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal MonitorWorkspaceMetrics() { } + public MonitorWorkspaceMetrics() { } Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3385,8 +3564,8 @@ internal MonitorWorkspaceMetrics() { } } public partial class MonitorWorkspacePrivateEndpointConnection : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal MonitorWorkspacePrivateEndpointConnection() { } - public Azure.ResourceManager.Monitor.Models.MonitorPrivateLinkServiceConnectionState ConnectionState { get { throw null; } } + public MonitorWorkspacePrivateEndpointConnection() { } + public Azure.ResourceManager.Monitor.Models.MonitorPrivateLinkServiceConnectionState ConnectionState { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList GroupIds { get { throw null; } } public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } public Azure.ResourceManager.Monitor.Models.MonitorPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } @@ -3417,6 +3596,7 @@ internal MonitorWorkspacePrivateEndpointConnection() { } public partial class MonitorWorkspaceResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MonitorWorkspaceResourcePatch() { } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetricProperties Metrics { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } Azure.ResourceManager.Monitor.Models.MonitorWorkspaceResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3551,6 +3731,201 @@ public PerfCounterDataSource() { } public static bool operator !=(Azure.ResourceManager.Monitor.Models.PerfCounterDataSourceStream left, Azure.ResourceManager.Monitor.Models.PerfCounterDataSourceStream right) { throw null; } public override string ToString() { throw null; } } + public partial class PipelineGroupExporter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupExporter(Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType exporterType, string name) { } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporter AzureMonitorWorkspaceLogs { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType ExporterType { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.Uri TcpUri { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.PipelineGroupExporter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupExporter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PipelineGroupExporterType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PipelineGroupExporterType(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType AzureMonitorWorkspaceLogs { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType PipelineGroup { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType left, Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType left, Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PipelineGroupExternalNetworkingMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PipelineGroupExternalNetworkingMode(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode LoadBalancerOnly { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode left, Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode left, Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PipelineGroupNetworkingConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupNetworkingConfiguration(Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode externalNetworkingMode, System.Collections.Generic.IEnumerable routes) { } + public Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode ExternalNetworkingMode { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + public System.Collections.Generic.IList Routes { get { throw null; } } + Azure.ResourceManager.Monitor.Models.PipelineGroupNetworkingConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupNetworkingConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineGroupNetworkingRoute : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupNetworkingRoute(string receiver) { } + public string Path { get { throw null; } set { } } + public int? Port { get { throw null; } set { } } + public string Receiver { get { throw null; } set { } } + public string Subdomain { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.PipelineGroupNetworkingRoute System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupNetworkingRoute System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineGroupPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupPatch() { } + public System.Collections.Generic.IList Exporters { get { throw null; } } + public System.Collections.Generic.IList NetworkingConfigurations { get { throw null; } } + public System.Collections.Generic.IList Processors { get { throw null; } } + public System.Collections.Generic.IList Receivers { get { throw null; } } + public int? Replicas { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.PipelineGroupService Service { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + Azure.ResourceManager.Monitor.Models.PipelineGroupPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineGroupProcessor : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupProcessor(Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType processorType, string name) { } + public Azure.ResourceManager.Monitor.Models.BatchProcessor Batch { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType ProcessorType { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.PipelineGroupProcessor System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupProcessor System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PipelineGroupProcessorType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PipelineGroupProcessorType(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType Batch { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType left, Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType left, Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PipelineGroupReceiver : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupReceiver(Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType receiverType, string name) { } + public string Name { get { throw null; } set { } } + public string OtlpEndpoint { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType ReceiverType { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.SyslogReceiver Syslog { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.UdpReceiver Udp { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.PipelineGroupReceiver System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupReceiver System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PipelineGroupReceiverType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PipelineGroupReceiverType(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType Ama { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType Otlp { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType PipelineGroup { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType Syslog { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType Udp { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType left, Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType left, Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PipelineGroupService : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupService(System.Collections.Generic.IEnumerable pipelines) { } + public string PersistencePersistentVolumeName { get { throw null; } set { } } + public System.Collections.Generic.IList Pipelines { get { throw null; } } + Azure.ResourceManager.Monitor.Models.PipelineGroupService System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupService System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineGroupServicePipeline : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupServicePipeline(string name, Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType pipelineType, System.Collections.Generic.IEnumerable receivers, System.Collections.Generic.IEnumerable exporters) { } + public System.Collections.Generic.IList Exporters { get { throw null; } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType PipelineType { get { throw null; } set { } } + public System.Collections.Generic.IList Processors { get { throw null; } } + public System.Collections.Generic.IList Receivers { get { throw null; } } + Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipeline System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipeline System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PipelineGroupServicePipelineType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PipelineGroupServicePipelineType(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType Logs { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType left, Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType left, Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType right) { throw null; } + public override string ToString() { throw null; } + } public partial class PlatformTelemetryDataSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public PlatformTelemetryDataSource(System.Collections.Generic.IEnumerable streams) { } @@ -3837,6 +4212,28 @@ internal SenderAuthorization() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StreamEncodingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StreamEncodingType(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.StreamEncodingType Ascii { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.StreamEncodingType Big5 { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.StreamEncodingType Nop { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.StreamEncodingType Utf16Be { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.StreamEncodingType Utf16Le { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.StreamEncodingType Utf8 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.StreamEncodingType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.StreamEncodingType left, Azure.ResourceManager.Monitor.Models.StreamEncodingType right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.StreamEncodingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.StreamEncodingType left, Azure.ResourceManager.Monitor.Models.StreamEncodingType right) { throw null; } + public override string ToString() { throw null; } + } public partial class SubscriptionMonitorMetric : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal SubscriptionMonitorMetric() { } @@ -4000,6 +4397,35 @@ public SyslogDataSource() { } public static bool operator !=(Azure.ResourceManager.Monitor.Models.SyslogDataSourceStream left, Azure.ResourceManager.Monitor.Models.SyslogDataSourceStream right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SyslogProtocol : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SyslogProtocol(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.SyslogProtocol Rfc3164 { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.SyslogProtocol Rfc5424 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.SyslogProtocol other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.SyslogProtocol left, Azure.ResourceManager.Monitor.Models.SyslogProtocol right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.SyslogProtocol (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.SyslogProtocol left, Azure.ResourceManager.Monitor.Models.SyslogProtocol right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SyslogReceiver : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SyslogReceiver(string endpoint) { } + public string Endpoint { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.SyslogProtocol? Protocol { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.SyslogReceiver System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.SyslogReceiver System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ThresholdRuleCondition : Azure.ResourceManager.Monitor.Models.AlertRuleCondition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ThresholdRuleCondition(Azure.ResourceManager.Monitor.Models.MonitorConditionOperator @operator, double threshold) { } @@ -4021,6 +4447,18 @@ public enum ThresholdRuleConditionTimeAggregationType Total = 3, Last = 4, } + public partial class UdpReceiver : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UdpReceiver(string endpoint) { } + public Azure.ResourceManager.Monitor.Models.StreamEncodingType? Encoding { get { throw null; } set { } } + public string Endpoint { get { throw null; } set { } } + public int? ReadQueueLength { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.UdpReceiver System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.UdpReceiver System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class WebhookNotification : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public WebhookNotification() { } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResource.cs index 18ddc6194e063..3fdf5d4d93f21 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResource.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResource.cs @@ -16,12 +16,12 @@ namespace Azure.ResourceManager.Monitor.Samples { public partial class Sample_MonitorWorkspaceResource { - // List workspaces by subscription + // List Azure Monitor Workspaces by subscription [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetMonitorWorkspaceResources_ListWorkspacesBySubscription() + public async Task GetMonitorWorkspaceResources_ListAzureMonitorWorkspacesBySubscription() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListBySubscription.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspacesListBySubscription.json // this example is just showing the usage of "AzureMonitorWorkspaces_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,12 +48,12 @@ public async Task GetMonitorWorkspaceResources_ListWorkspacesBySubscription() Console.WriteLine($"Succeeded"); } - // Get workspace + // Retrieves an Azure Monitor Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetWorkspace() + public async Task Get_RetrievesAnAzureMonitorWorkspace() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceGet.json // this example is just showing the usage of "AzureMonitorWorkspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,12 +79,12 @@ public async Task Get_GetWorkspace() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Update workspace + // Updates an Azure Monitor Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_UpdateWorkspace() + public async Task Update_UpdatesAnAzureMonitorWorkspace() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesUpdate.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceUpdate.json // this example is just showing the usage of "AzureMonitorWorkspaces_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,12 +119,12 @@ public async Task Update_UpdateWorkspace() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Delete workspace + // Deletes an Azure Monitor Workspace asynchronously [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteWorkspace() + public async Task Delete_DeletesAnAzureMonitorWorkspaceAsynchronously() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesDelete.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceDelete.json // this example is just showing the usage of "AzureMonitorWorkspaces_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResourceCollection.cs b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResourceCollection.cs index dc68f572a3874..8118806aef8b5 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResourceCollection.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResourceCollection.cs @@ -15,12 +15,12 @@ namespace Azure.ResourceManager.Monitor.Samples { public partial class Sample_MonitorWorkspaceResourceCollection { - // List monitor workspaces by resource group + // List Azure Monitor Workspaces by resource group [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListMonitorWorkspacesByResourceGroup() + public async Task GetAll_ListAzureMonitorWorkspacesByResourceGroup() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListByResourceGroup.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json // this example is just showing the usage of "AzureMonitorWorkspaces_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,12 +51,12 @@ public async Task GetAll_ListMonitorWorkspacesByResourceGroup() Console.WriteLine($"Succeeded"); } - // Get workspace + // Retrieves an Azure Monitor Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetWorkspace() + public async Task Get_RetrievesAnAzureMonitorWorkspace() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceGet.json // this example is just showing the usage of "AzureMonitorWorkspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -85,12 +85,12 @@ public async Task Get_GetWorkspace() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Get workspace + // Retrieves an Azure Monitor Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetWorkspace() + public async Task Exists_RetrievesAnAzureMonitorWorkspace() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceGet.json // this example is just showing the usage of "AzureMonitorWorkspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,12 +115,12 @@ public async Task Exists_GetWorkspace() Console.WriteLine($"Succeeded: {result}"); } - // Get workspace + // Retrieves an Azure Monitor Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetWorkspace() + public async Task GetIfExists_RetrievesAnAzureMonitorWorkspace() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceGet.json // this example is just showing the usage of "AzureMonitorWorkspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -157,13 +157,13 @@ public async Task GetIfExists_GetWorkspace() } } - // Create or update workspace + // Creates an Azure Monitor Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateOrUpdateWorkspace() + public async Task CreateOrUpdate_CreatesAnAzureMonitorWorkspace() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesCreate.json - // this example is just showing the usage of "AzureMonitorWorkspaces_Create" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceCreate.json + // this example is just showing the usage of "AzureMonitorWorkspaces_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -172,7 +172,7 @@ public async Task CreateOrUpdate_CreateOrUpdateWorkspace() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupCollection.cs b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupCollection.cs new file mode 100644 index 0000000000000..6c605f8b19ff1 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupCollection.cs @@ -0,0 +1,540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Monitor.Models; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Monitor.Samples +{ + public partial class Sample_PipelineGroupCollection + { + // List Pipeline groups by resource group + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListPipelineGroupsByResourceGroup() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupListByResourceGroup.json + // this example is just showing the usage of "PipelineGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation and iterate over the result + await foreach (PipelineGroupResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Retrieves a PipelineGroup instance by name + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_RetrievesAPipelineGroupInstanceByName() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupGet.json + // this example is just showing the usage of "PipelineGroups_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + PipelineGroupResource result = await collection.GetAsync(pipelineGroupName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Retrieves a PipelineGroup instance by name + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_RetrievesAPipelineGroupInstanceByName() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupGet.json + // this example is just showing the usage of "PipelineGroups_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + bool result = await collection.ExistsAsync(pipelineGroupName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Retrieves a PipelineGroup instance by name + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_RetrievesAPipelineGroupInstanceByName() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupGet.json + // this example is just showing the usage of "PipelineGroups_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + NullableResponse response = await collection.GetIfExistsAsync(pipelineGroupName); + PipelineGroupResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create a PipelineGroup instance using UDP receiver + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAPipelineGroupInstanceUsingUDPReceiver() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupCreateUdp.json + // this example is just showing the usage of "PipelineGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + PipelineGroupData data = new PipelineGroupData(new AzureLocation("eastus2")) + { + ExtendedLocation = new ExtendedLocation() + { + Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/myTestCustomLocation", + }, + Receivers = +{ +new PipelineGroupReceiver(PipelineGroupReceiverType.Udp,"udp-receiver1") +{ +Udp = new UdpReceiver("0.0.0.0:518") +{ +Encoding = StreamEncodingType.Utf8, +}, +} +}, + Processors = +{ +}, + Exporters = +{ +new PipelineGroupExporter(PipelineGroupExporterType.AzureMonitorWorkspaceLogs,"my-workspace-logs-exporter1") +{ +AzureMonitorWorkspaceLogs = new MonitorWorkspaceLogsExporter(new MonitorWorkspaceLogsApiConfig(new Uri("https://logs-myingestion-eb0s.eastus-1.ingest.monitor.azure.com"),"Custom-MyTableRawData_CL","dcr-00000000000000000000000000000000",new MonitorWorkspaceLogsSchemaMap(new MonitorWorkspaceLogsRecordMap[] +{ +new MonitorWorkspaceLogsRecordMap("body","Body"),new MonitorWorkspaceLogsRecordMap("severity_text","SeverityText"),new MonitorWorkspaceLogsRecordMap("time_unix_nano","TimeGenerated") +}))) +{ +Concurrency = new MonitorWorkspaceLogsExporterConcurrencyConfiguration() +{ +WorkerCount = 4, +BatchQueueSize = 100, +}, +}, +} +}, + Service = new PipelineGroupService(new PipelineGroupServicePipeline[] + { +new PipelineGroupServicePipeline("MyPipelineForLogs1",PipelineGroupServicePipelineType.Logs,new string[] +{ +"udp-receiver1" +},new string[] +{ +"my-workspace-logs-exporter1" +}) +{ +Processors = +{ +}, +} + }), + Tags = +{ +["tag1"] = "A", +["tag2"] = "B", +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pipelineGroupName, data); + PipelineGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create a PipelineGroup instance using a syslog receiver + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAPipelineGroupInstanceUsingASyslogReceiver() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupCreateSyslogs.json + // this example is just showing the usage of "PipelineGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + PipelineGroupData data = new PipelineGroupData(new AzureLocation("eastus2")) + { + ExtendedLocation = new ExtendedLocation() + { + Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/myTestCustomLocation", + }, + Receivers = +{ +new PipelineGroupReceiver(PipelineGroupReceiverType.Syslog,"syslog-receiver1") +{ +Syslog = new SyslogReceiver("0.0.0.0:514"), +} +}, + Processors = +{ +new PipelineGroupProcessor(PipelineGroupProcessorType.Batch,"batch-processor1") +}, + Exporters = +{ +new PipelineGroupExporter(PipelineGroupExporterType.AzureMonitorWorkspaceLogs,"my-workspace-logs-exporter1") +{ +AzureMonitorWorkspaceLogs = new MonitorWorkspaceLogsExporter(new MonitorWorkspaceLogsApiConfig(new Uri("https://logs-myingestion-eb0s.eastus-1.ingest.monitor.azure.com"),"Custom-MyTableRawData_CL","dcr-00000000000000000000000000000000",new MonitorWorkspaceLogsSchemaMap(new MonitorWorkspaceLogsRecordMap[] +{ +new MonitorWorkspaceLogsRecordMap("body","Body"),new MonitorWorkspaceLogsRecordMap("severity_text","SeverityText"),new MonitorWorkspaceLogsRecordMap("time_unix_nano","TimeGenerated") +}))) +{ +Concurrency = new MonitorWorkspaceLogsExporterConcurrencyConfiguration() +{ +WorkerCount = 4, +BatchQueueSize = 100, +}, +}, +} +}, + Service = new PipelineGroupService(new PipelineGroupServicePipeline[] + { +new PipelineGroupServicePipeline("MyPipelineForLogs1",PipelineGroupServicePipelineType.Logs,new string[] +{ +"syslog-receiver1" +},new string[] +{ +"my-workspace-logs-exporter1" +}) +{ +Processors = +{ +"batch-processor1" +}, +} + }), + Tags = +{ +["tag1"] = "A", +["tag2"] = "B", +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pipelineGroupName, data); + PipelineGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create a PipelineGroup instance using a syslog receiver and cache. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAPipelineGroupInstanceUsingASyslogReceiverAndCache() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupCreateSyslogsWithCache.json + // this example is just showing the usage of "PipelineGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + PipelineGroupData data = new PipelineGroupData(new AzureLocation("eastus2")) + { + ExtendedLocation = new ExtendedLocation() + { + Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/myTestCustomLocation", + }, + Receivers = +{ +new PipelineGroupReceiver(PipelineGroupReceiverType.Syslog,"syslog-receiver1") +{ +Syslog = new SyslogReceiver("0.0.0.0:514"), +} +}, + Processors = +{ +new PipelineGroupProcessor(PipelineGroupProcessorType.Batch,"batch-processor1") +}, + Exporters = +{ +new PipelineGroupExporter(PipelineGroupExporterType.AzureMonitorWorkspaceLogs,"my-workspace-logs-exporter1") +{ +AzureMonitorWorkspaceLogs = new MonitorWorkspaceLogsExporter(new MonitorWorkspaceLogsApiConfig(new Uri("https://logs-myingestion-eb0s.eastus-1.ingest.monitor.azure.com"),"Custom-MyTableRawData_CL","dcr-00000000000000000000000000000000",new MonitorWorkspaceLogsSchemaMap(new MonitorWorkspaceLogsRecordMap[] +{ +new MonitorWorkspaceLogsRecordMap("body","Body"),new MonitorWorkspaceLogsRecordMap("severity_text","SeverityText"),new MonitorWorkspaceLogsRecordMap("time_unix_nano","TimeGenerated") +}))) +{ +Concurrency = new MonitorWorkspaceLogsExporterConcurrencyConfiguration() +{ +WorkerCount = 4, +BatchQueueSize = 100, +}, +Cache = new MonitorWorkspaceLogsExporterCacheConfiguration() +{ +MaxStorageUsage = 100, +RetentionPeriod = 10, +}, +}, +} +}, + Service = new PipelineGroupService(new PipelineGroupServicePipeline[] + { +new PipelineGroupServicePipeline("MyPipelineForLogs1",PipelineGroupServicePipelineType.Logs,new string[] +{ +"syslog-receiver1" +},new string[] +{ +"my-workspace-logs-exporter1" +}) +{ +Processors = +{ +"batch-processor1" +}, +} + }), + Tags = +{ +["tag1"] = "A", +["tag2"] = "B", +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pipelineGroupName, data); + PipelineGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create a PipelineGroup instance using a syslog receiver and networking configurations. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAPipelineGroupInstanceUsingASyslogReceiverAndNetworkingConfigurations() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupCreateSyslogsWithNetworking.json + // this example is just showing the usage of "PipelineGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + PipelineGroupData data = new PipelineGroupData(new AzureLocation("eastus2")) + { + ExtendedLocation = new ExtendedLocation() + { + Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/myTestCustomLocation", + }, + Receivers = +{ +new PipelineGroupReceiver(PipelineGroupReceiverType.Syslog,"syslog-receiver1") +{ +Syslog = new SyslogReceiver("0.0.0.0:514"), +} +}, + Processors = +{ +}, + Exporters = +{ +new PipelineGroupExporter(PipelineGroupExporterType.AzureMonitorWorkspaceLogs,"my-workspace-logs-exporter1") +{ +AzureMonitorWorkspaceLogs = new MonitorWorkspaceLogsExporter(new MonitorWorkspaceLogsApiConfig(new Uri("https://logs-myingestion-eb0s.eastus-1.ingest.monitor.azure.com"),"Custom-MyTableRawData_CL","dcr-00000000000000000000000000000000",new MonitorWorkspaceLogsSchemaMap(new MonitorWorkspaceLogsRecordMap[] +{ +new MonitorWorkspaceLogsRecordMap("body","Body"),new MonitorWorkspaceLogsRecordMap("severity_text","SeverityText"),new MonitorWorkspaceLogsRecordMap("time_unix_nano","TimeGenerated") +}))) +{ +Concurrency = new MonitorWorkspaceLogsExporterConcurrencyConfiguration() +{ +WorkerCount = 4, +BatchQueueSize = 100, +}, +}, +} +}, + Service = new PipelineGroupService(new PipelineGroupServicePipeline[] + { +new PipelineGroupServicePipeline("MyPipelineForLogs1",PipelineGroupServicePipelineType.Logs,new string[] +{ +"syslog-receiver1" +},new string[] +{ +"my-workspace-logs-exporter1" +}) +{ +Processors = +{ +}, +} + }), + NetworkingConfigurations = +{ +new PipelineGroupNetworkingConfiguration(PipelineGroupExternalNetworkingMode.LoadBalancerOnly,new PipelineGroupNetworkingRoute[] +{ +new PipelineGroupNetworkingRoute("syslog-receiver1") +}) +{ +Host = "azuremonitorpipeline.contoso.com", +} +}, + Tags = +{ +["tag1"] = "A", +["tag2"] = "B", +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pipelineGroupName, data); + PipelineGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupResource.cs new file mode 100644 index 0000000000000..c46e30b5d65de --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupResource.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Monitor.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Monitor.Samples +{ + public partial class Sample_PipelineGroupResource + { + // List Pipeline groups by subscription + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetPipelineGroups_ListPipelineGroupsBySubscription() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupListBySubscription.json + // this example is just showing the usage of "PipelineGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (PipelineGroupResource item in subscriptionResource.GetPipelineGroupsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Retrieves a PipelineGroup instance by name + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_RetrievesAPipelineGroupInstanceByName() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupGet.json + // this example is just showing the usage of "PipelineGroups_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PipelineGroupResource created on azure + // for more information of creating PipelineGroupResource, please refer to the document of PipelineGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string pipelineGroupName = "plGroup1"; + ResourceIdentifier pipelineGroupResourceId = PipelineGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, pipelineGroupName); + PipelineGroupResource pipelineGroup = client.GetPipelineGroupResource(pipelineGroupResourceId); + + // invoke the operation + PipelineGroupResource result = await pipelineGroup.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Updates a PipelineGroup instance + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdatesAPipelineGroupInstance() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupUpdate.json + // this example is just showing the usage of "PipelineGroups_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PipelineGroupResource created on azure + // for more information of creating PipelineGroupResource, please refer to the document of PipelineGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string pipelineGroupName = "plGroup1"; + ResourceIdentifier pipelineGroupResourceId = PipelineGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, pipelineGroupName); + PipelineGroupResource pipelineGroup = client.GetPipelineGroupResource(pipelineGroupResourceId); + + // invoke the operation + PipelineGroupPatch patch = new PipelineGroupPatch() + { + Tags = +{ +["tag1"] = "A", +["tag2"] = "B", +}, + Replicas = 3, + Receivers = +{ +new PipelineGroupReceiver(PipelineGroupReceiverType.Syslog,"syslog-receiver1") +{ +Syslog = new SyslogReceiver("0.0.0.0:514"), +} +}, + Processors = +{ +}, + Exporters = +{ +new PipelineGroupExporter(PipelineGroupExporterType.AzureMonitorWorkspaceLogs,"my-workspace-logs-exporter1") +{ +AzureMonitorWorkspaceLogs = new MonitorWorkspaceLogsExporter(new MonitorWorkspaceLogsApiConfig(new Uri("https://logs-myingestion-eb0s.eastus-1.ingest.monitor.azure.com"),"Custom-MyTableRawData_CL","dcr-00000000000000000000000000000000",new MonitorWorkspaceLogsSchemaMap(new MonitorWorkspaceLogsRecordMap[] +{ +new MonitorWorkspaceLogsRecordMap("body","Body"),new MonitorWorkspaceLogsRecordMap("severity_text","SeverityText"),new MonitorWorkspaceLogsRecordMap("time_unix_nano","TimeGenerated") +}))) +{ +Concurrency = new MonitorWorkspaceLogsExporterConcurrencyConfiguration() +{ +WorkerCount = 4, +BatchQueueSize = 100, +}, +}, +} +}, + Service = new PipelineGroupService(new PipelineGroupServicePipeline[] + { +new PipelineGroupServicePipeline("MyPipelineForLogs1",PipelineGroupServicePipelineType.Logs,new string[] +{ +"syslog-receiver1" +},new string[] +{ +"my-workspace-logs-exporter1" +}) +{ +Processors = +{ +}, +} + }), + }; + ArmOperation lro = await pipelineGroup.UpdateAsync(WaitUntil.Completed, patch); + PipelineGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Deletes a PipelineGroup instance + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeletesAPipelineGroupInstance() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupDelete.json + // this example is just showing the usage of "PipelineGroups_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PipelineGroupResource created on azure + // for more information of creating PipelineGroupResource, please refer to the document of PipelineGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string pipelineGroupName = "plGroup1"; + ResourceIdentifier pipelineGroupResourceId = PipelineGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, pipelineGroupName); + PipelineGroupResource pipelineGroup = client.GetPipelineGroupResource(pipelineGroupResourceId); + + // invoke the operation + await pipelineGroup.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ArmMonitorModelFactory.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ArmMonitorModelFactory.cs index 4ce51c136ec36..255a4411f5eec 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ArmMonitorModelFactory.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ArmMonitorModelFactory.cs @@ -7,10 +7,12 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Net; using Azure.Core; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Monitor.Models { @@ -1479,14 +1481,16 @@ public static MonitoringAccountDestination MonitoringAccountDestination(Resource /// The tags. /// The location. /// Resource entity tag (ETag). + /// The Data Collection Rule and Endpoint used for ingestion by default. + /// Properties related to the metrics container in the Azure Monitor Workspace. /// The immutable ID of the Azure Monitor workspace. This property is read-only. - /// Information about metrics for the Azure Monitor workspace. + /// Information about metrics for the Azure Monitor workspace. /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. - /// The Data Collection Rule and Endpoint used for ingestion by default. + /// The Data Collection Rule and Endpoint used for ingestion by default. /// List of private endpoint connections. /// Gets or sets allow or disallow public network access to workspace. /// A new instance for mocking. - public static MonitorWorkspaceResourceData MonitorWorkspaceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, string accountId = null, MonitorWorkspaceMetrics metrics = null, MonitorProvisioningState? provisioningState = null, MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings = null, IEnumerable privateEndpointConnections = null, MonitorWorkspacePublicNetworkAccess? publicNetworkAccess = null) + public static MonitorWorkspaceResourceData MonitorWorkspaceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings = null, MonitorWorkspaceMetrics metrics = null, string accountId = null, MonitorWorkspaceMetricProperties metricsPropertiesMetrics = null, MonitorProvisioningState? provisioningState = null, MonitorWorkspaceIngestionSettings defaultIngestionSettingsPropertiesDefaultIngestionSettings = null, IEnumerable privateEndpointConnections = null, MonitorWorkspacePublicNetworkAccess? publicNetworkAccess = null) { tags ??= new Dictionary(); privateEndpointConnections ??= new List(); @@ -1499,24 +1503,17 @@ public static MonitorWorkspaceResourceData MonitorWorkspaceResourceData(Resource tags, location, etag, - accountId, + defaultIngestionSettings, metrics, + accountId, + metricsPropertiesMetrics, provisioningState, - defaultIngestionSettings, + defaultIngestionSettingsPropertiesDefaultIngestionSettings, privateEndpointConnections?.ToList(), publicNetworkAccess, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The Prometheus query endpoint for the workspace. - /// An internal identifier for the metrics container. Only to be used by the system. - /// A new instance for mocking. - public static MonitorWorkspaceMetrics MonitorWorkspaceMetrics(string prometheusQueryEndpoint = null, string internalId = null) - { - return new MonitorWorkspaceMetrics(prometheusQueryEndpoint, internalId, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The Prometheus query endpoint for the workspace. /// An internal identifier for the metrics container. Only to be used by the system. @@ -1526,15 +1523,6 @@ public static MonitorWorkspaceMetricProperties MonitorWorkspaceMetricProperties( return new MonitorWorkspaceMetricProperties(prometheusQueryEndpoint, internalId, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The Azure resource Id of the default data collection rule for this workspace. - /// The Azure resource Id of the default data collection endpoint for this workspace. - /// A new instance for mocking. - public static MonitorWorkspaceDefaultIngestionSettings MonitorWorkspaceDefaultIngestionSettings(ResourceIdentifier dataCollectionRuleResourceId = null, ResourceIdentifier dataCollectionEndpointResourceId = null) - { - return new MonitorWorkspaceDefaultIngestionSettings(dataCollectionRuleResourceId, dataCollectionEndpointResourceId, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The Azure resource Id of the default data collection rule for this workspace. /// The Azure resource Id of the default data collection endpoint for this workspace. @@ -1569,5 +1557,86 @@ public static MonitorWorkspacePrivateEndpointConnection MonitorWorkspacePrivateE provisioningState, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The Azure resource Id of the default data collection rule for this workspace. + /// The Azure resource Id of the default data collection endpoint for this workspace. + /// A new instance for mocking. + public static MonitorWorkspaceDefaultIngestionSettings MonitorWorkspaceDefaultIngestionSettings(ResourceIdentifier dataCollectionRuleResourceId = null, ResourceIdentifier dataCollectionEndpointResourceId = null) + { + return new MonitorWorkspaceDefaultIngestionSettings(dataCollectionRuleResourceId, dataCollectionEndpointResourceId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Prometheus query endpoint for the workspace. + /// An internal identifier for the metrics container. Only to be used by the system. + /// A new instance for mocking. + public static MonitorWorkspaceMetrics MonitorWorkspaceMetrics(string prometheusQueryEndpoint = null, string internalId = null) + { + return new MonitorWorkspaceMetrics(prometheusQueryEndpoint, internalId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The extended location for given pipeline group. + /// Defines the amount of replicas of the pipeline group instance. + /// The receivers specified for a pipeline group instance. + /// The processors specified for a pipeline group instance. + /// The exporters specified for a pipeline group instance. + /// The service section for a given pipeline group instance. + /// Networking configurations for the pipeline group instance. + /// The provisioning state of a pipeline group instance. Set to Succeeded if everything is healthy. + /// A new instance for mocking. + public static PipelineGroupData PipelineGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedLocation extendedLocation = null, int? replicas = null, IEnumerable receivers = null, IEnumerable processors = null, IEnumerable exporters = null, PipelineGroupService service = null, IEnumerable networkingConfigurations = null, MonitorProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + receivers ??= new List(); + processors ??= new List(); + exporters ??= new List(); + networkingConfigurations ??= new List(); + + return new PipelineGroupData( + id, + name, + resourceType, + systemData, + tags, + location, + extendedLocation, + replicas, + receivers?.ToList(), + processors?.ToList(), + exporters?.ToList(), + service, + networkingConfigurations?.ToList(), + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Resource entity tag (ETag). + /// The immutable ID of the Azure Monitor workspace. This property is read-only. + /// Information about metrics for the Azure Monitor workspace. + /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. + /// The Data Collection Rule and Endpoint used for ingestion by default. + /// List of private endpoint connections. + /// Gets or sets allow or disallow public network access to workspace. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static MonitorWorkspaceResourceData MonitorWorkspaceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, string accountId, MonitorWorkspaceMetrics metrics, MonitorProvisioningState? provisioningState, MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings, IEnumerable privateEndpointConnections, MonitorWorkspacePublicNetworkAccess? publicNetworkAccess) + { + return MonitorWorkspaceResourceData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, etag: etag, defaultIngestionSettings: defaultIngestionSettings, metrics: metrics, accountId: accountId, metricsPropertiesMetrics: default, provisioningState: provisioningState, defaultIngestionSettingsPropertiesDefaultIngestionSettings: default, privateEndpointConnections: privateEndpointConnections, publicNetworkAccess: publicNetworkAccess); + } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorArmClient.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorArmClient.cs index 4cd68abc0769c..87e7c957670bf 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorArmClient.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorArmClient.cs @@ -740,5 +740,17 @@ public virtual MonitorWorkspaceResource GetMonitorWorkspaceResource(ResourceIden MonitorWorkspaceResource.ValidateResourceId(id); return new MonitorWorkspaceResource(Client, id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual PipelineGroupResource GetPipelineGroupResource(ResourceIdentifier id) + { + PipelineGroupResource.ValidateResourceId(id); + return new PipelineGroupResource(Client, id); + } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorResourceGroupResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorResourceGroupResource.cs index 89cec51deeeb5..77a43da33af2e 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorResourceGroupResource.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorResourceGroupResource.cs @@ -682,7 +682,7 @@ public virtual MonitorWorkspaceResourceCollection GetMonitorWorkspaceResources() ///
/// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -690,7 +690,7 @@ public virtual MonitorWorkspaceResourceCollection GetMonitorWorkspaceResources() /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -713,7 +713,7 @@ public virtual async Task> GetMonitorWorkspac ///
/// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -721,7 +721,7 @@ public virtual async Task> GetMonitorWorkspac /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -731,6 +731,75 @@ public virtual Response GetMonitorWorkspaceResource(st return GetMonitorWorkspaceResources().Get(azureMonitorWorkspaceName, cancellationToken); } + /// Gets a collection of PipelineGroupResources in the ResourceGroupResource. + /// An object representing collection of PipelineGroupResources and their operations over a PipelineGroupResource. + public virtual PipelineGroupCollection GetPipelineGroups() + { + return GetCachedClient(client => new PipelineGroupCollection(client, Id)); + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPipelineGroupAsync(string pipelineGroupName, CancellationToken cancellationToken = default) + { + return await GetPipelineGroups().GetAsync(pipelineGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPipelineGroup(string pipelineGroupName, CancellationToken cancellationToken = default) + { + return GetPipelineGroups().Get(pipelineGroupName, cancellationToken); + } + /// /// Get the status of an azure asynchronous operation associated with a private link scope operation. /// diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorSubscriptionResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorSubscriptionResource.cs index d7874bcfd39d7..f75f41e8c47cf 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorSubscriptionResource.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorSubscriptionResource.cs @@ -42,6 +42,8 @@ public partial class MockableMonitorSubscriptionResource : ArmResource private DataCollectionRulesRestOperations _dataCollectionRuleRestClient; private ClientDiagnostics _monitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics; private AzureMonitorWorkspacesRestOperations _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient; + private ClientDiagnostics _pipelineGroupClientDiagnostics; + private PipelineGroupsRestOperations _pipelineGroupRestClient; /// Initializes a new instance of the class for mocking. protected MockableMonitorSubscriptionResource() @@ -79,6 +81,8 @@ internal MockableMonitorSubscriptionResource(ArmClient client, ResourceIdentifie private DataCollectionRulesRestOperations DataCollectionRuleRestClient => _dataCollectionRuleRestClient ??= new DataCollectionRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DataCollectionRuleResource.ResourceType)); private ClientDiagnostics MonitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics => _monitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", MonitorWorkspaceResource.ResourceType.Namespace, Diagnostics); private AzureMonitorWorkspacesRestOperations MonitorWorkspaceResourceAzureMonitorWorkspacesRestClient => _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient ??= new AzureMonitorWorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(MonitorWorkspaceResource.ResourceType)); + private ClientDiagnostics PipelineGroupClientDiagnostics => _pipelineGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", PipelineGroupResource.ResourceType.Namespace, Diagnostics); + private PipelineGroupsRestOperations PipelineGroupRestClient => _pipelineGroupRestClient ??= new PipelineGroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(PipelineGroupResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -880,7 +884,7 @@ public virtual Pageable GetDataCollectionRules(Cance /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -910,7 +914,7 @@ public virtual AsyncPageable GetMonitorWorkspaceResour /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -926,5 +930,65 @@ public virtual Pageable GetMonitorWorkspaceResources(C HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MonitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MonitorWorkspaceResource(Client, MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(e)), MonitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics, Pipeline, "MockableMonitorSubscriptionResource.GetMonitorWorkspaceResources", "value", "nextLink", cancellationToken); } + + /// + /// Lists all workspaces in the specified subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Monitor/pipelineGroups + /// + /// + /// Operation Id + /// PipelineGroups_ListBySubscription + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetPipelineGroupsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PipelineGroupRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PipelineGroupRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PipelineGroupResource(Client, PipelineGroupData.DeserializePipelineGroupData(e)), PipelineGroupClientDiagnostics, Pipeline, "MockableMonitorSubscriptionResource.GetPipelineGroups", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all workspaces in the specified subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Monitor/pipelineGroups + /// + /// + /// Operation Id + /// PipelineGroups_ListBySubscription + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetPipelineGroups(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PipelineGroupRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PipelineGroupRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PipelineGroupResource(Client, PipelineGroupData.DeserializePipelineGroupData(e)), PipelineGroupClientDiagnostics, Pipeline, "MockableMonitorSubscriptionResource.GetPipelineGroups", "value", "nextLink", cancellationToken); + } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs index 03af2a4c249a0..afacedff434d7 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs @@ -950,6 +950,25 @@ public static MonitorWorkspaceResource GetMonitorWorkspaceResource(this ArmClien return GetMockableMonitorArmClient(client).GetMonitorWorkspaceResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static PipelineGroupResource GetPipelineGroupResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMonitorArmClient(client).GetPipelineGroupResource(id); + } + /// /// Gets a collection of AutoscaleSettingResources in the ResourceGroupResource. /// @@ -1817,7 +1836,7 @@ public static MonitorWorkspaceResourceCollection GetMonitorWorkspaceResources(th /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -1830,7 +1849,7 @@ public static MonitorWorkspaceResourceCollection GetMonitorWorkspaceResources(th /// /// /// The instance the method will execute against. - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1855,7 +1874,7 @@ public static async Task> GetMonitorWorkspace /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -1868,7 +1887,7 @@ public static async Task> GetMonitorWorkspace /// /// /// The instance the method will execute against. - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1880,6 +1899,99 @@ public static Response GetMonitorWorkspaceResource(thi return GetMockableMonitorResourceGroupResource(resourceGroupResource).GetMonitorWorkspaceResource(azureMonitorWorkspaceName, cancellationToken); } + /// + /// Gets a collection of PipelineGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of PipelineGroupResources and their operations over a PipelineGroupResource. + public static PipelineGroupCollection GetPipelineGroups(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableMonitorResourceGroupResource(resourceGroupResource).GetPipelineGroups(); + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetPipelineGroupAsync(this ResourceGroupResource resourceGroupResource, string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableMonitorResourceGroupResource(resourceGroupResource).GetPipelineGroupAsync(pipelineGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetPipelineGroup(this ResourceGroupResource resourceGroupResource, string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableMonitorResourceGroupResource(resourceGroupResource).GetPipelineGroup(pipelineGroupName, cancellationToken); + } + /// /// Get the status of an azure asynchronous operation associated with a private link scope operation. /// @@ -2900,7 +3012,7 @@ public static Pageable GetDataCollectionRules(this S /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -2936,7 +3048,7 @@ public static AsyncPageable GetMonitorWorkspaceResourc /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -2959,6 +3071,78 @@ public static Pageable GetMonitorWorkspaceResources(th return GetMockableMonitorSubscriptionResource(subscriptionResource).GetMonitorWorkspaceResources(cancellationToken); } + /// + /// Lists all workspaces in the specified subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Monitor/pipelineGroups + /// + /// + /// Operation Id + /// PipelineGroups_ListBySubscription + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetPipelineGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableMonitorSubscriptionResource(subscriptionResource).GetPipelineGroupsAsync(cancellationToken); + } + + /// + /// Lists all workspaces in the specified subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Monitor/pipelineGroups + /// + /// + /// Operation Id + /// PipelineGroups_ListBySubscription + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetPipelineGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableMonitorSubscriptionResource(subscriptionResource).GetPipelineGroups(cancellationToken); + } + /// /// Get the list of available event categories supported in the Activity Logs Service.<br>The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. /// diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/MonitorWorkspaceResourceOperationSource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/MonitorWorkspaceResourceOperationSource.cs new file mode 100644 index 0000000000000..75f67668f68e3 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/MonitorWorkspaceResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor +{ + internal class MonitorWorkspaceResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MonitorWorkspaceResourceOperationSource(ArmClient client) + { + _client = client; + } + + MonitorWorkspaceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(document.RootElement); + return new MonitorWorkspaceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(document.RootElement); + return new MonitorWorkspaceResource(_client, data); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/PipelineGroupOperationSource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/PipelineGroupOperationSource.cs new file mode 100644 index 0000000000000..062afe89cea66 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/PipelineGroupOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor +{ + internal class PipelineGroupOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal PipelineGroupOperationSource(ArmClient client) + { + _client = client; + } + + PipelineGroupResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = PipelineGroupData.DeserializePipelineGroupData(document.RootElement); + return new PipelineGroupResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = PipelineGroupData.DeserializePipelineGroupData(document.RootElement); + return new PipelineGroupResource(_client, data); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.Serialization.cs new file mode 100644 index 0000000000000..dac9c71be98cc --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class BatchProcessor : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchProcessor)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(BatchSize)) + { + writer.WritePropertyName("batchSize"u8); + writer.WriteNumberValue(BatchSize.Value); + } + if (Optional.IsDefined(Timeout)) + { + writer.WritePropertyName("timeout"u8); + writer.WriteNumberValue(Timeout.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + BatchProcessor 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(BatchProcessor)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBatchProcessor(document.RootElement, options); + } + + internal static BatchProcessor DeserializeBatchProcessor(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? batchSize = default; + int? timeout = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("batchSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batchSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeout"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeout = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BatchProcessor(batchSize, timeout, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BatchProcessor)} does not support writing '{options.Format}' format."); + } + } + + BatchProcessor IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBatchProcessor(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BatchProcessor)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.cs new file mode 100644 index 0000000000000..02048d30feb34 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Batch processor. + public partial class BatchProcessor + { + /// + /// 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 . + public BatchProcessor() + { + } + + /// Initializes a new instance of . + /// Size of the batch. + /// Timeout in milliseconds. + /// Keeps track of any properties unknown to the library. + internal BatchProcessor(int? batchSize, int? timeout, IDictionary serializedAdditionalRawData) + { + BatchSize = batchSize; + Timeout = timeout; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Size of the batch. + public int? BatchSize { get; set; } + /// Timeout in milliseconds. + public int? Timeout { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorProvisioningState.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorProvisioningState.cs index 4580a70b7d112..74b57e5f368a0 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorProvisioningState.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorProvisioningState.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Monitor.Models { - /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. + /// The provisioning state of a resource. public readonly partial struct MonitorProvisioningState : IEquatable { private readonly string _value; @@ -22,22 +22,22 @@ public MonitorProvisioningState(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string CreatingValue = "Creating"; private const string SucceededValue = "Succeeded"; - private const string DeletingValue = "Deleting"; private const string FailedValue = "Failed"; private const string CanceledValue = "Canceled"; + private const string CreatingValue = "Creating"; + private const string DeletingValue = "Deleting"; - /// Creating. - public static MonitorProvisioningState Creating { get; } = new MonitorProvisioningState(CreatingValue); - /// Succeeded. + /// Resource has been created. public static MonitorProvisioningState Succeeded { get; } = new MonitorProvisioningState(SucceededValue); - /// Deleting. - public static MonitorProvisioningState Deleting { get; } = new MonitorProvisioningState(DeletingValue); - /// Failed. + /// Resource creation failed. public static MonitorProvisioningState Failed { get; } = new MonitorProvisioningState(FailedValue); - /// Canceled. + /// Resource creation was canceled. public static MonitorProvisioningState Canceled { get; } = new MonitorProvisioningState(CanceledValue); + /// The resource is being created. + public static MonitorProvisioningState Creating { get; } = new MonitorProvisioningState(CreatingValue); + /// The resource is being deleted. + public static MonitorProvisioningState Deleting { get; } = new MonitorProvisioningState(DeletingValue); /// Determines if two values are the same. public static bool operator ==(MonitorProvisioningState left, MonitorProvisioningState right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.Serialization.cs new file mode 100644 index 0000000000000..e55f99ed45f7f --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.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.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsApiConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsApiConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("dataCollectionEndpointUrl"u8); + writer.WriteStringValue(DataCollectionEndpointUri.AbsoluteUri); + writer.WritePropertyName("stream"u8); + writer.WriteStringValue(Stream); + writer.WritePropertyName("dataCollectionRule"u8); + writer.WriteStringValue(DataCollectionRule); + writer.WritePropertyName("schema"u8); + writer.WriteObjectValue(Schema, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsApiConfig 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(MonitorWorkspaceLogsApiConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsApiConfig(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsApiConfig DeserializeMonitorWorkspaceLogsApiConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri dataCollectionEndpointUrl = default; + string stream = default; + string dataCollectionRule = default; + MonitorWorkspaceLogsSchemaMap schema = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dataCollectionEndpointUrl"u8)) + { + dataCollectionEndpointUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("stream"u8)) + { + stream = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataCollectionRule"u8)) + { + dataCollectionRule = property.Value.GetString(); + continue; + } + if (property.NameEquals("schema"u8)) + { + schema = MonitorWorkspaceLogsSchemaMap.DeserializeMonitorWorkspaceLogsSchemaMap(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsApiConfig(dataCollectionEndpointUrl, stream, dataCollectionRule, schema, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsApiConfig)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsApiConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsApiConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsApiConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.cs new file mode 100644 index 0000000000000..fde7c209418a7 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.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 Azure.ResourceManager.Monitor.Models +{ + /// Azure Monitor Workspace Logs Api configurations. + public partial class MonitorWorkspaceLogsApiConfig + { + /// + /// 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 . + /// Data collection endpoint ingestion url. + /// Stream name in destination. Azure Monitor stream is related to the destination table. + /// Data Collection Rule (DCR) immutable id. + /// The schema mapping for incoming data. + /// , , or is null. + public MonitorWorkspaceLogsApiConfig(Uri dataCollectionEndpointUri, string stream, string dataCollectionRule, MonitorWorkspaceLogsSchemaMap schema) + { + Argument.AssertNotNull(dataCollectionEndpointUri, nameof(dataCollectionEndpointUri)); + Argument.AssertNotNull(stream, nameof(stream)); + Argument.AssertNotNull(dataCollectionRule, nameof(dataCollectionRule)); + Argument.AssertNotNull(schema, nameof(schema)); + + DataCollectionEndpointUri = dataCollectionEndpointUri; + Stream = stream; + DataCollectionRule = dataCollectionRule; + Schema = schema; + } + + /// Initializes a new instance of . + /// Data collection endpoint ingestion url. + /// Stream name in destination. Azure Monitor stream is related to the destination table. + /// Data Collection Rule (DCR) immutable id. + /// The schema mapping for incoming data. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsApiConfig(Uri dataCollectionEndpointUri, string stream, string dataCollectionRule, MonitorWorkspaceLogsSchemaMap schema, IDictionary serializedAdditionalRawData) + { + DataCollectionEndpointUri = dataCollectionEndpointUri; + Stream = stream; + DataCollectionRule = dataCollectionRule; + Schema = schema; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MonitorWorkspaceLogsApiConfig() + { + } + + /// Data collection endpoint ingestion url. + public Uri DataCollectionEndpointUri { get; set; } + /// Stream name in destination. Azure Monitor stream is related to the destination table. + public string Stream { get; set; } + /// Data Collection Rule (DCR) immutable id. + public string DataCollectionRule { get; set; } + /// The schema mapping for incoming data. + public MonitorWorkspaceLogsSchemaMap Schema { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporter.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporter.Serialization.cs new file mode 100644 index 0000000000000..80b1837f6532e --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporter.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsExporter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporter)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("api"u8); + writer.WriteObjectValue(Api, options); + if (Optional.IsDefined(Concurrency)) + { + writer.WritePropertyName("concurrency"u8); + writer.WriteObjectValue(Concurrency, options); + } + if (Optional.IsDefined(Cache)) + { + writer.WritePropertyName("cache"u8); + writer.WriteObjectValue(Cache, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsExporter 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(MonitorWorkspaceLogsExporter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsExporter(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsExporter DeserializeMonitorWorkspaceLogsExporter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MonitorWorkspaceLogsApiConfig api = default; + MonitorWorkspaceLogsExporterConcurrencyConfiguration concurrency = default; + MonitorWorkspaceLogsExporterCacheConfiguration cache = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("api"u8)) + { + api = MonitorWorkspaceLogsApiConfig.DeserializeMonitorWorkspaceLogsApiConfig(property.Value, options); + continue; + } + if (property.NameEquals("concurrency"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + concurrency = MonitorWorkspaceLogsExporterConcurrencyConfiguration.DeserializeMonitorWorkspaceLogsExporterConcurrencyConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("cache"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cache = MonitorWorkspaceLogsExporterCacheConfiguration.DeserializeMonitorWorkspaceLogsExporterCacheConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsExporter(api, concurrency, cache, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporter)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsExporter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsExporter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporter.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporter.cs new file mode 100644 index 0000000000000..d96a12483b1dc --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporter.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; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Azure Monitor Workspace Logs specific configurations. + public partial class MonitorWorkspaceLogsExporter + { + /// + /// 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 . + /// API configurations for Azure Monitor workspace exporter. + /// is null. + public MonitorWorkspaceLogsExporter(MonitorWorkspaceLogsApiConfig api) + { + Argument.AssertNotNull(api, nameof(api)); + + Api = api; + } + + /// Initializes a new instance of . + /// API configurations for Azure Monitor workspace exporter. + /// Concurrency configuration for the exporter. + /// Cache configurations. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsExporter(MonitorWorkspaceLogsApiConfig api, MonitorWorkspaceLogsExporterConcurrencyConfiguration concurrency, MonitorWorkspaceLogsExporterCacheConfiguration cache, IDictionary serializedAdditionalRawData) + { + Api = api; + Concurrency = concurrency; + Cache = cache; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MonitorWorkspaceLogsExporter() + { + } + + /// API configurations for Azure Monitor workspace exporter. + public MonitorWorkspaceLogsApiConfig Api { get; set; } + /// Concurrency configuration for the exporter. + public MonitorWorkspaceLogsExporterConcurrencyConfiguration Concurrency { get; set; } + /// Cache configurations. + public MonitorWorkspaceLogsExporterCacheConfiguration Cache { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.Serialization.cs new file mode 100644 index 0000000000000..392160487704d --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsExporterCacheConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterCacheConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(MaxStorageUsage)) + { + writer.WritePropertyName("maxStorageUsage"u8); + writer.WriteNumberValue(MaxStorageUsage.Value); + } + if (Optional.IsDefined(RetentionPeriod)) + { + writer.WritePropertyName("retentionPeriod"u8); + writer.WriteNumberValue(RetentionPeriod.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsExporterCacheConfiguration 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(MonitorWorkspaceLogsExporterCacheConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsExporterCacheConfiguration(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsExporterCacheConfiguration DeserializeMonitorWorkspaceLogsExporterCacheConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxStorageUsage = default; + int? retentionPeriod = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxStorageUsage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxStorageUsage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("retentionPeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retentionPeriod = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsExporterCacheConfiguration(maxStorageUsage, retentionPeriod, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterCacheConfiguration)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsExporterCacheConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsExporterCacheConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterCacheConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.cs new file mode 100644 index 0000000000000..d5e6e39b94909 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Cache configurations. + public partial class MonitorWorkspaceLogsExporterCacheConfiguration + { + /// + /// 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 . + public MonitorWorkspaceLogsExporterCacheConfiguration() + { + } + + /// Initializes a new instance of . + /// Max storage usage in megabytes. + /// Retention period in minutes. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsExporterCacheConfiguration(int? maxStorageUsage, int? retentionPeriod, IDictionary serializedAdditionalRawData) + { + MaxStorageUsage = maxStorageUsage; + RetentionPeriod = retentionPeriod; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Max storage usage in megabytes. + public int? MaxStorageUsage { get; set; } + /// Retention period in minutes. + public int? RetentionPeriod { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.Serialization.cs new file mode 100644 index 0000000000000..865a3b8ea9fb2 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsExporterConcurrencyConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterConcurrencyConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(WorkerCount)) + { + writer.WritePropertyName("workerCount"u8); + writer.WriteNumberValue(WorkerCount.Value); + } + if (Optional.IsDefined(BatchQueueSize)) + { + writer.WritePropertyName("batchQueueSize"u8); + writer.WriteNumberValue(BatchQueueSize.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsExporterConcurrencyConfiguration 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(MonitorWorkspaceLogsExporterConcurrencyConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsExporterConcurrencyConfiguration(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsExporterConcurrencyConfiguration DeserializeMonitorWorkspaceLogsExporterConcurrencyConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? workerCount = default; + int? batchQueueSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("workerCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workerCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("batchQueueSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batchQueueSize = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsExporterConcurrencyConfiguration(workerCount, batchQueueSize, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterConcurrencyConfiguration)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsExporterConcurrencyConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsExporterConcurrencyConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterConcurrencyConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.cs new file mode 100644 index 0000000000000..4c33766c83a0f --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Concurrent publishing configuration. + public partial class MonitorWorkspaceLogsExporterConcurrencyConfiguration + { + /// + /// 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 . + public MonitorWorkspaceLogsExporterConcurrencyConfiguration() + { + } + + /// Initializes a new instance of . + /// Number of parallel workers processing the log queues. + /// Size of the queue for log batches. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsExporterConcurrencyConfiguration(int? workerCount, int? batchQueueSize, IDictionary serializedAdditionalRawData) + { + WorkerCount = workerCount; + BatchQueueSize = batchQueueSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Number of parallel workers processing the log queues. + public int? WorkerCount { get; set; } + /// Size of the queue for log batches. + public int? BatchQueueSize { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsRecordMap.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsRecordMap.Serialization.cs new file mode 100644 index 0000000000000..be0ac6921b79c --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsRecordMap.Serialization.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsRecordMap : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsRecordMap)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("from"u8); + writer.WriteStringValue(From); + writer.WritePropertyName("to"u8); + writer.WriteStringValue(To); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsRecordMap 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(MonitorWorkspaceLogsRecordMap)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsRecordMap(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsRecordMap DeserializeMonitorWorkspaceLogsRecordMap(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string @from = default; + string to = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("from"u8)) + { + @from = property.Value.GetString(); + continue; + } + if (property.NameEquals("to"u8)) + { + to = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsRecordMap(@from, to, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsRecordMap)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsRecordMap IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsRecordMap(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsRecordMap)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsRecordMap.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsRecordMap.cs new file mode 100644 index 0000000000000..e9451d4a730ce --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsRecordMap.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Record map for schema in azure monitor. + public partial class MonitorWorkspaceLogsRecordMap + { + /// + /// 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 . + /// Record Map Key. + /// Record Map Value. + /// or is null. + public MonitorWorkspaceLogsRecordMap(string @from, string to) + { + Argument.AssertNotNull(@from, nameof(@from)); + Argument.AssertNotNull(to, nameof(to)); + + From = @from; + To = to; + } + + /// Initializes a new instance of . + /// Record Map Key. + /// Record Map Value. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsRecordMap(string @from, string to, IDictionary serializedAdditionalRawData) + { + From = @from; + To = to; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MonitorWorkspaceLogsRecordMap() + { + } + + /// Record Map Key. + public string From { get; set; } + /// Record Map Value. + public string To { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsResourceMap.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsResourceMap.Serialization.cs new file mode 100644 index 0000000000000..49687a5fb1fe2 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsResourceMap.Serialization.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsResourceMap : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsResourceMap)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("from"u8); + writer.WriteStringValue(From); + writer.WritePropertyName("to"u8); + writer.WriteStringValue(To); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsResourceMap 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(MonitorWorkspaceLogsResourceMap)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsResourceMap(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsResourceMap DeserializeMonitorWorkspaceLogsResourceMap(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string @from = default; + string to = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("from"u8)) + { + @from = property.Value.GetString(); + continue; + } + if (property.NameEquals("to"u8)) + { + to = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsResourceMap(@from, to, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsResourceMap)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsResourceMap IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsResourceMap(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsResourceMap)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsResourceMap.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsResourceMap.cs new file mode 100644 index 0000000000000..eba157ef99571 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsResourceMap.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Resource map for schema in azure monitor. + public partial class MonitorWorkspaceLogsResourceMap + { + /// + /// 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 . + /// Resource Map Key. + /// Resource Map Value. + /// or is null. + public MonitorWorkspaceLogsResourceMap(string @from, string to) + { + Argument.AssertNotNull(@from, nameof(@from)); + Argument.AssertNotNull(to, nameof(to)); + + From = @from; + To = to; + } + + /// Initializes a new instance of . + /// Resource Map Key. + /// Resource Map Value. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsResourceMap(string @from, string to, IDictionary serializedAdditionalRawData) + { + From = @from; + To = to; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MonitorWorkspaceLogsResourceMap() + { + } + + /// Resource Map Key. + public string From { get; set; } + /// Resource Map Value. + public string To { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.Serialization.cs new file mode 100644 index 0000000000000..232c9b55097bf --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsSchemaMap : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsSchemaMap)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("recordMap"u8); + writer.WriteStartArray(); + foreach (var item in RecordMap) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsCollectionDefined(ResourceMap)) + { + writer.WritePropertyName("resourceMap"u8); + writer.WriteStartArray(); + foreach (var item in ResourceMap) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ScopeMap)) + { + writer.WritePropertyName("scopeMap"u8); + writer.WriteStartArray(); + foreach (var item in ScopeMap) + { + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsSchemaMap 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(MonitorWorkspaceLogsSchemaMap)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsSchemaMap(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsSchemaMap DeserializeMonitorWorkspaceLogsSchemaMap(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList recordMap = default; + IList resourceMap = default; + IList scopeMap = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recordMap"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MonitorWorkspaceLogsRecordMap.DeserializeMonitorWorkspaceLogsRecordMap(item, options)); + } + recordMap = array; + continue; + } + if (property.NameEquals("resourceMap"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MonitorWorkspaceLogsResourceMap.DeserializeMonitorWorkspaceLogsResourceMap(item, options)); + } + resourceMap = array; + continue; + } + if (property.NameEquals("scopeMap"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MonitorWorkspaceLogsScopeMap.DeserializeMonitorWorkspaceLogsScopeMap(item, options)); + } + scopeMap = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsSchemaMap(recordMap, resourceMap ?? new ChangeTrackingList(), scopeMap ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsSchemaMap)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsSchemaMap IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsSchemaMap(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsSchemaMap)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.cs new file mode 100644 index 0000000000000..0b99a79e0837d --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Schema map for azure monitor for logs. + public partial class MonitorWorkspaceLogsSchemaMap + { + /// + /// 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 . + /// Record Map. + /// is null. + public MonitorWorkspaceLogsSchemaMap(IEnumerable recordMap) + { + Argument.AssertNotNull(recordMap, nameof(recordMap)); + + RecordMap = recordMap.ToList(); + ResourceMap = new ChangeTrackingList(); + ScopeMap = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Record Map. + /// Resource Map captures information about the entity for which telemetry is recorded. For example, metrics exposed by a Kubernetes container can be linked to a resource that specifies the cluster, namespace, pod, and container name.Resource may capture an entire hierarchy of entity identification. It may describe the host in the cloud and specific container or an application running in the process. + /// A scope map is a logical unit of the application code with which the emitted telemetry can be associated. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsSchemaMap(IList recordMap, IList resourceMap, IList scopeMap, IDictionary serializedAdditionalRawData) + { + RecordMap = recordMap; + ResourceMap = resourceMap; + ScopeMap = scopeMap; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MonitorWorkspaceLogsSchemaMap() + { + } + + /// Record Map. + public IList RecordMap { get; } + /// Resource Map captures information about the entity for which telemetry is recorded. For example, metrics exposed by a Kubernetes container can be linked to a resource that specifies the cluster, namespace, pod, and container name.Resource may capture an entire hierarchy of entity identification. It may describe the host in the cloud and specific container or an application running in the process. + public IList ResourceMap { get; } + /// A scope map is a logical unit of the application code with which the emitted telemetry can be associated. + public IList ScopeMap { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsScopeMap.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsScopeMap.Serialization.cs new file mode 100644 index 0000000000000..a8d239abcf068 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsScopeMap.Serialization.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsScopeMap : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsScopeMap)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("from"u8); + writer.WriteStringValue(From); + writer.WritePropertyName("to"u8); + writer.WriteStringValue(To); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsScopeMap 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(MonitorWorkspaceLogsScopeMap)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsScopeMap(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsScopeMap DeserializeMonitorWorkspaceLogsScopeMap(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string @from = default; + string to = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("from"u8)) + { + @from = property.Value.GetString(); + continue; + } + if (property.NameEquals("to"u8)) + { + to = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsScopeMap(@from, to, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsScopeMap)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsScopeMap IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsScopeMap(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsScopeMap)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsScopeMap.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsScopeMap.cs new file mode 100644 index 0000000000000..f7e7a6088ddf0 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsScopeMap.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Scope map for schema in azure monitor. + public partial class MonitorWorkspaceLogsScopeMap + { + /// + /// 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 . + /// Scope Map Key. + /// Scope Map Value. + /// or is null. + public MonitorWorkspaceLogsScopeMap(string @from, string to) + { + Argument.AssertNotNull(@from, nameof(@from)); + Argument.AssertNotNull(to, nameof(to)); + + From = @from; + To = to; + } + + /// Initializes a new instance of . + /// Scope Map Key. + /// Scope Map Value. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsScopeMap(string @from, string to, IDictionary serializedAdditionalRawData) + { + From = @from; + To = to; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MonitorWorkspaceLogsScopeMap() + { + } + + /// Scope Map Key. + public string From { get; set; } + /// Scope Map Value. + public string To { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetricProperties.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetricProperties.cs index 06eaca3e7f3ab..07e2695ccf632 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetricProperties.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetricProperties.cs @@ -46,7 +46,7 @@ public partial class MonitorWorkspaceMetricProperties private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal MonitorWorkspaceMetricProperties() + public MonitorWorkspaceMetricProperties() { } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetrics.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetrics.cs index ffde5a9514071..e7dc70fb484bc 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetrics.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetrics.cs @@ -10,11 +10,11 @@ namespace Azure.ResourceManager.Monitor.Models { - /// Information about metrics for the Azure Monitor workspace. + /// Properties related to the metrics container in the Azure Monitor Workspace. public partial class MonitorWorkspaceMetrics : MonitorWorkspaceMetricProperties { /// Initializes a new instance of . - internal MonitorWorkspaceMetrics() + public MonitorWorkspaceMetrics() { } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePrivateEndpointConnection.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePrivateEndpointConnection.cs index 1a70674f04dce..ad55b8582e0ee 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePrivateEndpointConnection.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePrivateEndpointConnection.cs @@ -49,7 +49,7 @@ public partial class MonitorWorkspacePrivateEndpointConnection : ResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal MonitorWorkspacePrivateEndpointConnection() + public MonitorWorkspacePrivateEndpointConnection() { GroupIds = new ChangeTrackingList(); } @@ -76,15 +76,15 @@ internal MonitorWorkspacePrivateEndpointConnection(ResourceIdentifier id, string /// The group ids for the private endpoint resource. public IReadOnlyList GroupIds { get; } /// The private endpoint resource. - internal SubResource PrivateEndpoint { get; } + internal SubResource PrivateEndpoint { get; set; } /// Gets Id. public ResourceIdentifier PrivateEndpointId { - get => PrivateEndpoint?.Id; + get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; } /// A collection of information about the state of the connection between service consumer and provider. - public MonitorPrivateLinkServiceConnectionState ConnectionState { get; } + public MonitorPrivateLinkServiceConnectionState ConnectionState { get; set; } /// The provisioning state of the private endpoint connection resource. public MonitorPrivateEndpointConnectionProvisioningState? ProvisioningState { get; } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePublicNetworkAccess.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePublicNetworkAccess.cs index 860c2618eefd9..dd3d911218774 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePublicNetworkAccess.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePublicNetworkAccess.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Monitor.Models { - /// Gets or sets allow or disallow public network access to workspace. + /// State of the public network access. public readonly partial struct MonitorWorkspacePublicNetworkAccess : IEquatable { private readonly string _value; @@ -25,9 +25,9 @@ public MonitorWorkspacePublicNetworkAccess(string value) private const string EnabledValue = "Enabled"; private const string DisabledValue = "Disabled"; - /// Enabled. + /// The public network access is enabled. public static MonitorWorkspacePublicNetworkAccess Enabled { get; } = new MonitorWorkspacePublicNetworkAccess(EnabledValue); - /// Disabled. + /// The public network access is disabled. public static MonitorWorkspacePublicNetworkAccess Disabled { get; } = new MonitorWorkspacePublicNetworkAccess(DisabledValue); /// Determines if two values are the same. public static bool operator ==(MonitorWorkspacePublicNetworkAccess left, MonitorWorkspacePublicNetworkAccess right) => left.Equals(right); diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.Serialization.cs index e2dbd69861093..317ff14eb54e5 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.Serialization.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.Serialization.cs @@ -36,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -77,7 +77,7 @@ internal static MonitorWorkspaceResourceListResult DeserializeMonitorWorkspaceRe return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,7 +94,11 @@ internal static MonitorWorkspaceResourceListResult DeserializeMonitorWorkspaceRe } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.cs index 8bc701d8b4de5..8c82142ca1c1b 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Monitor.Models { - /// A pageable list of resources. + /// The response of a AzureMonitorWorkspace list operation. internal partial class MonitorWorkspaceResourceListResult { /// @@ -47,7 +47,7 @@ internal partial class MonitorWorkspaceResourceListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// A list of resources. + /// The AzureMonitorWorkspace items on this page. /// is null. internal MonitorWorkspaceResourceListResult(IEnumerable value) { @@ -57,10 +57,10 @@ internal MonitorWorkspaceResourceListResult(IEnumerable Initializes a new instance of . - /// A list of resources. - /// The URL to use for getting the next set of results. + /// The AzureMonitorWorkspace items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal MonitorWorkspaceResourceListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal MonitorWorkspaceResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -72,9 +72,9 @@ internal MonitorWorkspaceResourceListResult() { } - /// A list of resources. + /// The AzureMonitorWorkspace items on this page. public IReadOnlyList Value { get; } - /// The URL to use for getting the next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.Serialization.cs index ba2a1cf7c5897..c318abfb7e0d0 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.Serialization.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.Serialization.cs @@ -37,6 +37,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteEndObject(); } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Metrics)) + { + writer.WritePropertyName("metrics"u8); + writer.WriteObjectValue(Metrics, options); + } + writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -76,6 +84,7 @@ internal static MonitorWorkspaceResourcePatch DeserializeMonitorWorkspaceResourc return null; } IDictionary tags = default; + MonitorWorkspaceMetricProperties metrics = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,13 +103,34 @@ internal static MonitorWorkspaceResourcePatch DeserializeMonitorWorkspaceResourc tags = dictionary; continue; } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("metrics"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metrics = MonitorWorkspaceMetricProperties.DeserializeMonitorWorkspaceMetricProperties(property0.Value, options); + continue; + } + } + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new MonitorWorkspaceResourcePatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new MonitorWorkspaceResourcePatch(tags ?? new ChangeTrackingDictionary(), metrics, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.cs index 30fcd75d84823..fc0d1562c448e 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Monitor.Models { - /// Definition of ARM tracked top level resource properties for update operation. + /// The type used for update operations of the AzureMonitorWorkspace. public partial class MonitorWorkspaceResourcePatch { /// @@ -53,14 +53,18 @@ public MonitorWorkspaceResourcePatch() /// Initializes a new instance of . /// Resource tags. + /// Information about metrics for the Azure Monitor workspace. /// Keeps track of any properties unknown to the library. - internal MonitorWorkspaceResourcePatch(IDictionary tags, IDictionary serializedAdditionalRawData) + internal MonitorWorkspaceResourcePatch(IDictionary tags, MonitorWorkspaceMetricProperties metrics, IDictionary serializedAdditionalRawData) { Tags = tags; + Metrics = metrics; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Resource tags. public IDictionary Tags { get; } + /// Information about metrics for the Azure Monitor workspace. + public MonitorWorkspaceMetricProperties Metrics { get; set; } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.Serialization.cs new file mode 100644 index 0000000000000..396553c8a4fe5 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + internal partial class OtlpReceiver : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OtlpReceiver)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OtlpReceiver 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(OtlpReceiver)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOtlpReceiver(document.RootElement, options); + } + + internal static OtlpReceiver DeserializeOtlpReceiver(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string endpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpoint"u8)) + { + endpoint = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OtlpReceiver(endpoint, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OtlpReceiver)} does not support writing '{options.Format}' format."); + } + } + + OtlpReceiver IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOtlpReceiver(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OtlpReceiver)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.cs new file mode 100644 index 0000000000000..7353d763248b3 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.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; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// OTLP Receiver. + internal partial class OtlpReceiver + { + /// + /// 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 . + /// OTLP GRPC endpoint definition. Example: 0.0.0.0:<port>. + /// is null. + public OtlpReceiver(string endpoint) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + + Endpoint = endpoint; + } + + /// Initializes a new instance of . + /// OTLP GRPC endpoint definition. Example: 0.0.0.0:<port>. + /// Keeps track of any properties unknown to the library. + internal OtlpReceiver(string endpoint, IDictionary serializedAdditionalRawData) + { + Endpoint = endpoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OtlpReceiver() + { + } + + /// OTLP GRPC endpoint definition. Example: 0.0.0.0:<port>. + public string Endpoint { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.Serialization.cs new file mode 100644 index 0000000000000..b89f18c28e28b --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.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.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupExporter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupExporter)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ExporterType.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(AzureMonitorWorkspaceLogs)) + { + writer.WritePropertyName("azureMonitorWorkspaceLogs"u8); + writer.WriteObjectValue(AzureMonitorWorkspaceLogs, options); + } + if (Optional.IsDefined(Tcp)) + { + writer.WritePropertyName("tcp"u8); + writer.WriteObjectValue(Tcp, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupExporter 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(PipelineGroupExporter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupExporter(document.RootElement, options); + } + + internal static PipelineGroupExporter DeserializePipelineGroupExporter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PipelineGroupExporterType type = default; + string name = default; + MonitorWorkspaceLogsExporter azureMonitorWorkspaceLogs = default; + TcpExporter tcp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new PipelineGroupExporterType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureMonitorWorkspaceLogs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureMonitorWorkspaceLogs = MonitorWorkspaceLogsExporter.DeserializeMonitorWorkspaceLogsExporter(property.Value, options); + continue; + } + if (property.NameEquals("tcp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tcp = TcpExporter.DeserializeTcpExporter(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupExporter(type, name, azureMonitorWorkspaceLogs, tcp, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupExporter)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupExporter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupExporter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupExporter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.cs new file mode 100644 index 0000000000000..a518ca42769c9 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Exporter Info. + public partial class PipelineGroupExporter + { + /// + /// 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 type of exporter. + /// The name of exporter. + /// is null. + public PipelineGroupExporter(PipelineGroupExporterType exporterType, string name) + { + Argument.AssertNotNull(name, nameof(name)); + + ExporterType = exporterType; + Name = name; + } + + /// Initializes a new instance of . + /// The type of exporter. + /// The name of exporter. + /// Azure Monitor Workspace Logs specific configurations. + /// TCP based exporter. Used for pipelineGroup exporter. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupExporter(PipelineGroupExporterType exporterType, string name, MonitorWorkspaceLogsExporter azureMonitorWorkspaceLogs, TcpExporter tcp, IDictionary serializedAdditionalRawData) + { + ExporterType = exporterType; + Name = name; + AzureMonitorWorkspaceLogs = azureMonitorWorkspaceLogs; + Tcp = tcp; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupExporter() + { + } + + /// The type of exporter. + public PipelineGroupExporterType ExporterType { get; set; } + /// The name of exporter. + public string Name { get; set; } + /// Azure Monitor Workspace Logs specific configurations. + public MonitorWorkspaceLogsExporter AzureMonitorWorkspaceLogs { get; set; } + /// TCP based exporter. Used for pipelineGroup exporter. + internal TcpExporter Tcp { get; set; } + /// TCP url to export. + public Uri TcpUri + { + get => Tcp is null ? default : Tcp.Uri; + set => Tcp = new TcpExporter(value); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporterType.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporterType.cs new file mode 100644 index 0000000000000..834d298026442 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporterType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The exporter type. + public readonly partial struct PipelineGroupExporterType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PipelineGroupExporterType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureMonitorWorkspaceLogsValue = "AzureMonitorWorkspaceLogs"; + private const string PipelineGroupValue = "PipelineGroup"; + + /// Export logs to Azure Monitor Workspace. + public static PipelineGroupExporterType AzureMonitorWorkspaceLogs { get; } = new PipelineGroupExporterType(AzureMonitorWorkspaceLogsValue); + /// Export data to another pipeline group instance. + public static PipelineGroupExporterType PipelineGroup { get; } = new PipelineGroupExporterType(PipelineGroupValue); + /// Determines if two values are the same. + public static bool operator ==(PipelineGroupExporterType left, PipelineGroupExporterType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PipelineGroupExporterType left, PipelineGroupExporterType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PipelineGroupExporterType(string value) => new PipelineGroupExporterType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PipelineGroupExporterType other && Equals(other); + /// + public bool Equals(PipelineGroupExporterType 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/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExternalNetworkingMode.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExternalNetworkingMode.cs new file mode 100644 index 0000000000000..f459fcdcd7803 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExternalNetworkingMode.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The mode of the external networking. + public readonly partial struct PipelineGroupExternalNetworkingMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PipelineGroupExternalNetworkingMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LoadBalancerOnlyValue = "LoadBalancerOnly"; + + /// Load balancer only. + public static PipelineGroupExternalNetworkingMode LoadBalancerOnly { get; } = new PipelineGroupExternalNetworkingMode(LoadBalancerOnlyValue); + /// Determines if two values are the same. + public static bool operator ==(PipelineGroupExternalNetworkingMode left, PipelineGroupExternalNetworkingMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PipelineGroupExternalNetworkingMode left, PipelineGroupExternalNetworkingMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PipelineGroupExternalNetworkingMode(string value) => new PipelineGroupExternalNetworkingMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PipelineGroupExternalNetworkingMode other && Equals(other); + /// + public bool Equals(PipelineGroupExternalNetworkingMode 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/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupListResult.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupListResult.Serialization.cs new file mode 100644 index 0000000000000..70400624d778c --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupListResult.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + internal partial class PipelineGroupListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupListResult 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(PipelineGroupListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupListResult(document.RootElement, options); + } + + internal static PipelineGroupListResult DeserializePipelineGroupListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PipelineGroupData.DeserializePipelineGroupData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupListResult)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupListResult.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupListResult.cs new file mode 100644 index 0000000000000..2dedcf3a17406 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The response of a PipelineGroup list operation. + internal partial class PipelineGroupListResult + { + /// + /// 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 PipelineGroup items on this page. + /// is null. + internal PipelineGroupListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PipelineGroup items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupListResult() + { + } + + /// The PipelineGroup items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.Serialization.cs new file mode 100644 index 0000000000000..76bec4b1aa3ae --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupNetworkingConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupNetworkingConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("externalNetworkingMode"u8); + writer.WriteStringValue(ExternalNetworkingMode.ToString()); + if (Optional.IsDefined(Host)) + { + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + } + writer.WritePropertyName("routes"u8); + writer.WriteStartArray(); + foreach (var item in Routes) + { + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupNetworkingConfiguration 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(PipelineGroupNetworkingConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupNetworkingConfiguration(document.RootElement, options); + } + + internal static PipelineGroupNetworkingConfiguration DeserializePipelineGroupNetworkingConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PipelineGroupExternalNetworkingMode externalNetworkingMode = default; + string host = default; + IList routes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("externalNetworkingMode"u8)) + { + externalNetworkingMode = new PipelineGroupExternalNetworkingMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("routes"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PipelineGroupNetworkingRoute.DeserializePipelineGroupNetworkingRoute(item, options)); + } + routes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupNetworkingConfiguration(externalNetworkingMode, host, routes, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupNetworkingConfiguration)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupNetworkingConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupNetworkingConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupNetworkingConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.cs new file mode 100644 index 0000000000000..27d3bfe7e2c2b --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Networking configuration for the pipeline group instance. + public partial class PipelineGroupNetworkingConfiguration + { + /// + /// 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 . + /// External networking mode. + /// Networking routes configuration. + /// is null. + public PipelineGroupNetworkingConfiguration(PipelineGroupExternalNetworkingMode externalNetworkingMode, IEnumerable routes) + { + Argument.AssertNotNull(routes, nameof(routes)); + + ExternalNetworkingMode = externalNetworkingMode; + Routes = routes.ToList(); + } + + /// Initializes a new instance of . + /// External networking mode. + /// The address exposed on the cluster. Example: azuremonitorpipeline.contoso.com. + /// Networking routes configuration. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupNetworkingConfiguration(PipelineGroupExternalNetworkingMode externalNetworkingMode, string host, IList routes, IDictionary serializedAdditionalRawData) + { + ExternalNetworkingMode = externalNetworkingMode; + Host = host; + Routes = routes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupNetworkingConfiguration() + { + } + + /// External networking mode. + public PipelineGroupExternalNetworkingMode ExternalNetworkingMode { get; set; } + /// The address exposed on the cluster. Example: azuremonitorpipeline.contoso.com. + public string Host { get; set; } + /// Networking routes configuration. + public IList Routes { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.Serialization.cs new file mode 100644 index 0000000000000..89e90fddc0df5 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupNetworkingRoute : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupNetworkingRoute)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("receiver"u8); + writer.WriteStringValue(Receiver); + if (Optional.IsDefined(Port)) + { + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port.Value); + } + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + if (Optional.IsDefined(Subdomain)) + { + writer.WritePropertyName("subdomain"u8); + writer.WriteStringValue(Subdomain); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupNetworkingRoute 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(PipelineGroupNetworkingRoute)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupNetworkingRoute(document.RootElement, options); + } + + internal static PipelineGroupNetworkingRoute DeserializePipelineGroupNetworkingRoute(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string receiver = default; + int? port = default; + string path = default; + string subdomain = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("receiver"u8)) + { + receiver = property.Value.GetString(); + continue; + } + if (property.NameEquals("port"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("subdomain"u8)) + { + subdomain = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupNetworkingRoute(receiver, port, path, subdomain, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupNetworkingRoute)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupNetworkingRoute IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupNetworkingRoute(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupNetworkingRoute)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.cs new file mode 100644 index 0000000000000..62835f25833df --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.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 Azure.ResourceManager.Monitor.Models +{ + /// Networking route configuration. + public partial class PipelineGroupNetworkingRoute + { + /// + /// 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 previously defined receiver. + /// is null. + public PipelineGroupNetworkingRoute(string receiver) + { + Argument.AssertNotNull(receiver, nameof(receiver)); + + Receiver = receiver; + } + + /// Initializes a new instance of . + /// The name of the previously defined receiver. + /// The port that will be configured externally. If not specified, it will use the port from the receiver definition. + /// Route path. + /// Route subdomain. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupNetworkingRoute(string receiver, int? port, string path, string subdomain, IDictionary serializedAdditionalRawData) + { + Receiver = receiver; + Port = port; + Path = path; + Subdomain = subdomain; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupNetworkingRoute() + { + } + + /// The name of the previously defined receiver. + public string Receiver { get; set; } + /// The port that will be configured externally. If not specified, it will use the port from the receiver definition. + public int? Port { get; set; } + /// Route path. + public string Path { get; set; } + /// Route subdomain. + public string Subdomain { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.Serialization.cs new file mode 100644 index 0000000000000..8e87bc361cbb3 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.Serialization.cs @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupPatch)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Replicas)) + { + writer.WritePropertyName("replicas"u8); + writer.WriteNumberValue(Replicas.Value); + } + if (Optional.IsCollectionDefined(Receivers)) + { + writer.WritePropertyName("receivers"u8); + writer.WriteStartArray(); + foreach (var item in Receivers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Processors)) + { + writer.WritePropertyName("processors"u8); + writer.WriteStartArray(); + foreach (var item in Processors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Exporters)) + { + writer.WritePropertyName("exporters"u8); + writer.WriteStartArray(); + foreach (var item in Exporters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Service)) + { + writer.WritePropertyName("service"u8); + writer.WriteObjectValue(Service, options); + } + if (Optional.IsCollectionDefined(NetworkingConfigurations)) + { + writer.WritePropertyName("networkingConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in NetworkingConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupPatch 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(PipelineGroupPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupPatch(document.RootElement, options); + } + + internal static PipelineGroupPatch DeserializePipelineGroupPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + int? replicas = default; + IList receivers = default; + IList processors = default; + IList exporters = default; + PipelineGroupService service = default; + IList networkingConfigurations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("replicas"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + replicas = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("receivers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupReceiver.DeserializePipelineGroupReceiver(item, options)); + } + receivers = array; + continue; + } + if (property0.NameEquals("processors"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupProcessor.DeserializePipelineGroupProcessor(item, options)); + } + processors = array; + continue; + } + if (property0.NameEquals("exporters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupExporter.DeserializePipelineGroupExporter(item, options)); + } + exporters = array; + continue; + } + if (property0.NameEquals("service"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + service = PipelineGroupService.DeserializePipelineGroupService(property0.Value, options); + continue; + } + if (property0.NameEquals("networkingConfigurations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupNetworkingConfiguration.DeserializePipelineGroupNetworkingConfiguration(item, options)); + } + networkingConfigurations = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupPatch( + tags ?? new ChangeTrackingDictionary(), + replicas, + receivers ?? new ChangeTrackingList(), + processors ?? new ChangeTrackingList(), + exporters ?? new ChangeTrackingList(), + service, + networkingConfigurations ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupPatch)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.cs new file mode 100644 index 0000000000000..b275ee25a2aba --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.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; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The type used for update operations of the PipelineGroup. + public partial class PipelineGroupPatch + { + /// + /// 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 . + public PipelineGroupPatch() + { + Tags = new ChangeTrackingDictionary(); + Receivers = new ChangeTrackingList(); + Processors = new ChangeTrackingList(); + Exporters = new ChangeTrackingList(); + NetworkingConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Defines the amount of replicas of the pipeline group instance. + /// The receivers specified for a pipeline group instance. + /// The processors specified for a pipeline group instance. + /// The exporters specified for a pipeline group instance. + /// The service section for a given pipeline group instance. + /// Networking configurations for the pipeline group instance. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupPatch(IDictionary tags, int? replicas, IList receivers, IList processors, IList exporters, PipelineGroupService service, IList networkingConfigurations, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Replicas = replicas; + Receivers = receivers; + Processors = processors; + Exporters = exporters; + Service = service; + NetworkingConfigurations = networkingConfigurations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// Defines the amount of replicas of the pipeline group instance. + public int? Replicas { get; set; } + /// The receivers specified for a pipeline group instance. + public IList Receivers { get; } + /// The processors specified for a pipeline group instance. + public IList Processors { get; } + /// The exporters specified for a pipeline group instance. + public IList Exporters { get; } + /// The service section for a given pipeline group instance. + public PipelineGroupService Service { get; set; } + /// Networking configurations for the pipeline group instance. + public IList NetworkingConfigurations { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessor.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessor.Serialization.cs new file mode 100644 index 0000000000000..35629309ab78a --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessor.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupProcessor : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupProcessor)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ProcessorType.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Batch)) + { + writer.WritePropertyName("batch"u8); + writer.WriteObjectValue(Batch, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupProcessor 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(PipelineGroupProcessor)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupProcessor(document.RootElement, options); + } + + internal static PipelineGroupProcessor DeserializePipelineGroupProcessor(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PipelineGroupProcessorType type = default; + string name = default; + BatchProcessor batch = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new PipelineGroupProcessorType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("batch"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batch = BatchProcessor.DeserializeBatchProcessor(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupProcessor(type, name, batch, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupProcessor)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupProcessor IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupProcessor(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupProcessor)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessor.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessor.cs new file mode 100644 index 0000000000000..b4d5b517924c8 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessor.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Processor Info. + public partial class PipelineGroupProcessor + { + /// + /// 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 type of processor. + /// The name of processor. + /// is null. + public PipelineGroupProcessor(PipelineGroupProcessorType processorType, string name) + { + Argument.AssertNotNull(name, nameof(name)); + + ProcessorType = processorType; + Name = name; + } + + /// Initializes a new instance of . + /// The type of processor. + /// The name of processor. + /// Batch processor configurations. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupProcessor(PipelineGroupProcessorType processorType, string name, BatchProcessor batch, IDictionary serializedAdditionalRawData) + { + ProcessorType = processorType; + Name = name; + Batch = batch; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupProcessor() + { + } + + /// The type of processor. + public PipelineGroupProcessorType ProcessorType { get; set; } + /// The name of processor. + public string Name { get; set; } + /// Batch processor configurations. + public BatchProcessor Batch { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessorType.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessorType.cs new file mode 100644 index 0000000000000..c6d676cb5e200 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessorType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The processor type. + public readonly partial struct PipelineGroupProcessorType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PipelineGroupProcessorType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BatchValue = "Batch"; + + /// Batch processor. + public static PipelineGroupProcessorType Batch { get; } = new PipelineGroupProcessorType(BatchValue); + /// Determines if two values are the same. + public static bool operator ==(PipelineGroupProcessorType left, PipelineGroupProcessorType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PipelineGroupProcessorType left, PipelineGroupProcessorType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PipelineGroupProcessorType(string value) => new PipelineGroupProcessorType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PipelineGroupProcessorType other && Equals(other); + /// + public bool Equals(PipelineGroupProcessorType 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/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.Serialization.cs new file mode 100644 index 0000000000000..9ffe893a9635f --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupReceiver : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupReceiver)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ReceiverType.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Syslog)) + { + writer.WritePropertyName("syslog"u8); + writer.WriteObjectValue(Syslog, options); + } + if (Optional.IsDefined(Otlp)) + { + writer.WritePropertyName("otlp"u8); + writer.WriteObjectValue(Otlp, options); + } + if (Optional.IsDefined(Udp)) + { + writer.WritePropertyName("udp"u8); + writer.WriteObjectValue(Udp, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupReceiver 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(PipelineGroupReceiver)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupReceiver(document.RootElement, options); + } + + internal static PipelineGroupReceiver DeserializePipelineGroupReceiver(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PipelineGroupReceiverType type = default; + string name = default; + SyslogReceiver syslog = default; + OtlpReceiver otlp = default; + UdpReceiver udp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new PipelineGroupReceiverType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("syslog"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + syslog = SyslogReceiver.DeserializeSyslogReceiver(property.Value, options); + continue; + } + if (property.NameEquals("otlp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + otlp = OtlpReceiver.DeserializeOtlpReceiver(property.Value, options); + continue; + } + if (property.NameEquals("udp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + udp = UdpReceiver.DeserializeUdpReceiver(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupReceiver( + type, + name, + syslog, + otlp, + udp, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupReceiver)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupReceiver IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupReceiver(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupReceiver)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.cs new file mode 100644 index 0000000000000..5133fce1a71c2 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Receiver Info. + public partial class PipelineGroupReceiver + { + /// + /// 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 type of receiver. + /// The name of receiver. + /// is null. + public PipelineGroupReceiver(PipelineGroupReceiverType receiverType, string name) + { + Argument.AssertNotNull(name, nameof(name)); + + ReceiverType = receiverType; + Name = name; + } + + /// Initializes a new instance of . + /// The type of receiver. + /// The name of receiver. + /// Syslog configurations. This field is mandatory for syslog type receivers. + /// OTLP receiver configurations. This field is mandatory for OTLP and pipelineGroup receivers. + /// UDP receiver configurations. This field is mandatory for UDP receivers. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupReceiver(PipelineGroupReceiverType receiverType, string name, SyslogReceiver syslog, OtlpReceiver otlp, UdpReceiver udp, IDictionary serializedAdditionalRawData) + { + ReceiverType = receiverType; + Name = name; + Syslog = syslog; + Otlp = otlp; + Udp = udp; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupReceiver() + { + } + + /// The type of receiver. + public PipelineGroupReceiverType ReceiverType { get; set; } + /// The name of receiver. + public string Name { get; set; } + /// Syslog configurations. This field is mandatory for syslog type receivers. + public SyslogReceiver Syslog { get; set; } + /// OTLP receiver configurations. This field is mandatory for OTLP and pipelineGroup receivers. + internal OtlpReceiver Otlp { get; set; } + /// OTLP GRPC endpoint definition. Example: 0.0.0.0:<port>. + public string OtlpEndpoint + { + get => Otlp is null ? default : Otlp.Endpoint; + set => Otlp = new OtlpReceiver(value); + } + + /// UDP receiver configurations. This field is mandatory for UDP receivers. + public UdpReceiver Udp { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiverType.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiverType.cs new file mode 100644 index 0000000000000..2eb569845bbfb --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiverType.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 Azure.ResourceManager.Monitor.Models +{ + /// The receiver type. + public readonly partial struct PipelineGroupReceiverType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PipelineGroupReceiverType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SyslogValue = "Syslog"; + private const string AmaValue = "Ama"; + private const string PipelineGroupValue = "PipelineGroup"; + private const string OtlpValue = "OTLP"; + private const string UdpValue = "UDP"; + + /// Linux syslog. + public static PipelineGroupReceiverType Syslog { get; } = new PipelineGroupReceiverType(SyslogValue); + /// Receives data from azure monitor agent receiver. + public static PipelineGroupReceiverType Ama { get; } = new PipelineGroupReceiverType(AmaValue); + /// Receives data from another pipeline group. + public static PipelineGroupReceiverType PipelineGroup { get; } = new PipelineGroupReceiverType(PipelineGroupValue); + /// Receives data from a OTLP collector. + public static PipelineGroupReceiverType Otlp { get; } = new PipelineGroupReceiverType(OtlpValue); + /// Receives data from an UDP collector. + public static PipelineGroupReceiverType Udp { get; } = new PipelineGroupReceiverType(UdpValue); + /// Determines if two values are the same. + public static bool operator ==(PipelineGroupReceiverType left, PipelineGroupReceiverType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PipelineGroupReceiverType left, PipelineGroupReceiverType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PipelineGroupReceiverType(string value) => new PipelineGroupReceiverType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PipelineGroupReceiverType other && Equals(other); + /// + public bool Equals(PipelineGroupReceiverType 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/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.Serialization.cs new file mode 100644 index 0000000000000..3111989661acc --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupService : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupService)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("pipelines"u8); + writer.WriteStartArray(); + foreach (var item in Pipelines) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Persistence)) + { + writer.WritePropertyName("persistence"u8); + writer.WriteObjectValue(Persistence, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupService 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(PipelineGroupService)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupService(document.RootElement, options); + } + + internal static PipelineGroupService DeserializePipelineGroupService(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList pipelines = default; + PipelineGroupServicePersistenceConfigurations persistence = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("pipelines"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PipelineGroupServicePipeline.DeserializePipelineGroupServicePipeline(item, options)); + } + pipelines = array; + continue; + } + if (property.NameEquals("persistence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + persistence = PipelineGroupServicePersistenceConfigurations.DeserializePipelineGroupServicePersistenceConfigurations(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupService(pipelines, persistence, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupService)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupService IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupService(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupService)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.cs new file mode 100644 index 0000000000000..1f4f8eb1b2494 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Service Info. + public partial class PipelineGroupService + { + /// + /// 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 . + /// Pipelines belonging to a given pipeline group. + /// is null. + public PipelineGroupService(IEnumerable pipelines) + { + Argument.AssertNotNull(pipelines, nameof(pipelines)); + + Pipelines = pipelines.ToList(); + } + + /// Initializes a new instance of . + /// Pipelines belonging to a given pipeline group. + /// Persistence options to all pipelines in the instance. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupService(IList pipelines, PipelineGroupServicePersistenceConfigurations persistence, IDictionary serializedAdditionalRawData) + { + Pipelines = pipelines; + Persistence = persistence; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupService() + { + } + + /// Pipelines belonging to a given pipeline group. + public IList Pipelines { get; } + /// Persistence options to all pipelines in the instance. + internal PipelineGroupServicePersistenceConfigurations Persistence { get; set; } + /// The name of the mounted persistent volume. + public string PersistencePersistentVolumeName + { + get => Persistence is null ? default : Persistence.PersistentVolumeName; + set => Persistence = new PipelineGroupServicePersistenceConfigurations(value); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePersistenceConfigurations.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePersistenceConfigurations.Serialization.cs new file mode 100644 index 0000000000000..dd5f67c1cd101 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePersistenceConfigurations.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + internal partial class PipelineGroupServicePersistenceConfigurations : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupServicePersistenceConfigurations)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("persistentVolumeName"u8); + writer.WriteStringValue(PersistentVolumeName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupServicePersistenceConfigurations 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(PipelineGroupServicePersistenceConfigurations)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupServicePersistenceConfigurations(document.RootElement, options); + } + + internal static PipelineGroupServicePersistenceConfigurations DeserializePipelineGroupServicePersistenceConfigurations(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string persistentVolumeName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("persistentVolumeName"u8)) + { + persistentVolumeName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupServicePersistenceConfigurations(persistentVolumeName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupServicePersistenceConfigurations)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupServicePersistenceConfigurations IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupServicePersistenceConfigurations(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupServicePersistenceConfigurations)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePersistenceConfigurations.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePersistenceConfigurations.cs new file mode 100644 index 0000000000000..30dcacfc8accd --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePersistenceConfigurations.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; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Persistence options to all pipelines in the instance. + internal partial class PipelineGroupServicePersistenceConfigurations + { + /// + /// 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 mounted persistent volume. + /// is null. + public PipelineGroupServicePersistenceConfigurations(string persistentVolumeName) + { + Argument.AssertNotNull(persistentVolumeName, nameof(persistentVolumeName)); + + PersistentVolumeName = persistentVolumeName; + } + + /// Initializes a new instance of . + /// The name of the mounted persistent volume. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupServicePersistenceConfigurations(string persistentVolumeName, IDictionary serializedAdditionalRawData) + { + PersistentVolumeName = persistentVolumeName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupServicePersistenceConfigurations() + { + } + + /// The name of the mounted persistent volume. + public string PersistentVolumeName { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.Serialization.cs new file mode 100644 index 0000000000000..ddf3ed28f0cef --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.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.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupServicePipeline : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupServicePipeline)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(PipelineType.ToString()); + writer.WritePropertyName("receivers"u8); + writer.WriteStartArray(); + foreach (var item in Receivers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsCollectionDefined(Processors)) + { + writer.WritePropertyName("processors"u8); + writer.WriteStartArray(); + foreach (var item in Processors) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("exporters"u8); + writer.WriteStartArray(); + foreach (var item in Exporters) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupServicePipeline 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(PipelineGroupServicePipeline)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupServicePipeline(document.RootElement, options); + } + + internal static PipelineGroupServicePipeline DeserializePipelineGroupServicePipeline(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + PipelineGroupServicePipelineType type = default; + IList receivers = default; + IList processors = default; + IList exporters = 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 = new PipelineGroupServicePipelineType(property.Value.GetString()); + continue; + } + if (property.NameEquals("receivers"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + receivers = array; + continue; + } + if (property.NameEquals("processors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + processors = array; + continue; + } + if (property.NameEquals("exporters"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + exporters = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupServicePipeline( + name, + type, + receivers, + processors ?? new ChangeTrackingList(), + exporters, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupServicePipeline)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupServicePipeline IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupServicePipeline(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupServicePipeline)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.cs new file mode 100644 index 0000000000000..cc91c70019484 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Pipeline Info. + public partial class PipelineGroupServicePipeline + { + /// + /// 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 . + /// Name of the pipeline. + /// The type of pipeline. + /// Reference to receivers configured for the pipeline. + /// Reference to exporters configured for the pipeline. + /// , or is null. + public PipelineGroupServicePipeline(string name, PipelineGroupServicePipelineType pipelineType, IEnumerable receivers, IEnumerable exporters) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(receivers, nameof(receivers)); + Argument.AssertNotNull(exporters, nameof(exporters)); + + Name = name; + PipelineType = pipelineType; + Receivers = receivers.ToList(); + Processors = new ChangeTrackingList(); + Exporters = exporters.ToList(); + } + + /// Initializes a new instance of . + /// Name of the pipeline. + /// The type of pipeline. + /// Reference to receivers configured for the pipeline. + /// Reference to processors configured for the pipeline. + /// Reference to exporters configured for the pipeline. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupServicePipeline(string name, PipelineGroupServicePipelineType pipelineType, IList receivers, IList processors, IList exporters, IDictionary serializedAdditionalRawData) + { + Name = name; + PipelineType = pipelineType; + Receivers = receivers; + Processors = processors; + Exporters = exporters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupServicePipeline() + { + } + + /// Name of the pipeline. + public string Name { get; set; } + /// The type of pipeline. + public PipelineGroupServicePipelineType PipelineType { get; set; } + /// Reference to receivers configured for the pipeline. + public IList Receivers { get; } + /// Reference to processors configured for the pipeline. + public IList Processors { get; } + /// Reference to exporters configured for the pipeline. + public IList Exporters { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipelineType.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipelineType.cs new file mode 100644 index 0000000000000..e1e2db11c8833 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipelineType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The pipeline type. + public readonly partial struct PipelineGroupServicePipelineType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PipelineGroupServicePipelineType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LogsValue = "logs"; + + /// Pipeline for logs telemetry. + public static PipelineGroupServicePipelineType Logs { get; } = new PipelineGroupServicePipelineType(LogsValue); + /// Determines if two values are the same. + public static bool operator ==(PipelineGroupServicePipelineType left, PipelineGroupServicePipelineType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PipelineGroupServicePipelineType left, PipelineGroupServicePipelineType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PipelineGroupServicePipelineType(string value) => new PipelineGroupServicePipelineType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PipelineGroupServicePipelineType other && Equals(other); + /// + public bool Equals(PipelineGroupServicePipelineType 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/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/StreamEncodingType.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/StreamEncodingType.cs new file mode 100644 index 0000000000000..8df0a11e46eb4 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/StreamEncodingType.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 Azure.ResourceManager.Monitor.Models +{ + /// The encoding of the stream being received. + public readonly partial struct StreamEncodingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StreamEncodingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NopValue = "nop"; + private const string Utf8Value = "utf-8"; + private const string Utf16LeValue = "utf-16le"; + private const string Utf16BeValue = "utf-16be"; + private const string AsciiValue = "ascii"; + private const string Big5Value = "big5"; + + /// No encoding validation. Treats the file as a stream of raw bytes. + public static StreamEncodingType Nop { get; } = new StreamEncodingType(NopValue); + /// UTF-8 encoding. + public static StreamEncodingType Utf8 { get; } = new StreamEncodingType(Utf8Value); + /// UTF-16 encoding with little-endian byte order. + public static StreamEncodingType Utf16Le { get; } = new StreamEncodingType(Utf16LeValue); + /// UTF-16 encoding with little-endian byte order. + public static StreamEncodingType Utf16Be { get; } = new StreamEncodingType(Utf16BeValue); + /// ASCII encoding. + public static StreamEncodingType Ascii { get; } = new StreamEncodingType(AsciiValue); + /// The Big5 Chinese character encoding. + public static StreamEncodingType Big5 { get; } = new StreamEncodingType(Big5Value); + /// Determines if two values are the same. + public static bool operator ==(StreamEncodingType left, StreamEncodingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StreamEncodingType left, StreamEncodingType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator StreamEncodingType(string value) => new StreamEncodingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StreamEncodingType other && Equals(other); + /// + public bool Equals(StreamEncodingType 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/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogProtocol.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogProtocol.cs new file mode 100644 index 0000000000000..f156f71c9c83e --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogProtocol.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Protocol to parse syslog messages. Default rfc3164. + public readonly partial struct SyslogProtocol : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SyslogProtocol(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Rfc3164Value = "rfc3164"; + private const string Rfc5424Value = "rfc5424"; + + /// rfc3164 protocol. + public static SyslogProtocol Rfc3164 { get; } = new SyslogProtocol(Rfc3164Value); + /// rfc5424 protocol. + public static SyslogProtocol Rfc5424 { get; } = new SyslogProtocol(Rfc5424Value); + /// Determines if two values are the same. + public static bool operator ==(SyslogProtocol left, SyslogProtocol right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SyslogProtocol left, SyslogProtocol right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SyslogProtocol(string value) => new SyslogProtocol(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SyslogProtocol other && Equals(other); + /// + public bool Equals(SyslogProtocol 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/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogReceiver.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogReceiver.Serialization.cs new file mode 100644 index 0000000000000..7a323caaac9b1 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogReceiver.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class SyslogReceiver : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SyslogReceiver)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint); + if (Optional.IsDefined(Protocol)) + { + writer.WritePropertyName("protocol"u8); + writer.WriteStringValue(Protocol.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SyslogReceiver 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(SyslogReceiver)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSyslogReceiver(document.RootElement, options); + } + + internal static SyslogReceiver DeserializeSyslogReceiver(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string endpoint = default; + SyslogProtocol? protocol = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpoint"u8)) + { + endpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("protocol"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protocol = new SyslogProtocol(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SyslogReceiver(endpoint, protocol, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SyslogReceiver)} does not support writing '{options.Format}' format."); + } + } + + SyslogReceiver IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSyslogReceiver(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SyslogReceiver)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogReceiver.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogReceiver.cs new file mode 100644 index 0000000000000..25ae7aba7f9d8 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogReceiver.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Base receiver using TCP as transport protocol. + public partial class SyslogReceiver + { + /// + /// 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 . + /// Syslog receiver endpoint definition. Example: 0.0.0.0:<port>. + /// is null. + public SyslogReceiver(string endpoint) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + + Endpoint = endpoint; + } + + /// Initializes a new instance of . + /// Syslog receiver endpoint definition. Example: 0.0.0.0:<port>. + /// Protocol to parse syslog messages. Default rfc3164. + /// Keeps track of any properties unknown to the library. + internal SyslogReceiver(string endpoint, SyslogProtocol? protocol, IDictionary serializedAdditionalRawData) + { + Endpoint = endpoint; + Protocol = protocol; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SyslogReceiver() + { + } + + /// Syslog receiver endpoint definition. Example: 0.0.0.0:<port>. + public string Endpoint { get; set; } + /// Protocol to parse syslog messages. Default rfc3164. + public SyslogProtocol? Protocol { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.Serialization.cs new file mode 100644 index 0000000000000..086526f2d749d --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + internal partial class TcpExporter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TcpExporter)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TcpExporter 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(TcpExporter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTcpExporter(document.RootElement, options); + } + + internal static TcpExporter DeserializeTcpExporter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri url = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TcpExporter(url, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TcpExporter)} does not support writing '{options.Format}' format."); + } + } + + TcpExporter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTcpExporter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TcpExporter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.cs new file mode 100644 index 0000000000000..f1ee8992cfd28 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.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; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Base exporter using TCP as transport protocol. + internal partial class TcpExporter + { + /// + /// 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 . + /// TCP url to export. + /// is null. + public TcpExporter(Uri uri) + { + Argument.AssertNotNull(uri, nameof(uri)); + + Uri = uri; + } + + /// Initializes a new instance of . + /// TCP url to export. + /// Keeps track of any properties unknown to the library. + internal TcpExporter(Uri uri, IDictionary serializedAdditionalRawData) + { + Uri = uri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TcpExporter() + { + } + + /// TCP url to export. + public Uri Uri { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.Serialization.cs new file mode 100644 index 0000000000000..24c8862f83372 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class UdpReceiver : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UdpReceiver)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint); + if (Optional.IsDefined(Encoding)) + { + writer.WritePropertyName("encoding"u8); + writer.WriteStringValue(Encoding.Value.ToString()); + } + if (Optional.IsDefined(ReadQueueLength)) + { + writer.WritePropertyName("readQueueLength"u8); + writer.WriteNumberValue(ReadQueueLength.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + UdpReceiver 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(UdpReceiver)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUdpReceiver(document.RootElement, options); + } + + internal static UdpReceiver DeserializeUdpReceiver(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string endpoint = default; + StreamEncodingType? encoding = default; + int? readQueueLength = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpoint"u8)) + { + endpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("encoding"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encoding = new StreamEncodingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("readQueueLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + readQueueLength = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UdpReceiver(endpoint, encoding, readQueueLength, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UdpReceiver)} does not support writing '{options.Format}' format."); + } + } + + UdpReceiver IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUdpReceiver(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UdpReceiver)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.cs new file mode 100644 index 0000000000000..91500e6e13318 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.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; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Receiver using UDP as transport protocol. + public partial class UdpReceiver + { + /// + /// 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 . + /// TCP endpoint definition. Example: 0.0.0.0:<port>. + /// is null. + public UdpReceiver(string endpoint) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + + Endpoint = endpoint; + } + + /// Initializes a new instance of . + /// TCP endpoint definition. Example: 0.0.0.0:<port>. + /// The encoding of the stream being received. + /// Max read queue length. + /// Keeps track of any properties unknown to the library. + internal UdpReceiver(string endpoint, StreamEncodingType? encoding, int? readQueueLength, IDictionary serializedAdditionalRawData) + { + Endpoint = endpoint; + Encoding = encoding; + ReadQueueLength = readQueueLength; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UdpReceiver() + { + } + + /// TCP endpoint definition. Example: 0.0.0.0:<port>. + public string Endpoint { get; set; } + /// The encoding of the stream being received. + public StreamEncodingType? Encoding { get; set; } + /// Max read queue length. + public int? ReadQueueLength { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResource.cs index 673f0e8371e42..b17244812a075 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResource.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// - /// The payload. + /// The resource properties to be updated. /// The cancellation token to use. /// is null. public virtual async Task> UpdateAsync(MonitorWorkspaceResourcePatch patch, CancellationToken cancellationToken = default) @@ -309,7 +309,7 @@ public virtual async Task> UpdateAsync(Monito /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> UpdateAsync(Monito /// /// /// - /// The payload. + /// The resource properties to be updated. /// The cancellation token to use. /// is null. public virtual Response Update(MonitorWorkspaceResourcePatch patch, CancellationToken cancellationToken = default) @@ -351,7 +351,7 @@ public virtual Response Update(MonitorWorkspaceResourc /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -413,7 +413,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -475,7 +475,7 @@ public virtual Response AddTag(string key, string valu /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -532,7 +532,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -589,7 +589,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -649,7 +649,7 @@ public virtual async Task> RemoveTagAsync(str /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceCollection.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceCollection.cs index 33f8d4e860f4c..1395ba889a3d5 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceCollection.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceCollection.cs @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// AzureMonitorWorkspaces_Create + /// AzureMonitorWorkspaces_CreateOrUpdate /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -74,8 +74,8 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// 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 name of the Azure Monitor workspace. The name is case insensitive. - /// Properties that need to be specified to create a new workspace. + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// Resource create parameters. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. @@ -88,10 +88,8 @@ public virtual async Task> CreateOrUpdate scope.Start(); try { - var response = await _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data, cancellationToken).ConfigureAwait(false); - var uri = _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new MonitorArmOperation(Response.FromValue(new MonitorWorkspaceResource(Client, response), response.GetRawResponse()), rehydrationToken); + var response = await _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data, cancellationToken).ConfigureAwait(false); + var operation = new MonitorArmOperation(new MonitorWorkspaceResourceOperationSource(Client), _monitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics, Pipeline, _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -112,11 +110,11 @@ public virtual async Task> CreateOrUpdate ///
/// /// Operation Id - /// AzureMonitorWorkspaces_Create + /// AzureMonitorWorkspaces_CreateOrUpdate /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -125,8 +123,8 @@ public virtual async Task> CreateOrUpdate /// /// /// 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 name of the Azure Monitor workspace. The name is case insensitive. - /// Properties that need to be specified to create a new workspace. + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// Resource create parameters. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. @@ -139,10 +137,8 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w scope.Start(); try { - var response = _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data, cancellationToken); - var uri = _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new MonitorArmOperation(Response.FromValue(new MonitorWorkspaceResource(Client, response), response.GetRawResponse()), rehydrationToken); + var response = _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data, cancellationToken); + var operation = new MonitorArmOperation(new MonitorWorkspaceResourceOperationSource(Client), _monitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics, Pipeline, _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -167,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -175,7 +171,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -212,7 +208,7 @@ public virtual async Task> GetAsync(string az ///
/// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -220,7 +216,7 @@ public virtual async Task> GetAsync(string az /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -257,7 +253,7 @@ public virtual Response Get(string azureMonitorWorkspa ///
/// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -287,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -317,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -325,7 +321,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -360,7 +356,7 @@ public virtual async Task> ExistsAsync(string azureMonitorWorkspa ///
/// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -368,7 +364,7 @@ public virtual async Task> ExistsAsync(string azureMonitorWorkspa /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -403,7 +399,7 @@ public virtual Response Exists(string azureMonitorWorkspaceName, Cancellat ///
/// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -411,7 +407,7 @@ public virtual Response Exists(string azureMonitorWorkspaceName, Cancellat /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -448,7 +444,7 @@ public virtual async Task> GetIfExist ///
/// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -456,7 +452,7 @@ public virtual async Task> GetIfExist /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.Serialization.cs index 985eddc1fda55..69b603e58cb35 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.Serialization.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.Serialization.cs @@ -33,6 +33,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(DefaultIngestionSettings)) + { + writer.WritePropertyName("defaultIngestionSettings"u8); + writer.WriteObjectValue(DefaultIngestionSettings, options); + } + if (options.Format != "W" && Optional.IsDefined(Metrics)) + { + writer.WritePropertyName("metrics"u8); + writer.WriteObjectValue(Metrics, options); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -73,20 +83,20 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("accountId"u8); writer.WriteStringValue(AccountId); } - if (options.Format != "W" && Optional.IsDefined(Metrics)) + if (Optional.IsDefined(MetricsPropertiesMetrics)) { writer.WritePropertyName("metrics"u8); - writer.WriteObjectValue(Metrics, options); + writer.WriteObjectValue(MetricsPropertiesMetrics, options); } if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(DefaultIngestionSettings)) + if (options.Format != "W" && Optional.IsDefined(DefaultIngestionSettingsPropertiesDefaultIngestionSettings)) { writer.WritePropertyName("defaultIngestionSettings"u8); - writer.WriteObjectValue(DefaultIngestionSettings, options); + writer.WriteObjectValue(DefaultIngestionSettingsPropertiesDefaultIngestionSettings, options); } if (options.Format != "W" && Optional.IsCollectionDefined(PrivateEndpointConnections)) { @@ -143,6 +153,8 @@ internal static MonitorWorkspaceResourceData DeserializeMonitorWorkspaceResource return null; } ETag? etag = default; + MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings = default; + MonitorWorkspaceMetrics metrics = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -150,9 +162,9 @@ internal static MonitorWorkspaceResourceData DeserializeMonitorWorkspaceResource ResourceType type = default; SystemData systemData = default; string accountId = default; - MonitorWorkspaceMetrics metrics = default; + MonitorWorkspaceMetricProperties metrics0 = default; MonitorProvisioningState? provisioningState = default; - MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings = default; + MonitorWorkspaceIngestionSettings defaultIngestionSettings0 = default; IReadOnlyList privateEndpointConnections = default; MonitorWorkspacePublicNetworkAccess? publicNetworkAccess = default; IDictionary serializedAdditionalRawData = default; @@ -168,6 +180,24 @@ internal static MonitorWorkspaceResourceData DeserializeMonitorWorkspaceResource etag = new ETag(property.Value.GetString()); continue; } + if (property.NameEquals("defaultIngestionSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultIngestionSettings = MonitorWorkspaceDefaultIngestionSettings.DeserializeMonitorWorkspaceDefaultIngestionSettings(property.Value, options); + continue; + } + if (property.NameEquals("metrics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metrics = MonitorWorkspaceMetrics.DeserializeMonitorWorkspaceMetrics(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +261,7 @@ internal static MonitorWorkspaceResourceData DeserializeMonitorWorkspaceResource { continue; } - metrics = MonitorWorkspaceMetrics.DeserializeMonitorWorkspaceMetrics(property0.Value, options); + metrics0 = MonitorWorkspaceMetricProperties.DeserializeMonitorWorkspaceMetricProperties(property0.Value, options); continue; } if (property0.NameEquals("provisioningState"u8)) @@ -249,7 +279,7 @@ internal static MonitorWorkspaceResourceData DeserializeMonitorWorkspaceResource { continue; } - defaultIngestionSettings = MonitorWorkspaceDefaultIngestionSettings.DeserializeMonitorWorkspaceDefaultIngestionSettings(property0.Value, options); + defaultIngestionSettings0 = MonitorWorkspaceIngestionSettings.DeserializeMonitorWorkspaceIngestionSettings(property0.Value, options); continue; } if (property0.NameEquals("privateEndpointConnections"u8)) @@ -292,10 +322,12 @@ internal static MonitorWorkspaceResourceData DeserializeMonitorWorkspaceResource tags ?? new ChangeTrackingDictionary(), location, etag, - accountId, + defaultIngestionSettings, metrics, + accountId, + metrics0, provisioningState, - defaultIngestionSettings, + defaultIngestionSettings0, privateEndpointConnections ?? new ChangeTrackingList(), publicNetworkAccess, serializedAdditionalRawData); diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.cs index d2a7a7dc5a5ce..596c7878d6466 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.Monitor { /// /// A class representing the MonitorWorkspaceResource data model. - /// An Azure Monitor Workspace definition + /// An Azure Monitor Workspace definition. /// public partial class MonitorWorkspaceResourceData : TrackedResourceData { @@ -66,20 +66,24 @@ public MonitorWorkspaceResourceData(AzureLocation location) : base(location) /// The tags. /// The location. /// Resource entity tag (ETag). + /// The Data Collection Rule and Endpoint used for ingestion by default. + /// Properties related to the metrics container in the Azure Monitor Workspace. /// The immutable ID of the Azure Monitor workspace. This property is read-only. - /// Information about metrics for the Azure Monitor workspace. + /// Information about metrics for the Azure Monitor workspace. /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. - /// The Data Collection Rule and Endpoint used for ingestion by default. + /// The Data Collection Rule and Endpoint used for ingestion by default. /// List of private endpoint connections. /// Gets or sets allow or disallow public network access to workspace. /// Keeps track of any properties unknown to the library. - internal MonitorWorkspaceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, string accountId, MonitorWorkspaceMetrics metrics, MonitorProvisioningState? provisioningState, MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings, IReadOnlyList privateEndpointConnections, MonitorWorkspacePublicNetworkAccess? publicNetworkAccess, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MonitorWorkspaceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings, MonitorWorkspaceMetrics metrics, string accountId, MonitorWorkspaceMetricProperties metricsPropertiesMetrics, MonitorProvisioningState? provisioningState, MonitorWorkspaceIngestionSettings defaultIngestionSettingsPropertiesDefaultIngestionSettings, IReadOnlyList privateEndpointConnections, MonitorWorkspacePublicNetworkAccess? publicNetworkAccess, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { ETag = etag; - AccountId = accountId; + DefaultIngestionSettings = defaultIngestionSettings; Metrics = metrics; + AccountId = accountId; + MetricsPropertiesMetrics = metricsPropertiesMetrics; ProvisioningState = provisioningState; - DefaultIngestionSettings = defaultIngestionSettings; + DefaultIngestionSettingsPropertiesDefaultIngestionSettings = defaultIngestionSettingsPropertiesDefaultIngestionSettings; PrivateEndpointConnections = privateEndpointConnections; PublicNetworkAccess = publicNetworkAccess; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -92,14 +96,18 @@ internal MonitorWorkspaceResourceData() /// Resource entity tag (ETag). public ETag? ETag { get; } + /// The Data Collection Rule and Endpoint used for ingestion by default. + public MonitorWorkspaceDefaultIngestionSettings DefaultIngestionSettings { get; } + /// Properties related to the metrics container in the Azure Monitor Workspace. + public MonitorWorkspaceMetrics Metrics { get; } /// The immutable ID of the Azure Monitor workspace. This property is read-only. public string AccountId { get; } /// Information about metrics for the Azure Monitor workspace. - public MonitorWorkspaceMetrics Metrics { get; } + public MonitorWorkspaceMetricProperties MetricsPropertiesMetrics { get; set; } /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. public MonitorProvisioningState? ProvisioningState { get; } /// The Data Collection Rule and Endpoint used for ingestion by default. - public MonitorWorkspaceDefaultIngestionSettings DefaultIngestionSettings { get; } + public MonitorWorkspaceIngestionSettings DefaultIngestionSettingsPropertiesDefaultIngestionSettings { get; } /// List of private endpoint connections. public IReadOnlyList PrivateEndpointConnections { get; } /// Gets or sets allow or disallow public network access to workspace. diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupCollection.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupCollection.cs new file mode 100644 index 0000000000000..6050b377cb5e8 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupCollection.cs @@ -0,0 +1,494 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Monitor +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetPipelineGroups method from an instance of . + /// + public partial class PipelineGroupCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _pipelineGroupClientDiagnostics; + private readonly PipelineGroupsRestOperations _pipelineGroupRestClient; + + /// Initializes a new instance of the class for mocking. + protected PipelineGroupCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal PipelineGroupCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _pipelineGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Monitor", PipelineGroupResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(PipelineGroupResource.ResourceType, out string pipelineGroupApiVersion); + _pipelineGroupRestClient = new PipelineGroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, pipelineGroupApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create or update a pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of pipeline group. The name is case insensitive. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string pipelineGroupName, PipelineGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, data, cancellationToken).ConfigureAwait(false); + var operation = new MonitorArmOperation(new PipelineGroupOperationSource(Client), _pipelineGroupClientDiagnostics, Pipeline, _pipelineGroupRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of pipeline group. The name is case insensitive. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string pipelineGroupName, PipelineGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, data, cancellationToken); + var operation = new MonitorArmOperation(new PipelineGroupOperationSource(Client), _pipelineGroupClientDiagnostics, Pipeline, _pipelineGroupRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.Get"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PipelineGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.Get"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PipelineGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all workspaces in the specified resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups + /// + /// + /// Operation Id + /// PipelineGroups_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _pipelineGroupRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _pipelineGroupRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PipelineGroupResource(Client, PipelineGroupData.DeserializePipelineGroupData(e)), _pipelineGroupClientDiagnostics, Pipeline, "PipelineGroupCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all workspaces in the specified resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups + /// + /// + /// Operation Id + /// PipelineGroups_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _pipelineGroupRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _pipelineGroupRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PipelineGroupResource(Client, PipelineGroupData.DeserializePipelineGroupData(e)), _pipelineGroupClientDiagnostics, Pipeline, "PipelineGroupCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.Exists"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.Exists"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PipelineGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.GetIfExists"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PipelineGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.Serialization.cs new file mode 100644 index 0000000000000..7007912d908f0 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.Serialization.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Monitor.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Monitor +{ + public partial class PipelineGroupData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ExtendedLocation)) + { + writer.WritePropertyName("extendedLocation"u8); + JsonSerializer.Serialize(writer, ExtendedLocation); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Replicas)) + { + writer.WritePropertyName("replicas"u8); + writer.WriteNumberValue(Replicas.Value); + } + if (Optional.IsCollectionDefined(Receivers)) + { + writer.WritePropertyName("receivers"u8); + writer.WriteStartArray(); + foreach (var item in Receivers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Processors)) + { + writer.WritePropertyName("processors"u8); + writer.WriteStartArray(); + foreach (var item in Processors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Exporters)) + { + writer.WritePropertyName("exporters"u8); + writer.WriteStartArray(); + foreach (var item in Exporters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Service)) + { + writer.WritePropertyName("service"u8); + writer.WriteObjectValue(Service, options); + } + if (Optional.IsCollectionDefined(NetworkingConfigurations)) + { + writer.WritePropertyName("networkingConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in NetworkingConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupData 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(PipelineGroupData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupData(document.RootElement, options); + } + + internal static PipelineGroupData DeserializePipelineGroupData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExtendedLocation extendedLocation = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + int? replicas = default; + IList receivers = default; + IList processors = default; + IList exporters = default; + PipelineGroupService service = default; + IList networkingConfigurations = default; + MonitorProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("extendedLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extendedLocation = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("replicas"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + replicas = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("receivers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupReceiver.DeserializePipelineGroupReceiver(item, options)); + } + receivers = array; + continue; + } + if (property0.NameEquals("processors"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupProcessor.DeserializePipelineGroupProcessor(item, options)); + } + processors = array; + continue; + } + if (property0.NameEquals("exporters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupExporter.DeserializePipelineGroupExporter(item, options)); + } + exporters = array; + continue; + } + if (property0.NameEquals("service"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + service = PipelineGroupService.DeserializePipelineGroupService(property0.Value, options); + continue; + } + if (property0.NameEquals("networkingConfigurations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupNetworkingConfiguration.DeserializePipelineGroupNetworkingConfiguration(item, options)); + } + networkingConfigurations = array; + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MonitorProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + extendedLocation, + replicas, + receivers ?? new ChangeTrackingList(), + processors ?? new ChangeTrackingList(), + exporters ?? new ChangeTrackingList(), + service, + networkingConfigurations ?? new ChangeTrackingList(), + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupData)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.cs new file mode 100644 index 0000000000000..ab4bf5a73c9b2 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Monitor.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Monitor +{ + /// + /// A class representing the PipelineGroup data model. + /// A pipeline group definition. + /// + public partial class PipelineGroupData : TrackedResourceData + { + /// + /// 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 location. + public PipelineGroupData(AzureLocation location) : base(location) + { + Receivers = new ChangeTrackingList(); + Processors = new ChangeTrackingList(); + Exporters = new ChangeTrackingList(); + NetworkingConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The extended location for given pipeline group. + /// Defines the amount of replicas of the pipeline group instance. + /// The receivers specified for a pipeline group instance. + /// The processors specified for a pipeline group instance. + /// The exporters specified for a pipeline group instance. + /// The service section for a given pipeline group instance. + /// Networking configurations for the pipeline group instance. + /// The provisioning state of a pipeline group instance. Set to Succeeded if everything is healthy. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedLocation extendedLocation, int? replicas, IList receivers, IList processors, IList exporters, PipelineGroupService service, IList networkingConfigurations, MonitorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ExtendedLocation = extendedLocation; + Replicas = replicas; + Receivers = receivers; + Processors = processors; + Exporters = exporters; + Service = service; + NetworkingConfigurations = networkingConfigurations; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupData() + { + } + + /// The extended location for given pipeline group. + public ExtendedLocation ExtendedLocation { get; set; } + /// Defines the amount of replicas of the pipeline group instance. + public int? Replicas { get; set; } + /// The receivers specified for a pipeline group instance. + public IList Receivers { get; } + /// The processors specified for a pipeline group instance. + public IList Processors { get; } + /// The exporters specified for a pipeline group instance. + public IList Exporters { get; } + /// The service section for a given pipeline group instance. + public PipelineGroupService Service { get; set; } + /// Networking configurations for the pipeline group instance. + public IList NetworkingConfigurations { get; } + /// The provisioning state of a pipeline group instance. Set to Succeeded if everything is healthy. + public MonitorProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.Serialization.cs new file mode 100644 index 0000000000000..39adfb4a8ecca --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Monitor +{ + public partial class PipelineGroupResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + PipelineGroupData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + PipelineGroupData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.cs new file mode 100644 index 0000000000000..68e159872fa51 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.cs @@ -0,0 +1,707 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Monitor.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Monitor +{ + /// + /// A Class representing a PipelineGroup along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetPipelineGroupResource method. + /// Otherwise you can get one from its parent resource using the GetPipelineGroup method. + /// + public partial class PipelineGroupResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The pipelineGroupName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string pipelineGroupName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _pipelineGroupClientDiagnostics; + private readonly PipelineGroupsRestOperations _pipelineGroupRestClient; + private readonly PipelineGroupData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Monitor/pipelineGroups"; + + /// Initializes a new instance of the class for mocking. + protected PipelineGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal PipelineGroupResource(ArmClient client, PipelineGroupData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal PipelineGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _pipelineGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Monitor", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string pipelineGroupApiVersion); + _pipelineGroupRestClient = new PipelineGroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, pipelineGroupApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual PipelineGroupData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.Get"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PipelineGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.Get"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PipelineGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Delete + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.Delete"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MonitorArmOperation(_pipelineGroupClientDiagnostics, Pipeline, _pipelineGroupRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Delete + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.Delete"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new MonitorArmOperation(_pipelineGroupClientDiagnostics, Pipeline, _pipelineGroupRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a pipeline group instance + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Update + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, PipelineGroupPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.Update"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new MonitorArmOperation(new PipelineGroupOperationSource(Client), _pipelineGroupClientDiagnostics, Pipeline, _pipelineGroupRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a pipeline group instance + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Update + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, PipelineGroupPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.Update"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new MonitorArmOperation(new PipelineGroupOperationSource(Client), _pipelineGroupClientDiagnostics, Pipeline, _pipelineGroupRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PipelineGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new PipelineGroupPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new PipelineGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new PipelineGroupPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PipelineGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new PipelineGroupPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new PipelineGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new PipelineGroupPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PipelineGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new PipelineGroupPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new PipelineGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new PipelineGroupPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/AzureMonitorWorkspacesRestOperations.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/AzureMonitorWorkspacesRestOperations.cs index a9bab10a33788..05d8a595a8ce6 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/AzureMonitorWorkspacesRestOperations.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/AzureMonitorWorkspacesRestOperations.cs @@ -32,24 +32,22 @@ public AzureMonitorWorkspacesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-04-03"; + _apiVersion = apiVersion ?? "2023-10-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Monitor/accounts", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -58,8 +56,6 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Monitor/accounts", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; @@ -68,18 +64,16 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Lists all workspaces in the specified resource group. + /// Lists all workspaces in the specified subscription. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -95,18 +89,16 @@ public async Task> ListByResourceGr } } - /// Lists all workspaces in the specified resource group. + /// Lists all workspaces in the specified subscription. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -122,18 +114,20 @@ public Response ListByResourceGroup(string s } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Monitor/accounts", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -142,6 +136,8 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Monitor/accounts", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; @@ -150,16 +146,18 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// Lists all workspaces in the specified subscription. + /// Lists all workspaces in the specified resource group. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -175,16 +173,18 @@ public async Task> ListBySubscripti } } - /// Lists all workspaces in the specified subscription. + /// Lists all workspaces in the specified resource group. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -237,7 +237,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Returns the specific Azure Monitor workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -268,7 +268,7 @@ public async Task> GetAsync(string subscr /// Returns the specific Azure Monitor workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -296,7 +296,7 @@ public Response Get(string subscriptionId, string } } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -310,7 +310,7 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -337,30 +337,25 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG /// Create or update a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. - /// Properties that need to be specified to create a new workspace. + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// Resource create parameters. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(azureMonitorWorkspaceName, nameof(azureMonitorWorkspaceName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, azureMonitorWorkspaceName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, azureMonitorWorkspaceName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 201: - { - MonitorWorkspaceResourceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -369,30 +364,25 @@ public async Task> CreateAsync(string sub /// Create or update a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. - /// Properties that need to be specified to create a new workspace. + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// Resource create parameters. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(azureMonitorWorkspaceName, nameof(azureMonitorWorkspaceName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, azureMonitorWorkspaceName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, azureMonitorWorkspaceName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: case 201: - { - MonitorWorkspaceResourceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -439,8 +429,8 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// Updates part of a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. - /// The payload. + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The resource properties to be updated. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -470,8 +460,8 @@ public async Task> UpdateAsync(string sub /// Updates part of a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. - /// The payload. + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The resource properties to be updated. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -535,7 +525,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Delete a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -560,7 +550,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Delete a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -582,7 +572,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string a } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -590,7 +580,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -604,20 +594,18 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// Lists all workspaces in the specified resource group. + /// Lists all workspaces in the specified subscription. /// The URL to the next page of results. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -633,20 +621,18 @@ public async Task> ListByResourceGr } } - /// Lists all workspaces in the specified resource group. + /// Lists all workspaces in the specified subscription. /// The URL to the next page of results. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -662,7 +648,7 @@ public Response ListByResourceGroupNextPage( } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -670,7 +656,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -684,18 +670,20 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// Lists all workspaces in the specified subscription. + /// Lists all workspaces in the specified resource group. /// The URL to the next page of results. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -711,18 +699,20 @@ public async Task> ListBySubscripti } } - /// Lists all workspaces in the specified subscription. + /// Lists all workspaces in the specified resource group. /// The URL to the next page of results. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/PipelineGroupsRestOperations.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/PipelineGroupsRestOperations.cs new file mode 100644 index 0000000000000..d43ea5b693f9c --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/PipelineGroupsRestOperations.cs @@ -0,0 +1,723 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Monitor.Models; + +namespace Azure.ResourceManager.Monitor +{ + internal partial class PipelineGroupsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PipelineGroupsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public PipelineGroupsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-10-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all workspaces in the specified subscription. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all workspaces in the specified subscription. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all workspaces in the specified resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all workspaces in the specified resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string pipelineGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string pipelineGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns the specific pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, pipelineGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PipelineGroupData.DeserializePipelineGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PipelineGroupData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns the specific pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, pipelineGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PipelineGroupData.DeserializePipelineGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PipelineGroupData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update a pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, pipelineGroupName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update a pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, pipelineGroupName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, pipelineGroupName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, pipelineGroupName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string pipelineGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string pipelineGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, pipelineGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, pipelineGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all workspaces in the specified subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all workspaces in the specified subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all workspaces in the specified resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all workspaces in the specified resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md b/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md index 01ff6fd4a383b..7f432edc62132 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md @@ -7,7 +7,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: Monitor namespace: Azure.ResourceManager.Monitor -require: https://github.com/Azure/azure-rest-api-specs/blob/2491b616cde43277fae339604f03f59412e016aa/specification/monitor/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/cf406046c304ec528a84ae1a151f3d1a647058a2/specification/monitor/resource-manager/readme.md tag: package-track2-stable output-folder: $(this-folder)/Generated clear-output-folder: true @@ -62,6 +62,7 @@ acronym-mapping: HH: Hh DD: Dd SS: Ss + UDP: Udp irregular-plural-words: status: status @@ -290,16 +291,16 @@ rename-mapping: StorageTableDestination: DataCollectionRuleStorageTableDestination ActionType: MonitorWorkspaceActionType Metrics: MonitorWorkspaceMetricProperties - AzureMonitorWorkspaceResource: MonitorWorkspaceResource - AzureMonitorWorkspaceResourceCollection: MonitorWorkspaceResourceCollection - AzureMonitorWorkspaceResourceData: MonitorWorkspaceResourceData + AzureMonitorWorkspace: MonitorWorkspaceResource + AzureMonitorWorkspaceCollection: MonitorWorkspaceResourceCollection + AzureMonitorWorkspaceData: MonitorWorkspaceResourceData IngestionSettings: MonitorWorkspaceIngestionSettings IngestionSettings.dataCollectionEndpointResourceId: -|arm-id IngestionSettings.dataCollectionRuleResourceId: -|arm-id AzureMonitorWorkspaceDefaultIngestionSettings: MonitorWorkspaceDefaultIngestionSettings AzureMonitorWorkspaceMetrics: MonitorWorkspaceMetrics - AzureMonitorWorkspaceResourcePatch: MonitorWorkspaceResourcePatch - AzureMonitorWorkspaceResourceListResult: MonitorWorkspaceResourceListResult + AzureMonitorWorkspacePatch: MonitorWorkspaceResourcePatch + AzureMonitorWorkspaceListResult: MonitorWorkspaceResourceListResult MetricDefinition: MonitorMetricDefinition AggregationType: MonitorAggregationType BaselineMetadata: MonitorBaselineMetadata @@ -314,6 +315,28 @@ rename-mapping: SingleMetricBaseline: MonitorSingleMetricBaseline TimeSeriesBaseline: MonitorTimeSeriesBaseline Unit: MonitorMetricUnit + CacheConfiguration: MonitorWorkspaceLogsExporterCacheConfiguration + ConcurrencyConfiguration: MonitorWorkspaceLogsExporterConcurrencyConfiguration + SchemaMap: MonitorWorkspaceLogsSchemaMap + RecordMap: MonitorWorkspaceLogsRecordMap + ResourceMap: MonitorWorkspaceLogsResourceMap + ScopeMap: MonitorWorkspaceLogsScopeMap + Receiver: PipelineGroupReceiver + ReceiverType: PipelineGroupReceiverType + Processor: PipelineGroupProcessor + ProcessorType: PipelineGroupProcessorType + Exporter: PipelineGroupExporter + ExporterType: PipelineGroupExporterType + Service: PipelineGroupService + Pipeline: PipelineGroupServicePipeline + PipelineType: PipelineGroupServicePipelineType + PersistenceConfigurations: PipelineGroupServicePersistenceConfigurations + NetworkingConfiguration: PipelineGroupNetworkingConfiguration + NetworkingRoute: PipelineGroupNetworkingRoute + ExternalNetworkingMode: PipelineGroupExternalNetworkingMode + AzureResourceManagerCommonTypesExtendedLocation: Azure.ResourceManager.CommonTypes.ExtendedLocation + AzureMonitorWorkspaceLogsApiConfig: MonitorWorkspaceLogsApiConfig + AzureMonitorWorkspaceLogsExporter: MonitorWorkspaceLogsExporter suppress-abstract-base-class: - MetricAlertCriteria @@ -383,6 +406,9 @@ directive: - from: v3/types.json where: $.definitions.ErrorResponse transform: $["x-ms-client-name"] = "CommonErrorResponseV3" + - from: v4/types.json + where: $.definitions.ErrorResponse + transform: $["x-ms-client-name"] = "CommonErrorResponseV4" - from: v2/types.json where: $.definitions.ErrorDetail transform: $["x-ms-client-name"] = "CommonErrorDetail" @@ -444,6 +470,33 @@ directive: "modelAsString": true } }; + - from: azuremonitor.json + where: $.definitions.AzureMonitorWorkspace.properties + transform: > + $.defaultIngestionSettings = { + "description": "The Data Collection Rule and Endpoint used for ingestion by default.", + "allOf": [ + { + "$ref": "#/definitions/IngestionSettings" + } + ], + "readOnly": true, + "x-ms-mutability": [ + "read" + ] + }; + $.metrics = { + "description": "Properties related to the metrics container in the Azure Monitor Workspace", + "allOf": [ + { + "$ref": "#/definitions/Metrics" + } + ], + "readOnly": true, + "x-ms-mutability": [ + "read" + ] + }; ``` ## Tag: package-track2-stable @@ -477,6 +530,6 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/2491b616cde43277fae339604f03f59412e016aa/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/dataCollectionEndpoints_API.json - https://github.com/Azure/azure-rest-api-specs/blob/2491b616cde43277fae339604f03f59412e016aa/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/dataCollectionRuleAssociations_API.json - https://github.com/Azure/azure-rest-api-specs/blob/2491b616cde43277fae339604f03f59412e016aa/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/dataCollectionRules_API.json -- https://github.com/Azure/azure-rest-api-specs/blob/2491b616cde43277fae339604f03f59412e016aa/specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/monitoringAccounts_API.json +- https://github.com/Azure/azure-rest-api-specs/blob/cf406046c304ec528a84ae1a151f3d1a647058a2/specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/azuremonitor.json # - https://github.com/Azure/azure-rest-api-specs/blob/2491b616cde43277fae339604f03f59412e016aa/specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/operations_API.json # we do not need to support this ``` From 11c6ade902c736dff6a51eea62bc9dfa50afda09 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 28 Aug 2024 22:30:24 -0700 Subject: [PATCH 48/71] Update AutoRest C# version to 3.0.0-beta.20240828.1 (#45707) --- eng/Packages.Data.props | 2 +- eng/emitter-package-lock.json | 16 ++++++++-------- eng/emitter-package.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 22fd978ea74da..0948455c49ee8 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -227,7 +227,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 3162de2965e79..15a305817b06b 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240827.3" + "@azure-tools/typespec-csharp": "0.2.0-beta.20240828.1" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.45.0", @@ -22,9 +22,9 @@ } }, "node_modules/@autorest/csharp": { - "version": "3.0.0-beta.20240827.3", - "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240827.3.tgz", - "integrity": "sha512-QrcQi8JNGrAZtms0soDP4lnKBIU2gZyupGlYX2/ZEdtCwNj23aYu53c2XXr7sHPz/5MXPvS2MxV6nSjwLIGjXQ==" + "version": "3.0.0-beta.20240828.1", + "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240828.1.tgz", + "integrity": "sha512-EEmlBBH9IC1PFmW2yoXPEagvTsrhodQifhF/Grdz+SigDj4L4fCM0ucdspAZf+Zxom3rJPYZMIP49uhbquvjFA==" }, "node_modules/@azure-tools/typespec-autorest": { "version": "0.45.0", @@ -117,11 +117,11 @@ } }, "node_modules/@azure-tools/typespec-csharp": { - "version": "0.2.0-beta.20240827.3", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240827.3.tgz", - "integrity": "sha512-zI3oxLO6pNoDS5n7cSmvrp9npC+iVFrv1Omm0Llj1rgRSL7gPWcs6GA1zU2+51PvyEn7+tFeDvzIKdNZMZmNUw==", + "version": "0.2.0-beta.20240828.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240828.1.tgz", + "integrity": "sha512-Op9eMX0RbXmXCkqHpfKEOc8RbGNVbLkqiCWMKTEdK3T9gF7rraSsZ4cgJz7ubVEtjeaYllLH9XzS1qHhgN7ARw==", "dependencies": { - "@autorest/csharp": "3.0.0-beta.20240827.3", + "@autorest/csharp": "3.0.0-beta.20240828.1", "@typespec/http-client-csharp": "0.1.9-alpha.20240826.1", "json-serialize-refs": "0.1.0-0" }, diff --git a/eng/emitter-package.json b/eng/emitter-package.json index b7ee0092d404b..79e858bd3623c 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,7 +1,7 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240827.3" + "@azure-tools/typespec-csharp": "0.2.0-beta.20240828.1" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.45.0", From f177602e09a6137f32a3fa2b0b7f7ab981b840f5 Mon Sep 17 00:00:00 2001 From: Amit Chauhan <70937115+achauhan-scc@users.noreply.github.com> Date: Thu, 29 Aug 2024 11:30:05 +0530 Subject: [PATCH 49/71] Releasing 1.2.0 (#45597) * generating latest version of sdk * fixing generated code * fixing backward compatability issues * correct change log * more fixings for build * fixing change log * fixing build issue * fixing trigger property * fixing the failing test case * Fixing review comments * specifying the release date for 1.2.0 * change log format --- .../CHANGELOG.md | 8 +- ...eManager.MachineLearning.netstandard2.0.cs | 3502 ++++++++++------- ...EndpointResourcePropertiesBasicResource.cs | 179 + ...sourcePropertiesBasicResourceCollection.cs | 207 + ...ninRegistryComponentContainerCollection.cs | 10 +- ...arninRegistryComponentContainerResource.cs | 6 +- ...arninRegistryComponentVersionCollection.cs | 10 +- ...LearninRegistryComponentVersionResource.cs | 6 +- ...achineLearningBatchDeploymentCollection.cs | 10 +- ..._MachineLearningBatchDeploymentResource.cs | 6 +- ..._MachineLearningBatchEndpointCollection.cs | 10 +- ...le_MachineLearningBatchEndpointResource.cs | 8 +- ..._MachineLearningCodeContainerCollection.cs | 10 +- ...le_MachineLearningCodeContainerResource.cs | 6 +- ...le_MachineLearningCodeVersionCollection.cs | 10 +- ...mple_MachineLearningCodeVersionResource.cs | 45 +- ...ineLearningComponentContainerCollection.cs | 10 +- ...chineLearningComponentContainerResource.cs | 6 +- ...chineLearningComponentVersionCollection.cs | 10 +- ...MachineLearningComponentVersionResource.cs | 41 +- ...Sample_MachineLearningComputeCollection.cs | 57 +- .../Sample_MachineLearningComputeResource.cs | 129 +- ..._MachineLearningDataContainerCollection.cs | 10 +- ...le_MachineLearningDataContainerResource.cs | 6 +- ...le_MachineLearningDataVersionCollection.cs | 16 +- ...mple_MachineLearningDataVersionResource.cs | 41 +- ...mple_MachineLearningDatastoreCollection.cs | 14 +- ...Sample_MachineLearningDatastoreResource.cs | 21 +- ...eLearningEnvironmentContainerCollection.cs | 10 +- ...ineLearningEnvironmentContainerResource.cs | 6 +- ...ineLearningEnvironmentVersionCollection.cs | 10 +- ...chineLearningEnvironmentVersionResource.cs | 41 +- ...Sample_MachineLearningFeatureCollection.cs | 15 +- .../Sample_MachineLearningFeatureResource.cs | 2 +- ...neLearningFeatureSetContainerCollection.cs | 10 +- ...hineLearningFeatureSetContainerResource.cs | 6 +- ...hineLearningFeatureSetVersionCollection.cs | 10 +- ...achineLearningFeatureSetVersionResource.cs | 52 +- ...ngFeatureStoreEntityContainerCollection.cs | 10 +- ...ningFeatureStoreEntityContainerResource.cs | 6 +- ...ningFeaturestoreEntityVersionCollection.cs | 10 +- ...arningFeaturestoreEntityVersionResource.cs | 6 +- .../Sample_MachineLearningJobCollection.cs | 435 +- .../Sample_MachineLearningJobResource.cs | 466 ++- ...mple_MachineLearningLabelingJobResource.cs | 265 -- ...MachineLearningModelContainerCollection.cs | 10 +- ...e_MachineLearningModelContainerResource.cs | 6 +- ...e_MachineLearningModelVersionCollection.cs | 10 +- ...ple_MachineLearningModelVersionResource.cs | 55 +- ...chineLearningOnlineDeploymentCollection.cs | 18 +- ...MachineLearningOnlineDeploymentResource.cs | 16 +- ...MachineLearningOnlineEndpointCollection.cs | 10 +- ...e_MachineLearningOnlineEndpointResource.cs | 12 +- ...hineLearningOutboundRuleBasicCollection.cs | 20 +- ...achineLearningOutboundRuleBasicResource.cs | 14 +- ...ningPrivateEndpointConnectionCollection.cs | 10 +- ...arningPrivateEndpointConnectionResource.cs | 6 +- ...LearningRegistryCodeContainerCollection.cs | 10 +- ...neLearningRegistryCodeContainerResource.cs | 6 +- ...neLearningRegistryCodeVersionCollection.cs | 10 +- ...hineLearningRegistryCodeVersionResource.cs | 10 +- ...ample_MachineLearningRegistryCollection.cs | 261 +- ...LearningRegistryDataContainerCollection.cs | 10 +- ...neLearningRegistryDataContainerResource.cs | 6 +- ...neLearningRegistryDataVersionCollection.cs | 10 +- ...hineLearningRegistryDataVersionResource.cs | 8 +- ...gRegistryEnvironmentContainerCollection.cs | 10 +- ...ingRegistryEnvironmentContainerResource.cs | 6 +- ...ingRegistryEnvironmentVersionCollection.cs | 10 +- ...rningRegistryEnvironmentVersionResource.cs | 6 +- ...earningRegistryModelContainerCollection.cs | 10 +- ...eLearningRegistryModelContainerResource.cs | 6 +- ...eLearningRegistryModelVersionCollection.cs | 10 +- ...ineLearningRegistryModelVersionResource.cs | 74 +- .../Sample_MachineLearningRegistryResource.cs | 133 +- ...ample_MachineLearningScheduleCollection.cs | 10 +- .../Sample_MachineLearningScheduleResource.cs | 6 +- ...mple_MachineLearningWorkspaceCollection.cs | 10 +- ...neLearningWorkspaceConnectionCollection.cs | 10 +- ...hineLearningWorkspaceConnectionResource.cs | 88 +- ...Sample_MachineLearningWorkspaceResource.cs | 94 +- ...ample_MarketplaceSubscriptionCollection.cs | 201 + .../Sample_MarketplaceSubscriptionResource.cs | 112 + ...RaiBlocklistItemPropertiesBasicResource.cs | 122 + ...stItemPropertiesBasicResourceCollection.cs | 215 + ...ple_RaiBlocklistPropertiesBasicResource.cs | 199 + ...cklistPropertiesBasicResourceCollection.cs | 209 + ...=> Sample_ServerlessEndpointCollection.cs} | 198 +- .../Sample_ServerlessEndpointResource.cs | 197 + .../Sample_SubscriptionResourceExtensions.cs | 8 +- ...WorkspaceConnectionDeploymentCollection.cs | 214 + ...e_WorkspaceConnectionDeploymentResource.cs | 123 + ..._WorkspaceConnectionRaiPolicyCollection.cs | 238 ++ ...le_WorkspaceConnectionRaiPolicyResource.cs | 147 + ...e_WorkspaceEndpointDeploymentCollection.cs | 214 + ...ple_WorkspaceEndpointDeploymentResource.cs | 123 + ...le_WorkspaceEndpointRaiPolicyCollection.cs | 238 ++ ...mple_WorkspaceEndpointRaiPolicyResource.cs | 147 + ...ure.ResourceManager.MachineLearning.csproj | 2 +- ...ableMachineLearningSubscriptionResource.cs | 4 +- ...chineLearningComponentVersionCollection.cs | 10 +- .../MachineLearningDataVersionCollection.cs | 12 +- .../MachineLearningDatastoreCollection.cs | 2 - .../MachineLearningDatastoreResource.cs | 74 + ...ineLearningEnvironmentVersionCollection.cs | 12 +- .../MachineLearningJobCollection.cs | 4 +- .../MachineLearningModelVersionCollection.cs | 4 +- .../MachineLearningWorkspaceCollection.cs | 4 +- ...neLearningWorkspaceConnectionCollection.cs | 77 + ...MachineLearningComputeStartStopSchedule.cs | 3 +- .../ArmMachineLearningModelFactory.cs | 1935 ++++++--- ...opertiesBasicResourceData.Serialization.cs | 175 + ...mentResourcePropertiesBasicResourceData.cs | 92 + ...cePropertiesBasicResource.Serialization.cs | 26 + ...EndpointResourcePropertiesBasicResource.cs | 623 +++ ...sourcePropertiesBasicResourceCollection.cs | 502 +++ ...opertiesBasicResourceData.Serialization.cs | 175 + ...ointResourcePropertiesBasicResourceData.cs | 92 + .../Extensions/MachineLearningExtensions.cs | 244 +- .../MockableMachineLearningArmClient.cs | 120 +- ...bleMachineLearningResourceGroupResource.cs | 12 +- ...ableMachineLearningSubscriptionResource.cs | 42 +- ...ePropertiesBasicResourceOperationSource.cs | 38 + .../ExportSummaryOperationSource.cs | 30 - ...tVersionBackfillResponseOperationSource.cs | 30 + .../IListOperationSource.cs | 40 + ...LearningEndpointAuthKeysOperationSource.cs | 30 + ...ineLearningFeatureSetJobOperationSource.cs | 30 - ...chineLearningLabelingJobOperationSource.cs | 38 - .../MarketplaceSubscriptionOperationSource.cs | 38 + .../ModelPackageResultOperationSource.cs | 30 - ...mPropertiesBasicResourceOperationSource.cs | 38 + ...tPropertiesBasicResourceOperationSource.cs | 38 + .../ServerlessEndpointOperationSource.cs | 38 + ...paceConnectionDeploymentOperationSource.cs | 38 + ...spaceConnectionRaiPolicyOperationSource.cs | 38 + ...kspaceEndpointDeploymentOperationSource.cs | 38 + ...rkspaceEndpointRaiPolicyOperationSource.cs | 38 + ...ninRegistryComponentContainerCollection.cs | 20 +- ...arninRegistryComponentContainerResource.cs | 16 +- ...arninRegistryComponentVersionCollection.cs | 34 +- ...LearninRegistryComponentVersionResource.cs | 12 +- ...achineLearningBatchDeploymentCollection.cs | 20 +- .../MachineLearningBatchDeploymentResource.cs | 24 +- .../MachineLearningBatchEndpointCollection.cs | 20 +- .../MachineLearningBatchEndpointResource.cs | 32 +- .../MachineLearningCodeContainerCollection.cs | 20 +- .../MachineLearningCodeContainerResource.cs | 16 +- .../MachineLearningCodeVersionCollection.cs | 20 +- .../MachineLearningCodeVersionResource.cs | 108 +- ...ineLearningComponentContainerCollection.cs | 20 +- ...chineLearningComponentContainerResource.cs | 16 +- ...chineLearningComponentVersionCollection.cs | 34 +- ...MachineLearningComponentVersionResource.cs | 105 +- .../MachineLearningComputeCollection.cs | 20 +- .../MachineLearningComputeResource.cs | 274 +- .../MachineLearningDataContainerCollection.cs | 20 +- .../MachineLearningDataContainerResource.cs | 16 +- .../MachineLearningDataVersionCollection.cs | 60 +- .../MachineLearningDataVersionResource.cs | 105 +- .../MachineLearningDatastoreCollection.cs | 20 +- .../Generated/MachineLearningDatastoreData.cs | 6 +- .../MachineLearningDatastoreResource.cs | 26 +- ...eLearningEnvironmentContainerCollection.cs | 20 +- ...ineLearningEnvironmentContainerResource.cs | 16 +- ...ineLearningEnvironmentVersionCollection.cs | 34 +- ...chineLearningEnvironmentVersionResource.cs | 105 +- .../MachineLearningFeatureCollection.cs | 49 +- .../MachineLearningFeatureResource.cs | 4 +- ...neLearningFeatureSetContainerCollection.cs | 20 +- ...hineLearningFeatureSetContainerResource.cs | 16 +- ...hineLearningFeatureSetVersionCollection.cs | 20 +- ...achineLearningFeatureSetVersionResource.cs | 97 +- ...ngFeatureStoreEntityContainerCollection.cs | 20 +- ...ningFeatureStoreEntityContainerResource.cs | 16 +- ...ningFeaturestoreEntityVersionCollection.cs | 20 +- ...arningFeaturestoreEntityVersionResource.cs | 12 +- .../Generated/MachineLearningJobCollection.cs | 56 +- .../src/Generated/MachineLearningJobData.cs | 6 +- .../Generated/MachineLearningJobResource.cs | 97 +- .../MachineLearningLabelingJobCollection.cs | 509 --- ...arningLabelingJobResource.Serialization.cs | 26 - .../MachineLearningLabelingJobResource.cs | 608 --- ...MachineLearningModelContainerCollection.cs | 20 +- .../MachineLearningModelContainerResource.cs | 16 +- .../MachineLearningModelVersionCollection.cs | 28 +- .../MachineLearningModelVersionResource.cs | 60 +- ...chineLearningOnlineDeploymentCollection.cs | 20 +- ...MachineLearningOnlineDeploymentResource.cs | 32 +- ...MachineLearningOnlineEndpointCollection.cs | 20 +- .../MachineLearningOnlineEndpointResource.cs | 40 +- ...hineLearningOutboundRuleBasicCollection.cs | 20 +- .../MachineLearningOutboundRuleBasicData.cs | 5 +- ...achineLearningOutboundRuleBasicResource.cs | 12 +- ...ningPrivateEndpointConnectionCollection.cs | 20 +- ...ateEndpointConnectionData.Serialization.cs | 2 +- ...neLearningPrivateEndpointConnectionData.cs | 2 +- ...arningPrivateEndpointConnectionResource.cs | 24 +- ...LearningRegistryCodeContainerCollection.cs | 20 +- ...neLearningRegistryCodeContainerResource.cs | 16 +- ...neLearningRegistryCodeVersionCollection.cs | 20 +- ...hineLearningRegistryCodeVersionResource.cs | 16 +- .../MachineLearningRegistryCollection.cs | 20 +- ...chineLearningRegistryData.Serialization.cs | 44 +- .../Generated/MachineLearningRegistryData.cs | 26 +- ...LearningRegistryDataContainerCollection.cs | 20 +- ...neLearningRegistryDataContainerResource.cs | 16 +- ...neLearningRegistryDataVersionCollection.cs | 20 +- ...hineLearningRegistryDataVersionResource.cs | 16 +- ...gRegistryEnvironmentContainerCollection.cs | 20 +- ...ingRegistryEnvironmentContainerResource.cs | 16 +- ...ingRegistryEnvironmentVersionCollection.cs | 34 +- ...rningRegistryEnvironmentVersionResource.cs | 12 +- ...earningRegistryModelContainerCollection.cs | 20 +- ...eLearningRegistryModelContainerResource.cs | 16 +- ...eLearningRegistryModelVersionCollection.cs | 20 +- ...ineLearningRegistryModelVersionResource.cs | 108 +- .../MachineLearningRegistryResource.cs | 138 +- .../MachineLearningScheduleCollection.cs | 20 +- .../MachineLearningScheduleResource.cs | 12 +- .../MachineLearningWorkspaceCollection.cs | 54 +- ...neLearningWorkspaceConnectionCollection.cs | 34 +- .../MachineLearningWorkspaceConnectionData.cs | 6 +- ...hineLearningWorkspaceConnectionResource.cs | 375 +- ...hineLearningWorkspaceData.Serialization.cs | 106 + .../Generated/MachineLearningWorkspaceData.cs | 27 +- .../MachineLearningWorkspaceResource.cs | 534 ++- .../MarketplaceSubscriptionCollection.cs | 495 +++ ...ketplaceSubscriptionData.Serialization.cs} | 42 +- ...Data.cs => MarketplaceSubscriptionData.cs} | 18 +- ...placeSubscriptionResource.Serialization.cs | 26 + .../MarketplaceSubscriptionResource.cs | 347 ++ ...spaceConnectionProperties.Serialization.cs | 326 ++ ...adAuthTypeWorkspaceConnectionProperties.cs | 43 + ...spaceConnectionProperties.Serialization.cs | 158 +- ...eyAuthTypeWorkspaceConnectionProperties.cs | 13 +- ...ion.cs => AccountApiKeys.Serialization.cs} | 73 +- ...AutoDeleteSetting.cs => AccountApiKeys.cs} | 28 +- ...spaceConnectionProperties.Serialization.cs | 342 ++ ...eyAuthTypeWorkspaceConnectionProperties.cs | 59 + .../Generated/Models/AllowedContentLevel.cs | 54 + .../Models/AmlTokenComputeIdentity.cs | 2 +- ...AnonymousAccessCredential.Serialization.cs | 119 + .../Models/AnonymousAccessCredential.cs | 30 + ...spaceConnectionProperties.Serialization.cs | 158 +- ...ApiKeyAuthWorkspaceConnectionProperties.cs | 13 +- .../Generated/Models/AutoDeleteCondition.cs | 51 - .../Models/AutoMLJob.Serialization.cs | 35 - .../src/Generated/Models/AutoMLJob.cs | 17 +- .../AutoMLVerticalRegression.Serialization.cs | 82 - .../Models/AutoMLVerticalRegression.cs | 15 +- .../Models/AutoMLVerticalRegressionModel.cs | 2 +- ...AlertNotificationSettings.Serialization.cs | 119 - ...zMonMonitoringAlertNotificationSettings.cs | 30 - .../Models/AzureMLBatchInferencingServer.cs | 35 - .../Models/AzureMLOnlineInferencingServer.cs | 35 - .../AzureOpenAiFineTuning.Serialization.cs | 196 + .../Generated/Models/AzureOpenAiFineTuning.cs | 63 + ...zureOpenAiHyperParameters.Serialization.cs | 180 + .../Models/AzureOpenAiHyperParameters.cs | 73 + .../BaseEnvironmentSource.Serialization.cs | 110 - .../Generated/Models/BaseEnvironmentSource.cs | 68 - .../Models/BaseEnvironmentSourceType.cs | 48 - .../BaseEnvironmentType.Serialization.cs | 127 - .../Generated/Models/BaseEnvironmentType.cs | 46 - .../Generated/Models/ClassificationModel.cs | 2 +- .../ClassificationModelPerformanceMetric.cs | 54 - ...erformanceMetricThreshold.Serialization.cs | 150 - ...ficationModelPerformanceMetricThreshold.cs | 43 - .../ClassificationTask.Serialization.cs | 82 - .../Generated/Models/ClassificationTask.cs | 15 +- ...ificationTrainingSettings.Serialization.cs | 16 - .../Models/ClassificationTrainingSettings.cs | 7 +- .../Models/CocoExportSummary.Serialization.cs | 265 -- .../src/Generated/Models/CocoExportSummary.cs | 43 - .../Models/ComputeRecurrenceFrequency.cs | 60 + ...ComputeRecurrenceSchedule.Serialization.cs | 213 + .../Models/ComputeRecurrenceSchedule.cs | 93 + ...artStopRecurrenceSchedule.Serialization.cs | 8 +- .../ComputeStartStopRecurrenceSchedule.cs | 6 +- .../src/Generated/Models/ComputeWeekDay.cs | 66 + .../src/Generated/Models/ConnectionGroup.cs | 66 + ...tion.cs => ContentSafety.Serialization.cs} | 48 +- .../src/Generated/Models/ContentSafety.cs | 72 + ...loymentResourceProperties.Serialization.cs | 186 + ...etyEndpointDeploymentResourceProperties.cs | 55 + ...ndpointResourceProperties.Serialization.cs | 251 ++ ...ContentSafetyEndpointResourceProperties.cs | 44 + .../Generated/Models/ContentSafetyStatus.cs | 51 + .../src/Generated/Models/CredentialsType.cs | 6 - .../Models/CronTrigger.Serialization.cs | 4 +- .../src/Generated/Models/CronTrigger.cs | 4 +- .../Models/CsvExportSummary.Serialization.cs | 265 -- .../src/Generated/Models/CsvExportSummary.cs | 43 - .../Models/CustomInferencingServer.cs | 35 - ...spaceConnectionProperties.Serialization.cs | 158 +- ...CustomKeysWorkspaceConnectionProperties.cs | 13 +- .../CustomModelFineTuning.Serialization.cs | 207 + .../Generated/Models/CustomModelFineTuning.cs | 64 + .../CustomMonitoringSignal.Serialization.cs | 43 +- .../Models/CustomMonitoringSignal.cs | 25 +- .../Models/CustomService.Serialization.cs | 16 + .../src/Generated/Models/CustomService.cs | 6 +- .../Models/DataAvailabilityStatus.cs | 57 + ...DataDriftMonitoringSignal.Serialization.cs | 80 +- .../Models/DataDriftMonitoringSignal.cs | 24 +- .../Models/DataImport.Serialization.cs | 376 -- .../src/Generated/Models/DataImport.cs | 65 - .../Models/DataImportSource.Serialization.cs | 123 - .../Generated/Models/DataImportSourceType.cs | 51 - ...taQualityMonitoringSignal.Serialization.cs | 56 +- .../Models/DataQualityMonitoringSignal.cs | 20 +- .../DataReferenceCredential.Serialization.cs | 113 + ...rtSource.cs => DataReferenceCredential.cs} | 27 +- .../Models/DataReferenceCredentialType.cs | 57 + .../Models/DatabaseSource.Serialization.cs | 274 -- .../src/Generated/Models/DatabaseSource.cs | 49 - .../DatasetExportSummary.Serialization.cs | 241 -- .../Generated/Models/DatasetExportSummary.cs | 39 - .../src/Generated/Models/DatastoreType.cs | 3 - .../DefaultResourceProvisioningState.cs | 75 + .../DeploymentModelVersionUpgradeOption.cs | 54 + ...n.cs => DestinationAsset.Serialization.cs} | 107 +- .../src/Generated/Models/DestinationAsset.cs | 73 + .../src/Generated/Models/DistributionType.cs | 3 - ...n.cs => DockerCredential.Serialization.cs} | 84 +- .../src/Generated/Models/DockerCredential.cs | 39 + ...AlertNotificationSettings.Serialization.cs | 142 - ...mailMonitoringAlertNotificationSettings.cs | 35 - ... EndpointDeploymentModel.Serialization.cs} | 97 +- .../Models/EndpointDeploymentModel.cs | 77 + ...loymentResourceProperties.Serialization.cs | 123 + .../EndpointDeploymentResourceProperties.cs | 76 + ...esourceArmPaginatedResult.Serialization.cs | 147 + ...opertiesBasicResourceArmPaginatedResult.cs | 70 + ...ation.cs => EndpointKeys.Serialization.cs} | 55 +- ...lingJobInstructions.cs => EndpointKeys.cs} | 20 +- ...odelDeprecationProperties.Serialization.cs | 141 + .../EndpointModelDeprecationProperties.cs | 69 + .../EndpointModelProperties.Serialization.cs | 309 ++ .../Models/EndpointModelProperties.cs | 109 + ...odelSkuCapacityProperties.Serialization.cs | 141 + .../EndpointModelSkuCapacityProperties.cs | 69 + ...ndpointModelSkuProperties.Serialization.cs | 232 ++ .../Models/EndpointModelSkuProperties.cs | 88 + ...delSkuRateLimitProperties.Serialization.cs | 166 + ...=> EndpointModelSkuRateLimitProperties.cs} | 38 +- ...imitRulePatternProperties.Serialization.cs | 133 + ...ModelSkuRateLimitRulePatternProperties.cs} | 29 +- ...kuRateLimitRuleProperties.Serialization.cs | 214 + ...EndpointModelSkuRateLimitRuleProperties.cs | 86 + ...ion.cs => EndpointModels.Serialization.cs} | 44 +- .../src/Generated/Models/EndpointModels.cs | 70 + ...ndpointResourceProperties.Serialization.cs | 159 + .../Models/EndpointResourceProperties.cs | 112 + ...esourceArmPaginatedResult.Serialization.cs | 147 + ...opertiesBasicResourceArmPaginatedResult.cs | 70 + .../src/Generated/Models/EndpointType.cs | 63 + .../src/Generated/Models/ExportFormatType.cs | 54 - .../Models/ExportSummary.Serialization.cs | 160 - .../src/Generated/Models/ExportSummary.cs | 84 - ...tionDriftMonitoringSignal.Serialization.cs | 76 +- ...FeatureAttributionDriftMonitoringSignal.cs | 32 +- .../Generated/Models/FeatureImportanceMode.cs | 51 + ...eatureImportanceSettings.Serialization.cs} | 72 +- ...Result.cs => FeatureImportanceSettings.cs} | 29 +- ...SetVersionBackfillContent.Serialization.cs | 65 + .../FeatureSetVersionBackfillContent.cs | 16 +- .../Generated/Models/FeatureStoreJobType.cs | 51 - .../Models/FeaturesetSpecification.cs | 2 +- ...tVersionBackfillResponse.Serialization.cs} | 74 +- .../FeaturesetVersionBackfillResponse.cs | 66 + .../src/Generated/Models/FileSystemSource.cs | 36 - ...tion.cs => FineTuningJob.Serialization.cs} | 311 +- .../src/Generated/Models/FineTuningJob.cs | 128 + .../Generated/Models/FineTuningTaskType.cs | 78 + .../FineTuningVertical.Serialization.cs | 129 + .../Generated/Models/FineTuningVertical.cs | 119 + .../src/Generated/Models/ForecastingModel.cs | 2 +- .../ForecastingSettings.Serialization.cs | 34 - .../Generated/Models/ForecastingSettings.cs | 13 +- ...recastingTrainingSettings.Serialization.cs | 16 - .../Models/ForecastingTrainingSettings.cs | 7 +- .../Models/FqdnOutboundRule.Serialization.cs | 33 +- .../src/Generated/Models/FqdnOutboundRule.cs | 3 +- .../Models/GenerationSafetyQualityMetric.cs | 75 - .../GenerationSafetyQualityMetricThreshold.cs | 93 - ...tyQualityMonitoringSignal.Serialization.cs | 258 -- ...GenerationSafetyQualityMonitoringSignal.cs | 71 - .../Models/GenerationTokenStatisticsMetric.cs | 51 - ...StatisticsMetricThreshold.Serialization.cs | 142 - ...enerationTokenStatisticsMetricThreshold.cs | 93 - ...tionTokenStatisticsSignal.Serialization.cs | 224 -- .../Models/GenerationTokenStatisticsSignal.cs | 66 - ...eferenceForConsumptionDto.Serialization.cs | 180 + .../GetBlobReferenceForConsumptionDto.cs | 81 + ...obReferenceSasRequestDto.Serialization.cs} | 81 +- .../Models/GetBlobReferenceSasRequestDto.cs | 69 + ...bReferenceSasResponseDto.Serialization.cs} | 64 +- .../Models/GetBlobReferenceSasResponseDto.cs | 65 + .../Models/HdfsDatastore.Serialization.cs | 309 -- .../src/Generated/Models/HdfsDatastore.cs | 69 - .../Generated/Models/ImageAnnotationType.cs | 54 - .../Models/ImageMetadata.Serialization.cs | 17 +- .../src/Generated/Models/ImageMetadata.cs | 6 +- ...elSettingsObjectDetection.Serialization.cs | 32 - .../ImageModelSettingsObjectDetection.cs | 10 +- .../Models/ImageSetting.Serialization.cs | 13 +- .../src/Generated/Models/ImageSetting.cs | 14 +- .../src/Generated/Models/ImageType.cs | 2 +- .../Models/ImportDataAction.Serialization.cs | 127 - .../src/Generated/Models/ImportDataAction.cs | 45 - .../Models/IncrementalDataRefresh.cs | 51 - .../src/Generated/Models/IndexColumn.cs | 2 +- .../Models/InferencingServer.Serialization.cs | 113 - .../src/Generated/Models/InferencingServer.cs | 68 - .../Generated/Models/InferencingServerType.cs | 57 - .../src/Generated/Models/InputPathType.cs | 54 - .../Models/IntellectualProtectionLevel.cs | 51 - .../Generated/Models/JobProvisioningState.cs | 57 - .../Models/JobQueueSettings.Serialization.cs | 27 +- .../src/Generated/Models/JobQueueSettings.cs | 8 +- .../Models/JobResources.Serialization.cs | 136 + .../src/Generated/Models/JobResources.cs | 66 + .../Generated/Models/JobStatusMessageLevel.cs | 54 - .../src/Generated/Models/JobType.cs | 6 +- ...s => JupyterKernelConfig.Serialization.cs} | 99 +- ...tatusMessage.cs => JupyterKernelConfig.cs} | 41 +- ...KerberosKeytabCredentials.Serialization.cs | 157 - .../Models/KerberosKeytabCredentials.cs | 66 - .../Generated/Models/KerberosKeytabSecrets.cs | 35 - ...rberosPasswordCredentials.Serialization.cs | 157 - .../Models/KerberosPasswordCredentials.cs | 66 - .../KerberosPasswordSecrets.Serialization.cs | 142 - .../Models/KerberosPasswordSecrets.cs | 35 - .../Models/LabelCategory.Serialization.cs | 183 - .../Models/LabelCategoryMultiSelect.cs | 51 - .../Models/LabelingJobImageProperties.cs | 35 - ...abelingJobMediaProperties.Serialization.cs | 111 - .../Models/LabelingJobMediaProperties.cs | 69 - .../Generated/Models/LabelingJobProperties.cs | 123 - .../Models/LabelingJobTextProperties.cs | 35 - .../src/Generated/Models/LogTrainingMetric.cs | 51 - .../src/Generated/Models/LogValidationLoss.cs | 51 - .../Models/MLAssistConfigurationDisabled.cs | 30 - .../Models/MLAssistConfigurationType.cs | 51 - .../MachineLearningAssetBase.Serialization.cs | 24 - .../Models/MachineLearningAssetBase.cs | 14 +- ...arningAssistConfiguration.Serialization.cs | 111 - ...ssistEnabledConfiguration.Serialization.cs | 135 - ...chineLearningAssistEnabledConfiguration.cs | 52 - ...earningAzureBlobDatastore.Serialization.cs | 24 - .../MachineLearningAzureBlobDatastore.cs | 7 +- ...zureDataLakeGen1Datastore.Serialization.cs | 24 - ...chineLearningAzureDataLakeGen1Datastore.cs | 7 +- ...zureDataLakeGen2Datastore.Serialization.cs | 24 - ...chineLearningAzureDataLakeGen2Datastore.cs | 7 +- ...earningAzureFileDatastore.Serialization.cs | 24 - .../MachineLearningAzureFileDatastore.cs | 7 +- ...achineLearningBatchDeploymentProperties.cs | 2 +- ...ningCodeVersionProperties.Serialization.cs | 24 - .../MachineLearningCodeVersionProperties.cs | 7 +- ...MachineLearningCommandJob.Serialization.cs | 59 - .../Models/MachineLearningCommandJob.cs | 39 +- ...omponentVersionProperties.Serialization.cs | 50 +- ...chineLearningComponentVersionProperties.cs | 11 +- ...gComputeInstanceDataMount.Serialization.cs | 16 + ...MachineLearningComputeInstanceDataMount.cs | 26 +- ...ComputeInstanceProperties.Serialization.cs | 96 + ...achineLearningComputeInstanceProperties.cs | 18 +- .../MachineLearningComputeInstanceState.cs | 3 + .../MachineLearningConnectionAuthType.cs | 9 + .../MachineLearningConnectionCategory.cs | 258 ++ .../Models/MachineLearningContainerType.cs | 9 +- ...rningCustomModelJobOutput.Serialization.cs | 79 +- .../MachineLearningCustomModelJobOutput.cs | 14 +- ...rningDataVersionCollectionGetAllOptions.cs | 34 - ...ningDataVersionProperties.Serialization.cs | 36 - .../MachineLearningDataVersionProperties.cs | 15 +- ...rningDatastoreCredentials.Serialization.cs | 2 - .../MachineLearningDatastoreCredentials.cs | 2 +- ...arningDatastoreProperties.Serialization.cs | 13 - .../MachineLearningDatastoreProperties.cs | 14 +- ...eLearningDatastoreSecrets.Serialization.cs | 2 - .../Models/MachineLearningDatastoreSecrets.cs | 2 +- ...mentResourceConfiguration.Serialization.cs | 64 +- ...LearningDeploymentResourceConfiguration.cs | 7 +- ...DistributionConfiguration.Serialization.cs | 1 - ...achineLearningDistributionConfiguration.cs | 2 +- ...ineLearningEndpointDeploymentProperties.cs | 4 +- ...ironmentVersionProperties.Serialization.cs | 48 - ...ineLearningEnvironmentVersionProperties.cs | 11 +- ...eLearningFeatureCollectionGetAllOptions.cs | 31 + .../MachineLearningFeatureProperties.cs | 2 +- ...neLearningFeatureSetContainerProperties.cs | 2 +- ...hineLearningFeatureSetJob.Serialization.cs | 323 -- .../Models/MachineLearningFeatureSetJob.cs | 98 - ...atureSetVersionProperties.Serialization.cs | 24 - ...hineLearningFeatureSetVersionProperties.cs | 9 +- ...ngFeatureStoreEntityContainerProperties.cs | 2 +- ...reEntityVersionProperties.Serialization.cs | 24 - ...ningFeatureStoreEntityVersionProperties.cs | 9 +- .../MachineLearningFlowAutoLoggerState.cs | 51 - ...earningFlowModelJobOutput.Serialization.cs | 79 +- .../MachineLearningFlowModelJobOutput.cs | 14 +- ...achineLearningForecasting.Serialization.cs | 82 - .../Models/MachineLearningForecasting.cs | 15 +- ...chineLearningJobCollectionGetAllOptions.cs | 33 - ...hineLearningJobProperties.Serialization.cs | 20 +- .../Models/MachineLearningJobProperties.cs | 9 +- ...gJobResourceConfiguration.Serialization.cs | 58 - ...MachineLearningJobResourceConfiguration.cs | 7 +- .../MachineLearningJobScheduleAction.cs | 6 +- .../Models/MachineLearningJobService.cs | 4 +- .../Models/MachineLearningJobStatus.cs | 3 - ...chineLearningKubernetesOnlineDeployment.cs | 2 +- ...thTypeWorkspaceConnection.Serialization.cs | 158 +- ...agedIdentityAuthTypeWorkspaceConnection.cs | 13 +- .../MachineLearningManagedOnlineDeployment.cs | 2 +- ...ningModelVersionCollectionGetAllOptions.cs | 2 - ...ingModelVersionProperties.Serialization.cs | 48 - .../MachineLearningModelVersionProperties.cs | 11 +- ...thTypeWorkspaceConnection.Serialization.cs | 158 +- ...LearningNoneAuthTypeWorkspaceConnection.cs | 13 +- ...chineLearningOnlineDeploymentProperties.cs | 2 +- .../MachineLearningOnlineRequestSettings.cs | 6 +- .../Models/MachineLearningOperationName.cs | 3 + .../Models/MachineLearningOperationStatus.cs | 3 + ...chineLearningOutboundRule.Serialization.cs | 10 + .../Models/MachineLearningOutboundRule.cs | 7 +- ...thTypeWorkspaceConnection.Serialization.cs | 158 +- ...eLearningPatAuthTypeWorkspaceConnection.cs | 13 +- ...achineLearningPipelineJob.Serialization.cs | 35 - .../Models/MachineLearningPipelineJob.cs | 3 +- ...LearningRecurrenceTrigger.Serialization.cs | 4 +- .../MachineLearningRecurrenceTrigger.cs | 4 +- ...ningResourceConfiguration.Serialization.cs | 64 +- .../MachineLearningResourceConfiguration.cs | 17 +- ...thTypeWorkspaceConnection.Serialization.cs | 158 +- ...eLearningSasAuthTypeWorkspaceConnection.cs | 13 +- ...ineLearningScheduleAction.Serialization.cs | 1 - .../Models/MachineLearningScheduleAction.cs | 2 +- .../MachineLearningScheduleProperties.cs | 6 +- .../MachineLearningSweepJob.Serialization.cs | 35 - .../Models/MachineLearningSweepJob.cs | 17 +- .../MachineLearningTable.Serialization.cs | 72 - .../Generated/Models/MachineLearningTable.cs | 9 +- ...ineLearningTableJobOutput.Serialization.cs | 79 +- .../Models/MachineLearningTableJobOutput.cs | 14 +- ...eLearningTrainingSettings.Serialization.cs | 16 - .../Models/MachineLearningTrainingSettings.cs | 14 +- .../Models/MachineLearningTrialComponent.cs | 4 +- .../Models/MachineLearningTriggerBase.cs | 4 +- ...rningTritonModelJobOutput.Serialization.cs | 79 +- .../MachineLearningTritonModelJobOutput.cs | 14 +- ...earningUriFileDataVersion.Serialization.cs | 74 +- .../MachineLearningUriFileDataVersion.cs | 9 +- ...eLearningUriFileJobOutput.Serialization.cs | 79 +- .../Models/MachineLearningUriFileJobOutput.cs | 14 +- ...rningUriFolderDataVersion.Serialization.cs | 74 +- .../MachineLearningUriFolderDataVersion.cs | 9 +- ...earningUriFolderJobOutput.Serialization.cs | 79 +- .../MachineLearningUriFolderJobOutput.cs | 14 +- ...thTypeWorkspaceConnection.Serialization.cs | 158 +- ...namePasswordAuthTypeWorkspaceConnection.cs | 13 +- ...MachineLearningWorkspaceConnectionPatch.cs | 4 +- ...spaceConnectionProperties.Serialization.cs | 61 +- ...neLearningWorkspaceConnectionProperties.cs | 74 +- ...onnectionUsernamePassword.Serialization.cs | 13 +- ...ningWorkspaceConnectionUsernamePassword.cs | 6 +- ...rkspaceDiagnoseProperties.Serialization.cs | 46 + ...hineLearningWorkspaceDiagnoseProperties.cs | 36 +- ...ineLearningWorkspacePatch.Serialization.cs | 74 + .../Models/MachineLearningWorkspacePatch.cs | 19 +- .../Models/ManagedComputeIdentity.cs | 6 +- ...ManagedIdentityCredential.Serialization.cs | 241 ++ .../Models/ManagedIdentityCredential.cs | 51 + .../ManagedNetworkSettings.Serialization.cs | 33 +- .../Models/ManagedNetworkSettings.cs | 7 +- ...loymentResourceProperties.Serialization.cs | 177 + ...ineEndpointDeploymentResourceProperties.cs | 41 + ...ndpointResourceProperties.Serialization.cs | 361 ++ ...ManagedOnlineEndpointResourceProperties.cs | 71 + .../Generated/Models/ManagedPERequirement.cs | 54 + .../src/Generated/Models/ManagedPEStatus.cs | 54 + ...eGroupAssignedIdentities.Serialization.cs} | 66 +- ...ManagedResourceGroupAssignedIdentities.cs} | 24 +- ...agedResourceGroupSettings.Serialization.cs | 144 + ...ent.cs => ManagedResourceGroupSettings.cs} | 26 +- ...on.cs => MarketplacePlan.Serialization.cs} | 104 +- ...istConfiguration.cs => MarketplacePlan.cs} | 34 +- ...aceSubscriptionProperties.Serialization.cs | 172 + .../MarketplaceSubscriptionProperties.cs | 87 + ...arketplaceSubscriptionProvisioningState.cs | 63 + ...sourceArmPaginatedResult.Serialization.cs} | 44 +- ...eSubscriptionResourceArmPaginatedResult.cs | 70 + .../Models/MarketplaceSubscriptionStatus.cs | 64 + .../Models/MaterializationComputeResource.cs | 2 +- .../Generated/Models/ModelLifecycleStatus.cs | 51 + .../ModelPackageContent.Serialization.cs | 282 -- .../Generated/Models/ModelPackageContent.cs | 125 - .../Models/ModelPackageInput.Serialization.cs | 165 - .../src/Generated/Models/ModelPackageInput.cs | 101 - .../ModelPackageResult.Serialization.cs | 376 -- .../Generated/Models/ModelPackageResult.cs | 120 - ...rmanceMetricThresholdBase.Serialization.cs | 123 - .../ModelPerformanceMetricThresholdBase.cs | 83 - .../ModelPerformanceSignal.Serialization.cs | 233 -- .../Models/ModelPerformanceSignal.cs | 102 - .../src/Generated/Models/ModelProvider.cs | 51 + ...tion.cs => ModelSettings.Serialization.cs} | 56 +- .../src/Generated/Models/ModelSettings.cs | 65 + .../src/Generated/Models/ModelTaskType.cs | 3 - .../Models/MonitorComputeIdentityBase.cs | 4 +- .../Models/MonitorDefinition.Serialization.cs | 20 +- .../src/Generated/Models/MonitorDefinition.cs | 40 +- ...mailNotificationSettings.Serialization.cs} | 79 +- .../MonitorEmailNotificationSettings.cs | 66 + ...itorNotificationSettings.Serialization.cs} | 71 +- ...Base.cs => MonitorNotificationSettings.cs} | 36 +- ...tNotificationSettingsBase.Serialization.cs | 111 - .../Models/MonitoringAlertNotificationType.cs | 51 - .../MonitoringInputDataBase.Serialization.cs | 2 +- .../Models/MonitoringInputDataBase.cs | 2 +- .../Models/MonitoringInputDataType.cs | 6 +- .../Generated/Models/MonitoringModelType.cs | 51 - .../Models/MonitoringNotificationMode.cs | 51 - .../Models/MonitoringNotificationType.cs | 48 + .../MonitoringSignalBase.Serialization.cs | 21 +- .../Generated/Models/MonitoringSignalBase.cs | 11 +- .../Generated/Models/MonitoringSignalType.cs | 9 - .../src/Generated/Models/MonitoringTarget.cs | 14 +- ...toringWorkspaceConnection.Serialization.cs | 179 - .../Models/MonitoringWorkspaceConnection.cs | 83 - .../Models/{MediaType.cs => MountMode.cs} | 36 +- .../NlpFixedParameters.Serialization.cs | 320 -- .../Generated/Models/NlpFixedParameters.cs | 97 - .../Models/NlpLearningRateScheduler.cs | 66 - .../NlpParameterSubspace.Serialization.cs | 328 -- .../Generated/Models/NlpParameterSubspace.cs | 97 - .../Models/NlpSweepSettings.Serialization.cs | 142 - .../src/Generated/Models/NlpSweepSettings.cs | 84 - .../NlpVerticalLimitSettings.Serialization.cs | 38 +- .../Models/NlpVerticalLimitSettings.cs | 10 +- .../src/Generated/Models/NodesValueType.cs | 3 - ...spaceConnectionProperties.Serialization.cs | 342 ++ ...h2AuthTypeWorkspaceConnectionProperties.cs | 54 + .../Models/OSPatchingStatus.Serialization.cs | 210 + .../src/Generated/Models/OSPatchingStatus.cs | 82 + .../Models/OneLakeDatastore.Serialization.cs | 24 - .../src/Generated/Models/OneLakeDatastore.cs | 7 +- ...ineInferenceConfiguration.Serialization.cs | 243 -- .../Models/OnlineInferenceConfiguration.cs | 82 - ...loymentResourceProperties.Serialization.cs | 186 + ...nAIEndpointDeploymentResourceProperties.cs | 55 + ...ndpointResourceProperties.Serialization.cs | 251 ++ .../OpenAIEndpointResourceProperties.cs | 44 + .../Generated/Models/OutboundRuleCategory.cs | 3 + .../src/Generated/Models/PackageBuildState.cs | 57 - .../Models/PackageInputDeliveryMode.cs | 51 - .../PackageInputPathBase.Serialization.cs | 112 - .../Generated/Models/PackageInputPathBase.cs | 68 - .../Generated/Models/PackageInputPathId.cs | 36 - .../Generated/Models/PackageInputPathUri.cs | 35 - .../Models/PackageInputPathVersion.cs | 39 - .../src/Generated/Models/PackageInputType.cs | 51 - .../src/Generated/Models/PartialJobBase.cs | 80 - .../Models/PartialNotificationSetting.cs | 74 - .../src/Generated/Models/PatchStatus.cs | 60 + ...tionDriftMonitoringSignal.Serialization.cs | 76 +- .../Models/PredictionDriftMonitoringSignal.cs | 29 +- ...rivateEndpointDestination.Serialization.cs | 8 +- .../Models/PrivateEndpointDestination.cs | 5 +- ...ivateEndpointOutboundRule.Serialization.cs | 59 +- .../Models/PrivateEndpointOutboundRule.cs | 8 +- .../Models/ProgressMetrics.Serialization.cs | 203 - .../src/Generated/Models/ProgressMetrics.cs | 77 - ...cs => RaiBlocklistConfig.Serialization.cs} | 71 +- .../Generated/Models/RaiBlocklistConfig.cs | 69 + ...iBlocklistItemBulkRequest.Serialization.cs | 137 + .../Models/RaiBlocklistItemBulkRequest.cs | 69 + ...iBlocklistItemProperties.Serialization.cs} | 63 +- .../Models/RaiBlocklistItemProperties.cs | 69 + ...esourceArmPaginatedResult.Serialization.cs | 147 + ...opertiesBasicResourceArmPaginatedResult.cs | 70 + ...> RaiBlocklistProperties.Serialization.cs} | 51 +- .../Models/RaiBlocklistProperties.cs | 65 + ...esourceArmPaginatedResult.Serialization.cs | 147 + ...opertiesBasicResourceArmPaginatedResult.cs | 70 + .../RaiPolicyContentFilter.Serialization.cs | 188 + .../Models/RaiPolicyContentFilter.cs | 81 + .../Models/RaiPolicyContentSource.cs | 51 + .../src/Generated/Models/RaiPolicyMode.cs | 54 + .../RaiPolicyProperties.Serialization.cs | 234 ++ .../Generated/Models/RaiPolicyProperties.cs | 88 + ...esourceArmPaginatedResult.Serialization.cs | 147 + ...opertiesBasicResourceArmPaginatedResult.cs | 70 + .../src/Generated/Models/RaiPolicyType.cs | 51 + .../RandomSamplingAlgorithm.Serialization.cs | 25 +- .../Models/RandomSamplingAlgorithm.cs | 6 +- ...DistributionConfiguration.Serialization.cs | 265 -- .../Models/RayDistributionConfiguration.cs | 55 - ...ServiceAccountKeyContent.Serialization.cs} | 55 +- .../RegenerateServiceAccountKeyContent.cs | 65 + .../Generated/Models/RegistryAcrDetails.cs | 4 +- ...PrivateEndpointConnection.Serialization.cs | 20 +- .../RegistryPrivateEndpointConnection.cs | 12 +- .../RegressionModelPerformanceMetric.cs | 54 - ...erformanceMetricThreshold.Serialization.cs | 150 - ...gressionModelPerformanceMetricThreshold.cs | 43 - ...egressionTrainingSettings.Serialization.cs | 16 - .../Models/RegressionTrainingSettings.cs | 7 +- ...ation.cs => ResizeSchema.Serialization.cs} | 51 +- .../src/Generated/Models/ResizeSchema.cs | 65 + ...n.cs => RollingInputData.Serialization.cs} | 38 +- ...ailingInputData.cs => RollingInputData.cs} | 28 +- ...tion.cs => SasCredential.Serialization.cs} | 66 +- .../src/Generated/Models/SasCredential.cs | 35 + .../Generated/Models/ScheduleActionType.cs | 3 - ...ation.cs => SecretExpiry.Serialization.cs} | 70 +- ...SecretConfiguration.cs => SecretExpiry.cs} | 34 +- .../src/Generated/Models/SecretsType.cs | 6 - ...erverlessComputeSettings.Serialization.cs} | 67 +- .../Models/ServerlessComputeSettings.cs | 70 + ...dpointCapacityReservation.Serialization.cs | 134 + ... ServerlessEndpointCapacityReservation.cs} | 45 +- ...lessEndpointContentSafety.Serialization.cs | 119 + ....cs => ServerlessEndpointContentSafety.cs} | 28 +- ...ndpointInferenceEndpoint.Serialization.cs} | 81 +- .../ServerlessEndpointInferenceEndpoint.cs | 80 + ...essEndpointModelSettings.Serialization.cs} | 48 +- ....cs => ServerlessEndpointModelSettings.cs} | 34 +- ... ServerlessEndpointPatch.Serialization.cs} | 102 +- .../Models/ServerlessEndpointPatch.cs | 37 + ...verlessEndpointProperties.Serialization.cs | 249 ++ .../Models/ServerlessEndpointProperties.cs | 118 + ...ndpointResourceProperties.Serialization.cs | 398 ++ .../ServerlessEndpointResourceProperties.cs | 127 + .../Models/ServerlessEndpointState.cs | 72 + ...esourceArmPaginatedResult.Serialization.cs | 147 + ...pointTrackedResourceArmPaginatedResult.cs} | 24 +- ...verlessInferenceEndpoint.Serialization.cs} | 70 +- .../Models/ServerlessInferenceEndpoint.cs | 80 + .../ServerlessInferenceEndpointAuthMode.cs | 48 + ...on.cs => ServerlessOffer.Serialization.cs} | 55 +- ...llectualProperty.cs => ServerlessOffer.cs} | 35 +- .../Generated/Models/ServiceAccountKeyName.cs | 51 + ...spaceConnectionProperties.Serialization.cs | 158 +- ...alAuthTypeWorkspaceConnectionProperties.cs | 13 +- .../ServiceTagOutboundRule.Serialization.cs | 33 +- .../Models/ServiceTagOutboundRule.cs | 3 +- .../Models/SparkJob.Serialization.cs | 78 +- .../src/Generated/Models/SparkJob.cs | 34 +- ...loymentResourceProperties.Serialization.cs | 186 + ...echEndpointDeploymentResourceProperties.cs | 55 + ...ndpointResourceProperties.Serialization.cs | 251 ++ .../SpeechEndpointResourceProperties.cs | 44 + .../src/Generated/Models/StaticInputData.cs | 4 +- .../Generated/Models/StorageAccountDetails.cs | 4 +- .../TableFixedParameters.Serialization.cs | 576 --- .../Generated/Models/TableFixedParameters.cs | 141 - .../TableParameterSubspace.Serialization.cs | 592 --- .../Models/TableParameterSubspace.cs | 141 - .../TableSweepSettings.Serialization.cs | 142 - .../Generated/Models/TableSweepSettings.cs | 84 - ...ableVerticalLimitSettings.Serialization.cs | 48 - .../Models/TableVerticalLimitSettings.cs | 14 +- .../Generated/Models/TextAnnotationType.cs | 51 - .../TextClassification.Serialization.cs | 82 - .../Generated/Models/TextClassification.cs | 15 +- ...tClassificationMultilabel.Serialization.cs | 82 - .../Models/TextClassificationMultilabel.cs | 15 +- .../Generated/Models/TextNer.Serialization.cs | 82 - .../src/Generated/Models/TextNer.cs | 15 +- .../src/Generated/Models/TrainingMode.cs | 54 - .../src/Generated/Models/TriggerType.cs | 51 + .../TritonInferencingServer.Serialization.cs | 142 - .../Models/TritonInferencingServer.cs | 35 - .../Models/UnknownBaseEnvironmentSource.cs | 29 - .../UnknownDataImportSource.Serialization.cs | 142 - .../Models/UnknownDataImportSource.cs | 30 - ...nDataReferenceCredential.Serialization.cs} | 55 +- .../Models/UnknownDataReferenceCredential.cs | 29 + .../UnknownDataVersionBase.Serialization.cs | 74 +- .../Models/UnknownDataVersionBase.cs | 9 +- .../Models/UnknownDatastore.Serialization.cs | 24 - .../src/Generated/Models/UnknownDatastore.cs | 5 +- ...loymentResourceProperties.Serialization.cs | 145 + ...ownEndpointDeploymentResourceProperties.cs | 31 + ...ndpointResourceProperties.Serialization.cs | 251 ++ .../UnknownEndpointResourceProperties.cs | 43 + .../UnknownExportSummary.Serialization.cs | 217 - .../Generated/Models/UnknownExportSummary.cs | 33 - ...UnknownFineTuningVertical.Serialization.cs | 172 + .../Models/UnknownFineTuningVertical.cs | 41 + .../Models/UnknownInferencingServer.cs | 29 - .../Models/UnknownJobBase.Serialization.cs | 35 - .../src/Generated/Models/UnknownJobBase.cs | 3 +- .../UnknownLabelingJobMediaProperties.cs | 29 - .../Models/UnknownMLAssistConfiguration.cs | 29 - ...nownModelPerformanceMetricThresholdBase.cs | 30 - .../UnknownMonitorComputeIdentityBase.cs | 2 +- ...tNotificationSettingsBase.Serialization.cs | 119 - ...MonitoringAlertNotificationSettingsBase.cs | 29 - ...knownMonitoringSignalBase.Serialization.cs | 32 +- .../Models/UnknownMonitoringSignalBase.cs | 4 +- .../Models/UnknownOnlineDeployment.cs | 2 +- .../UnknownOutboundRule.Serialization.cs | 27 +- .../Generated/Models/UnknownOutboundRule.cs | 3 +- .../Models/UnknownPackageInputPathBase.cs | 29 - .../UnknownTriggerBase.Serialization.cs | 4 +- .../Generated/Models/UnknownTriggerBase.cs | 2 +- ...aceConnectionPropertiesV2.Serialization.cs | 158 +- .../UnknownWorkspaceConnectionPropertiesV2.cs | 13 +- ...paceConnectionAccountKey.Serialization.cs} | 51 +- .../Models/WorkspaceConnectionAccountKey.cs | 65 + ...WorkspaceConnectionOAuth2.Serialization.cs | 220 ++ .../Models/WorkspaceConnectionOAuth2.cs | 108 + ...emPropertiesBasicResource.Serialization.cs | 26 + ...RaiBlocklistItemPropertiesBasicResource.cs | 349 ++ ...stItemPropertiesBasicResourceCollection.cs | 498 +++ ...opertiesBasicResourceData.Serialization.cs | 175 + ...locklistItemPropertiesBasicResourceData.cs | 82 + ...stPropertiesBasicResource.Serialization.cs | 26 + .../RaiBlocklistPropertiesBasicResource.cs | 608 +++ ...cklistPropertiesBasicResourceCollection.cs | 498 +++ ...opertiesBasicResourceData.Serialization.cs | 175 + ...RaiBlocklistPropertiesBasicResourceData.cs | 93 + ...opertiesBasicResourceData.Serialization.cs | 175 + .../RaiPolicyPropertiesBasicResourceData.cs | 85 + .../BatchDeploymentsRestOperations.cs | 2 +- .../BatchEndpointsRestOperations.cs | 2 +- .../CodeContainersRestOperations.cs | 2 +- .../CodeVersionsRestOperations.cs | 112 +- .../ComponentContainersRestOperations.cs | 2 +- .../ComponentVersionsRestOperations.cs | 148 +- .../RestOperations/ComputeRestOperations.cs | 309 +- ...onnectionRaiBlocklistItemRestOperations.cs | 614 +++ ...nnectionRaiBlocklistItemsRestOperations.cs | 241 ++ .../ConnectionRaiBlocklistRestOperations.cs | 358 ++ .../ConnectionRaiBlocklistsRestOperations.cs | 229 ++ .../ConnectionRaiPoliciesRestOperations.cs | 229 ++ .../ConnectionRaiPolicyRestOperations.cs | 358 ++ .../ConnectionRestOperations.cs | 833 ++++ .../DataContainersRestOperations.cs | 2 +- .../DataVersionsRestOperations.cs | 148 +- .../DatastoresRestOperations.cs | 23 +- .../EndpointDeploymentRestOperations.cs | 751 ++++ .../RestOperations/EndpointRestOperations.cs | 871 ++++ .../EnvironmentContainersRestOperations.cs | 2 +- .../EnvironmentVersionsRestOperations.cs | 148 +- .../RestOperations/FeaturesRestOperations.cs | 50 +- .../FeaturesetContainersRestOperations.cs | 2 +- .../FeaturesetVersionsRestOperations.cs | 252 +- ...turestoreEntityContainersRestOperations.cs | 2 +- ...eaturestoreEntityVersionsRestOperations.cs | 2 +- .../RestOperations/JobsRestOperations.cs | 184 +- .../ManagedNetworkProvisionsRestOperations.cs | 6 +- ...anagedNetworkSettingsRuleRestOperations.cs | 22 +- .../MarketplaceSubscriptionsRestOperations.cs | 525 +++ .../ModelContainersRestOperations.cs | 2 +- .../ModelVersionsRestOperations.cs | 84 +- .../OnlineDeploymentsRestOperations.cs | 2 +- .../OnlineEndpointsRestOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 18 +- .../PrivateLinkResourcesRestOperations.cs | 6 +- .../RestOperations/QuotasRestOperations.cs | 2 +- .../RaiPoliciesRestOperations.cs | 229 ++ .../RestOperations/RaiPolicyRestOperations.cs | 358 ++ .../RegistriesRestOperations.cs | 2 +- .../RegistryCodeContainersRestOperations.cs | 2 +- .../RegistryCodeVersionsRestOperations.cs | 2 +- ...gistryComponentContainersRestOperations.cs | 2 +- ...RegistryComponentVersionsRestOperations.cs | 38 +- .../RegistryDataContainersRestOperations.cs | 2 +- .../RegistryDataReferencesRestOperations.cs | 155 + .../RegistryDataVersionsRestOperations.cs | 2 +- ...stryEnvironmentContainersRestOperations.cs | 2 +- ...gistryEnvironmentVersionsRestOperations.cs | 38 +- .../RegistryModelContainersRestOperations.cs | 2 +- .../RegistryModelVersionsRestOperations.cs | 112 +- .../RestOperations/SchedulesRestOperations.cs | 2 +- ...s => ServerlessEndpointsRestOperations.cs} | 412 +- .../RestOperations/UsagesRestOperations.cs | 2 +- .../VirtualMachineSizesRestOperations.cs | 2 +- .../WorkspaceConnectionsRestOperations.cs | 167 +- .../WorkspaceFeaturesRestOperations.cs | 2 +- .../WorkspacesRestOperations.cs | 154 +- .../Generated/ServerlessEndpointCollection.cs | 495 +++ .../ServerlessEndpointData.Serialization.cs | 257 ++ .../src/Generated/ServerlessEndpointData.cs | 97 + ...erverlessEndpointResource.Serialization.cs | 26 + .../Generated/ServerlessEndpointResource.cs | 875 ++++ ...WorkspaceConnectionDeploymentCollection.cs | 493 +++ ...nectionDeploymentResource.Serialization.cs | 26 + .../WorkspaceConnectionDeploymentResource.cs | 348 ++ .../WorkspaceConnectionRaiPolicyCollection.cs | 498 +++ ...nnectionRaiPolicyResource.Serialization.cs | 26 + .../WorkspaceConnectionRaiPolicyResource.cs | 348 ++ .../WorkspaceEndpointDeploymentCollection.cs | 493 +++ ...ndpointDeploymentResource.Serialization.cs | 26 + .../WorkspaceEndpointDeploymentResource.cs | 348 ++ .../WorkspaceEndpointRaiPolicyCollection.cs | 498 +++ ...EndpointRaiPolicyResource.Serialization.cs | 26 + .../WorkspaceEndpointRaiPolicyResource.cs | 348 ++ .../src/autorest.md | 7 +- ...riterImplementationValidation.Exception.cs | 3 +- 907 files changed, 50717 insertions(+), 27567 deletions(-) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResourceCollection.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResourceCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResourceCollection.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/{Sample_MachineLearningLabelingJobCollection.cs => Sample_ServerlessEndpointCollection.cs} (56%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDatastoreResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceConnectionCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/EndpointResourcePropertiesBasicResourceOperationSource.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ExportSummaryOperationSource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/FeaturesetVersionBackfillResponseOperationSource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/IListOperationSource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningEndpointAuthKeysOperationSource.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningFeatureSetJobOperationSource.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningLabelingJobOperationSource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MarketplaceSubscriptionOperationSource.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ModelPackageResultOperationSource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistItemPropertiesBasicResourceOperationSource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistPropertiesBasicResourceOperationSource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ServerlessEndpointOperationSource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionDeploymentOperationSource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionRaiPolicyOperationSource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointDeploymentOperationSource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointRaiPolicyOperationSource.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobCollection.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionCollection.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/{MachineLearningLabelingJobData.Serialization.cs => MarketplaceSubscriptionData.Serialization.cs} (70%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/{MachineLearningLabelingJobData.cs => MarketplaceSubscriptionData.cs} (79%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{PartialJobBase.Serialization.cs => AccountApiKeys.Serialization.cs} (60%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{AutoDeleteSetting.cs => AccountApiKeys.cs} (71%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AllowedContentLevel.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteCondition.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSourceType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetric.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceFrequency.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeWeekDay.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ConnectionGroup.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{UnknownInferencingServer.Serialization.cs => ContentSafety.Serialization.cs} (56%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyStatus.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataAvailabilityStatus.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSourceType.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.Serialization.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{DataImportSource.cs => DataReferenceCredential.cs} (63%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredentialType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DefaultResourceProvisioningState.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DeploymentModelVersionUpgradeOption.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{JobStatusMessage.Serialization.cs => DestinationAsset.Serialization.cs} (54%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{FileSystemSource.Serialization.cs => DockerCredential.Serialization.cs} (59%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{CustomInferencingServer.Serialization.cs => EndpointDeploymentModel.Serialization.cs} (53%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{AutologgerSettings.Serialization.cs => EndpointKeys.Serialization.cs} (56%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{LabelingJobInstructions.cs => EndpointKeys.cs} (71%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.Serialization.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{LabelCategory.cs => EndpointModelSkuRateLimitProperties.cs} (56%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.Serialization.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{LabelClass.cs => EndpointModelSkuRateLimitRulePatternProperties.cs} (65%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{FeaturesetJobArmPaginatedResult.Serialization.cs => EndpointModels.Serialization.cs} (61%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportFormatType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceMode.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{LabelingDataConfiguration.Serialization.cs => FeatureImportanceSettings.Serialization.cs} (59%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{FeaturesetJobArmPaginatedResult.cs => FeatureImportanceSettings.cs} (63%) delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureStoreJobType.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{KerberosKeytabSecrets.Serialization.cs => FeaturesetVersionBackfillResponse.Serialization.cs} (51%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{LabelingJobProperties.Serialization.cs => FineTuningJob.Serialization.cs} (55%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningTaskType.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetric.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetric.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{AzureMLBatchInferencingServer.Serialization.cs => GetBlobReferenceSasRequestDto.Serialization.cs} (56%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{AzureMLOnlineInferencingServer.Serialization.cs => GetBlobReferenceSasResponseDto.Serialization.cs} (56%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageAnnotationType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IncrementalDataRefresh.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServerType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InputPathType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProtectionLevel.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobProvisioningState.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessageLevel.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{SecretConfiguration.Serialization.cs => JupyterKernelConfig.Serialization.cs} (56%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{JobStatusMessage.cs => JupyterKernelConfig.cs} (60%) delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategoryMultiSelect.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogTrainingMetric.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogValidationLoss.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionCollectionGetAllOptions.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureCollectionGetAllOptions.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowAutoLoggerState.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobCollectionGetAllOptions.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPERequirement.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPEStatus.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{GenerationSafetyQualityMetricThreshold.Serialization.cs => ManagedResourceGroupAssignedIdentities.Serialization.cs} (55%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{ModelConfiguration.cs => ManagedResourceGroupAssignedIdentities.cs} (69%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.Serialization.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{MonitoringDataSegment.cs => ManagedResourceGroupSettings.cs} (68%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{LabelClass.Serialization.cs => MarketplacePlan.Serialization.cs} (50%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{MachineLearningAssistConfiguration.cs => MarketplacePlan.cs} (60%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProvisioningState.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{LabelingJobResourceArmPaginatedResult.Serialization.cs => MarketplaceSubscriptionResourceArmPaginatedResult.Serialization.cs} (58%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionStatus.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelLifecycleStatus.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelProvider.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{LabelingJobInstructions.Serialization.cs => ModelSettings.Serialization.cs} (56%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{MonitoringDataSegment.Serialization.cs => MonitorEmailNotificationSettings.Serialization.cs} (54%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{ModelConfiguration.Serialization.cs => MonitorNotificationSettings.Serialization.cs} (53%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{MonitoringAlertNotificationSettingsBase.cs => MonitorNotificationSettings.cs} (59%) delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringModelType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationMode.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{MediaType.cs => MountMode.cs} (51%) delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpLearningRateScheduler.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageBuildState.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputDeliveryMode.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PatchStatus.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{PackageInputPathId.Serialization.cs => RaiBlocklistConfig.Serialization.cs} (59%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{LabelingJobImageProperties.Serialization.cs => RaiBlocklistItemProperties.Serialization.cs} (61%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{UnknownLabelingJobMediaProperties.Serialization.cs => RaiBlocklistProperties.Serialization.cs} (55%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentSource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyMode.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{UnknownMLAssistConfiguration.Serialization.cs => RegenerateServiceAccountKeyContent.Serialization.cs} (58%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetric.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{UnknownPackageInputPathBase.Serialization.cs => ResizeSchema.Serialization.cs} (55%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{TrailingInputData.Serialization.cs => RollingInputData.Serialization.cs} (81%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{TrailingInputData.cs => RollingInputData.cs} (59%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{PackageInputPathUri.Serialization.cs => SasCredential.Serialization.cs} (54%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{AutoDeleteSetting.Serialization.cs => SecretExpiry.Serialization.cs} (54%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{SecretConfiguration.cs => SecretExpiry.cs} (66%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{LabelingJobTextProperties.Serialization.cs => ServerlessComputeSettings.Serialization.cs} (56%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.Serialization.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{MachineLearningJobPatch.cs => ServerlessEndpointCapacityReservation.cs} (52%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.Serialization.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{AutologgerSettings.cs => ServerlessEndpointContentSafety.cs} (60%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{UnknownModelPerformanceMetricThresholdBase.Serialization.cs => ServerlessEndpointInferenceEndpoint.Serialization.cs} (54%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{UnknownBaseEnvironmentSource.Serialization.cs => ServerlessEndpointModelSettings.Serialization.cs} (54%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{LabelingDataConfiguration.cs => ServerlessEndpointModelSettings.cs} (61%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{PackageInputPathVersion.Serialization.cs => ServerlessEndpointPatch.Serialization.cs} (52%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointState.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{LabelingJobResourceArmPaginatedResult.cs => ServerlessEndpointTrackedResourceArmPaginatedResult.cs} (62%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{PartialNotificationSetting.Serialization.cs => ServerlessInferenceEndpoint.Serialization.cs} (52%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpointAuthMode.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{IntellectualProperty.Serialization.cs => ServerlessOffer.Serialization.cs} (55%) rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{IntellectualProperty.cs => ServerlessOffer.cs} (59%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceAccountKeyName.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextAnnotationType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrainingMode.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TriggerType.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{MachineLearningJobPatch.Serialization.cs => UnknownDataReferenceCredential.Serialization.cs} (59%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.Serialization.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.cs delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/{MLAssistConfigurationDisabled.Serialization.cs => WorkspaceConnectionAccountKey.Serialization.cs} (62%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemRestOperations.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemsRestOperations.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistRestOperations.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistsRestOperations.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPoliciesRestOperations.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPolicyRestOperations.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRestOperations.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointDeploymentRestOperations.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointRestOperations.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/MarketplaceSubscriptionsRestOperations.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPoliciesRestOperations.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPolicyRestOperations.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataReferencesRestOperations.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/{LabelingJobsRestOperations.cs => ServerlessEndpointsRestOperations.cs} (69%) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyCollection.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.cs diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/CHANGELOG.md b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/CHANGELOG.md index a5c9cd9ed0302..d7f26d11f25d4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/CHANGELOG.md +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/CHANGELOG.md @@ -1,17 +1,11 @@ # Release History -## 1.2.0-beta.4 (Unreleased) +## 1.2.0 (2024-09-03) ### Features Added - Enable the new model serialization by using the System.ClientModel, refer this [document](https://aka.ms/azsdk/net/mrw) for more details. -### Breaking Changes - -### Bugs Fixed - -### Other Changes - ## 1.2.0-beta.3 (2023-11-29) ### Features Added diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/api/Azure.ResourceManager.MachineLearning.netstandard2.0.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/api/Azure.ResourceManager.MachineLearning.netstandard2.0.cs index f4a7626dafca3..9c01b69f4206f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/api/Azure.ResourceManager.MachineLearning.netstandard2.0.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/api/Azure.ResourceManager.MachineLearning.netstandard2.0.cs @@ -1,5 +1,71 @@ namespace Azure.ResourceManager.MachineLearning { + public partial class EndpointDeploymentResourcePropertiesBasicResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EndpointDeploymentResourcePropertiesBasicResourceData(Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties properties) { } + public Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointResourcePropertiesBasicResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EndpointResourcePropertiesBasicResource() { } + public virtual Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModels(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetModelsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWorkspaceEndpointDeployment(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkspaceEndpointDeploymentAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceEndpointDeploymentCollection GetWorkspaceEndpointDeployments() { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceEndpointRaiPolicyCollection GetWorkspaceEndpointRaiPolicies() { throw null; } + public virtual Azure.Response GetWorkspaceEndpointRaiPolicy(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkspaceEndpointRaiPolicyAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RegenerateKeys(Azure.ResourceManager.MachineLearning.Models.RegenerateServiceAccountKeyContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RegenerateKeysAsync(Azure.ResourceManager.MachineLearning.Models.RegenerateServiceAccountKeyContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EndpointResourcePropertiesBasicResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EndpointResourcePropertiesBasicResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string endpointName, Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string endpointName, Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(Azure.ResourceManager.MachineLearning.Models.EndpointType? endpointType = default(Azure.ResourceManager.MachineLearning.Models.EndpointType?), bool? includeInferenceEndpoints = default(bool?), string skip = null, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(Azure.ResourceManager.MachineLearning.Models.EndpointType? endpointType = default(Azure.ResourceManager.MachineLearning.Models.EndpointType?), bool? includeInferenceEndpoints = default(bool?), string skip = null, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class EndpointResourcePropertiesBasicResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EndpointResourcePropertiesBasicResourceData(Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties properties) { } + public Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class MachineLearningBatchDeploymentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected MachineLearningBatchDeploymentCollection() { } @@ -208,6 +274,8 @@ protected MachineLearningCodeVersionResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Publish(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.DestinationAsset body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task PublishAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.DestinationAsset body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.MachineLearning.MachineLearningCodeVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.MachineLearningCodeVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -273,12 +341,12 @@ protected MachineLearningComponentVersionCollection() { } public virtual Azure.Response Exists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string orderBy = null, int? top = default(int?), string skip = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), string stage = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string orderBy = null, int? top = default(int?), string skip = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.Pageable GetAll(string orderBy, int? top, string skip, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string orderBy = null, int? top = default(int?), string skip = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), string stage = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string orderBy, string skip, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string orderBy = null, int? top = default(int?), string skip = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.AsyncPageable GetAllAsync(string orderBy, int? top, string skip, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string orderBy, string skip, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.NullableResponse GetIfExists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -307,6 +375,8 @@ protected MachineLearningComponentVersionResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Publish(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.DestinationAsset body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task PublishAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.DestinationAsset body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.MachineLearning.MachineLearningComponentVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.MachineLearningComponentVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -354,11 +424,15 @@ protected MachineLearningComputeResource() { } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.MachineLearningUnderlyingResourceAction underlyingResourceAction, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.MachineLearningUnderlyingResourceAction underlyingResourceAction, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAllowedResizeSizes(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllowedResizeSizesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetNodes(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetNodesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Resize(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ResizeSchema resizeSchema, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ResizeAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ResizeSchema resizeSchema, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Restart(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task RestartAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Start(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -374,6 +448,8 @@ protected MachineLearningComputeResource() { } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response UpdateCustomServices(System.Collections.Generic.IEnumerable customServices, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task UpdateCustomServicesAsync(System.Collections.Generic.IEnumerable customServices, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateDataMounts(System.Collections.Generic.IEnumerable dataMounts, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateDataMountsAsync(System.Collections.Generic.IEnumerable dataMounts, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response UpdateIdleShutdownSetting(Azure.ResourceManager.MachineLearning.Models.IdleShutdownSetting idleShutdownSetting, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task UpdateIdleShutdownSettingAsync(Azure.ResourceManager.MachineLearning.Models.IdleShutdownSetting idleShutdownSetting, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -466,7 +542,9 @@ protected MachineLearningDatastoreResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetSecrets(Azure.ResourceManager.MachineLearning.Models.SecretExpiry body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSecretsAsync(Azure.ResourceManager.MachineLearning.Models.SecretExpiry body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.MachineLearning.MachineLearningDatastoreData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -484,12 +562,12 @@ protected MachineLearningDataVersionCollection() { } public virtual Azure.Response Exists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(Azure.ResourceManager.MachineLearning.Models.MachineLearningDataVersionCollectionGetAllOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string orderBy = null, int? top = default(int?), string skip = null, string tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.Pageable GetAll(string orderBy, int? top, string skip, string tags, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(Azure.ResourceManager.MachineLearning.Models.MachineLearningDataVersionCollectionGetAllOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string orderBy, string skip, int? top, string tags, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string orderBy = null, int? top = default(int?), string skip = null, string tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.AsyncPageable GetAllAsync(string orderBy, int? top, string skip, string tags, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string orderBy, string skip, int? top, string tags, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.NullableResponse GetIfExists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -518,6 +596,8 @@ protected MachineLearningDataVersionResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Publish(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.DestinationAsset body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task PublishAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.DestinationAsset body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.MachineLearning.MachineLearningDataVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.MachineLearningDataVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -583,12 +663,12 @@ protected MachineLearningEnvironmentVersionCollection() { } public virtual Azure.Response Exists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string orderBy = null, int? top = default(int?), string skip = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), string stage = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string orderBy = null, int? top = default(int?), string skip = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.Pageable GetAll(string orderBy, int? top, string skip, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string orderBy = null, int? top = default(int?), string skip = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), string stage = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string orderBy, string skip, int? top, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string orderBy = null, int? top = default(int?), string skip = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.AsyncPageable GetAllAsync(string orderBy, int? top, string skip, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string orderBy, string skip, int? top, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.NullableResponse GetIfExists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -617,6 +697,8 @@ protected MachineLearningEnvironmentVersionResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Publish(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.DestinationAsset body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task PublishAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.DestinationAsset body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.MachineLearning.MachineLearningEnvironmentVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.MachineLearningEnvironmentVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -627,6 +709,7 @@ protected MachineLearningEnvironmentVersionResource() { } } public static partial class MachineLearningExtensions { + public static Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResource GetEndpointResourcePropertiesBasicResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningBatchDeploymentResource GetMachineLearningBatchDeploymentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningBatchEndpointResource GetMachineLearningBatchEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningCodeContainerResource GetMachineLearningCodeContainerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -645,7 +728,6 @@ public static partial class MachineLearningExtensions public static Azure.ResourceManager.MachineLearning.MachineLearningFeatureStoreEntityContainerResource GetMachineLearningFeatureStoreEntityContainerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningFeaturestoreEntityVersionResource GetMachineLearningFeaturestoreEntityVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningJobResource GetMachineLearningJobResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobResource GetMachineLearningLabelingJobResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningModelContainerResource GetMachineLearningModelContainerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningModelVersionResource GetMachineLearningModelVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningOnlineDeploymentResource GetMachineLearningOnlineDeploymentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -678,14 +760,22 @@ public static partial class MachineLearningExtensions public static Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionResource GetMachineLearningWorkspaceConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceResource GetMachineLearningWorkspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceCollection GetMachineLearningWorkspaces(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetMachineLearningWorkspaces(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skip = null, string kind = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetMachineLearningWorkspaces(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string kind = null, string skip = null, string aiCapabilities = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Pageable GetMachineLearningWorkspaces(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skip, System.Threading.CancellationToken cancellationToken) { throw null; } - public static Azure.AsyncPageable GetMachineLearningWorkspacesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skip = null, string kind = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetMachineLearningWorkspacesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string kind = null, string skip = null, string aiCapabilities = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.AsyncPageable GetMachineLearningWorkspacesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skip, System.Threading.CancellationToken cancellationToken) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearninRegistryComponentContainerResource GetMachineLearninRegistryComponentContainerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearninRegistryComponentVersionResource GetMachineLearninRegistryComponentVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionResource GetMarketplaceSubscriptionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResource GetRaiBlocklistItemPropertiesBasicResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResource GetRaiBlocklistPropertiesBasicResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.ServerlessEndpointResource GetServerlessEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.WorkspaceConnectionDeploymentResource GetWorkspaceConnectionDeploymentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.WorkspaceConnectionRaiPolicyResource GetWorkspaceConnectionRaiPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.WorkspaceEndpointDeploymentResource GetWorkspaceEndpointDeploymentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.WorkspaceEndpointRaiPolicyResource GetWorkspaceEndpointRaiPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Pageable UpdateMachineLearningQuotas(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable UpdateMachineLearningQuotasAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -695,8 +785,8 @@ protected MachineLearningFeatureCollection() { } public virtual Azure.Response Exists(string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string skip = null, string tags = null, string featureName = null, string description = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string skip = null, string tags = null, string featureName = null, string description = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureCollectionGetAllOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureCollectionGetAllOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.NullableResponse GetIfExists(string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -811,8 +901,8 @@ public partial class MachineLearningFeatureSetVersionResource : Azure.ResourceMa protected MachineLearningFeatureSetVersionResource() { } public virtual Azure.ResourceManager.MachineLearning.MachineLearningFeatureSetVersionData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public virtual Azure.ResourceManager.ArmOperation Backfill(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.FeatureSetVersionBackfillContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> BackfillAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.FeatureSetVersionBackfillContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Backfill(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.FeatureSetVersionBackfillContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> BackfillAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.FeatureSetVersionBackfillContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -821,8 +911,6 @@ protected MachineLearningFeatureSetVersionResource() { } public virtual Azure.Response GetMachineLearningFeature(string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMachineLearningFeatureAsync(string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningFeatureCollection GetMachineLearningFeatures() { throw null; } - public virtual Azure.Pageable GetMaterializationJobs(string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetMaterializationJobsAsync(string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.MachineLearning.MachineLearningFeatureSetVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.MachineLearningFeatureSetVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -934,10 +1022,10 @@ protected MachineLearningJobCollection() { } public virtual Azure.Response Exists(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobCollectionGetAllOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string skip = null, string jobType = null, string tag = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), string properties = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Pageable GetAll(string skip, string jobType, string tag, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobCollectionGetAllOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string skip = null, string jobType = null, string tag = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), string properties = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.AsyncPageable GetAllAsync(string skip, string jobType, string tag, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType, System.Threading.CancellationToken cancellationToken) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -975,65 +1063,11 @@ protected MachineLearningJobResource() { } Azure.ResourceManager.MachineLearning.MachineLearningJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.Response Update(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MachineLearningJobData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MachineLearningJobData data, System.Threading.CancellationToken cancellationToken) { throw null; } } - public partial class MachineLearningLabelingJobCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected MachineLearningLabelingJobCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string id, Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string id, Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string id, bool? includeJobInstructions = default(bool?), bool? includeLabelCategories = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string id, bool? includeJobInstructions = default(bool?), bool? includeLabelCategories = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string id, bool? includeJobInstructions = default(bool?), bool? includeLabelCategories = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string skip = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string skip = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string id, bool? includeJobInstructions = default(bool?), bool? includeLabelCategories = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string id, bool? includeJobInstructions = default(bool?), bool? includeLabelCategories = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string id, bool? includeJobInstructions = default(bool?), bool? includeLabelCategories = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class MachineLearningLabelingJobData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public MachineLearningLabelingJobData(Azure.ResourceManager.MachineLearning.Models.LabelingJobProperties properties) { } - public Azure.ResourceManager.MachineLearning.Models.LabelingJobProperties Properties { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MachineLearningLabelingJobResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected MachineLearningLabelingJobResource() { } - public virtual Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string id) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation ExportLabels(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ExportSummary body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExportLabelsAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ExportSummary body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(bool? includeJobInstructions = default(bool?), bool? includeLabelCategories = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(bool? includeJobInstructions = default(bool?), bool? includeLabelCategories = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Pause(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task PauseAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Resume(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task ResumeAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } public partial class MachineLearningModelContainerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected MachineLearningModelContainerCollection() { } @@ -1123,8 +1157,8 @@ protected MachineLearningModelVersionResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Package(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ModelPackageContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> PackageAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ModelPackageContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Publish(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.DestinationAsset body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task PublishAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.DestinationAsset body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.MachineLearning.MachineLearningModelVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.MachineLearningModelVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1327,7 +1361,7 @@ public MachineLearningPrivateEndpointConnectionData(Azure.Core.AzureLocation loc public Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateLinkServiceConnectionState ConnectionState { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpoint PrivateEndpoint { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningSku Sku { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.MachineLearningPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1461,11 +1495,12 @@ public MachineLearningRegistryData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public string IntellectualPropertyPublisher { get { throw null; } set { } } public string Kind { get { throw null; } set { } } + public System.Collections.Generic.IList ManagedResourceGroupAssignedIdentities { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ManagedResourceId { get { throw null; } set { } } public System.Uri MlFlowRegistryUri { get { throw null; } set { } } - public System.Collections.Generic.IList PrivateEndpointConnections { get { throw null; } set { } } public string PublicNetworkAccess { get { throw null; } set { } } public System.Collections.Generic.IList RegionDetails { get { throw null; } set { } } + public System.Collections.Generic.IList RegistryPrivateEndpointConnections { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningSku Sku { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.MachineLearningRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1597,8 +1632,8 @@ protected MachineLearningRegistryEnvironmentVersionCollection() { } public virtual Azure.Response Exists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string orderBy = null, int? top = default(int?), string skip = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), string stage = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string orderBy = null, int? top = default(int?), string skip = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), string stage = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string orderBy = null, int? top = default(int?), string skip = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string orderBy = null, int? top = default(int?), string skip = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? listViewType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.NullableResponse GetIfExists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1694,8 +1729,6 @@ protected MachineLearningRegistryModelVersionResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Package(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ModelPackageContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> PackageAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ModelPackageContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.MachineLearning.MachineLearningModelVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.MachineLearningModelVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1717,6 +1750,8 @@ protected MachineLearningRegistryResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBlobReferenceSasRegistryDataReference(string name, string version, Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceSasRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBlobReferenceSasRegistryDataReferenceAsync(string name, string version, Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceSasRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetMachineLearningRegistryCodeContainer(string codeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMachineLearningRegistryCodeContainerAsync(string codeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningRegistryCodeContainerCollection GetMachineLearningRegistryCodeContainers() { throw null; } @@ -1800,10 +1835,10 @@ protected MachineLearningWorkspaceCollection() { } public virtual Azure.Response Exists(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string skip = null, string kind = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string kind = null, string skip = null, string aiCapabilities = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Pageable GetAll(string skip, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string skip = null, string kind = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string kind = null, string skip = null, string aiCapabilities = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.AsyncPageable GetAllAsync(string skip, System.Threading.CancellationToken cancellationToken) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1821,8 +1856,10 @@ protected MachineLearningWorkspaceConnectionCollection() { } public virtual Azure.Response Exists(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string target = null, string category = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string target = null, string category = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string target = null, string category = null, bool? includeAll = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string target, string category, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string target = null, string category = null, bool? includeAll = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string target, string category, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.NullableResponse GetIfExists(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1851,13 +1888,26 @@ protected MachineLearningWorkspaceConnectionResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModelsConnections(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetModelsConnectionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetRaiBlocklistPropertiesBasicResource(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRaiBlocklistPropertiesBasicResourceAsync(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceCollection GetRaiBlocklistPropertiesBasicResources() { throw null; } public virtual Azure.Response GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWorkspaceConnectionDeployment(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkspaceConnectionDeploymentAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceConnectionDeploymentCollection GetWorkspaceConnectionDeployments() { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceConnectionRaiPolicyCollection GetWorkspaceConnectionRaiPolicies() { throw null; } + public virtual Azure.Response GetWorkspaceConnectionRaiPolicy(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkspaceConnectionRaiPolicyAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation TestConnection(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task TestConnectionAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Update(Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1869,6 +1919,7 @@ public partial class MachineLearningWorkspaceData : Azure.ResourceManager.Models { public MachineLearningWorkspaceData(Azure.Core.AzureLocation location) { } public bool? AllowPublicAccessWhenBehindVnet { get { throw null; } set { } } + public bool? AllowRoleAssignmentOnRG { get { throw null; } set { } } public string ApplicationInsights { get { throw null; } set { } } public System.Collections.Generic.IList AssociatedWorkspaces { get { throw null; } } public System.Collections.Generic.IList ContainerRegistries { get { throw null; } } @@ -1877,6 +1928,9 @@ public MachineLearningWorkspaceData(Azure.Core.AzureLocation location) { } public string Description { get { throw null; } set { } } public System.Uri DiscoveryUri { get { throw null; } set { } } public bool? EnableDataIsolation { get { throw null; } set { } } + public bool? EnableServiceSideCMKEncryption { get { throw null; } set { } } + public bool? EnableSimplifiedCmk { get { throw null; } set { } } + public bool? EnableSoftwareBillOfMaterials { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningEncryptionSetting Encryption { get { throw null; } set { } } public System.Collections.Generic.IList ExistingWorkspaces { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.FeatureStoreSettings FeatureStoreSettings { get { throw null; } set { } } @@ -1884,6 +1938,7 @@ public MachineLearningWorkspaceData(Azure.Core.AzureLocation location) { } public Azure.Core.ResourceIdentifier HubResourceId { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public string ImageBuildCompute { get { throw null; } set { } } + public System.Collections.Generic.IList IPAllowlist { get { throw null; } } public bool? IsHbiWorkspace { get { throw null; } set { } } public bool? IsStorageHnsEnabled { get { throw null; } } public bool? IsV1LegacyMode { get { throw null; } set { } } @@ -1900,6 +1955,7 @@ public MachineLearningWorkspaceData(Azure.Core.AzureLocation location) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType? PublicNetworkAccessType { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessComputeSettings ServerlessComputeSettings { get { throw null; } set { } } public string ServiceProvisionedResourceGroup { get { throw null; } } public System.Collections.Generic.IList SharedPrivateLinkResources { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningSku Sku { get { throw null; } set { } } @@ -1935,6 +1991,11 @@ protected MachineLearningWorkspaceResource() { } public virtual System.Threading.Tasks.Task> DiagnoseAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceDiagnoseContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetEndpointResourcePropertiesBasicResource(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEndpointResourcePropertiesBasicResourceAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceCollection GetEndpointResourcePropertiesBasicResources() { throw null; } + public virtual Azure.Pageable GetInWorkspaceEndpointDeployments(Azure.ResourceManager.MachineLearning.Models.EndpointType? endpointType = default(Azure.ResourceManager.MachineLearning.Models.EndpointType?), string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetInWorkspaceEndpointDeploymentsAsync(Azure.ResourceManager.MachineLearning.Models.EndpointType? endpointType = default(Azure.ResourceManager.MachineLearning.Models.EndpointType?), string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetMachineLearningBatchEndpoint(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1967,9 +2028,6 @@ protected MachineLearningWorkspaceResource() { } public virtual Azure.Response GetMachineLearningJob(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMachineLearningJobAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningJobCollection GetMachineLearningJobs() { throw null; } - public virtual Azure.Response GetMachineLearningLabelingJob(string id, bool? includeJobInstructions = default(bool?), bool? includeLabelCategories = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetMachineLearningLabelingJobAsync(string id, bool? includeJobInstructions = default(bool?), bool? includeLabelCategories = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobCollection GetMachineLearningLabelingJobs() { throw null; } public virtual Azure.Response GetMachineLearningModelContainer(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMachineLearningModelContainerAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningModelContainerCollection GetMachineLearningModelContainers() { throw null; } @@ -1988,6 +2046,11 @@ protected MachineLearningWorkspaceResource() { } public virtual Azure.Response GetMachineLearningWorkspaceConnection(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMachineLearningWorkspaceConnectionAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionCollection GetMachineLearningWorkspaceConnections() { throw null; } + public virtual Azure.Response GetMarketplaceSubscription(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMarketplaceSubscriptionAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionCollection GetMarketplaceSubscriptions() { throw null; } + public virtual Azure.Pageable GetModelsConnections(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetModelsConnectionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetNotebookAccessToken(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNotebookAccessTokenAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetNotebookKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1996,6 +2059,9 @@ protected MachineLearningWorkspaceResource() { } public virtual Azure.AsyncPageable GetOutboundNetworkDependenciesEndpointsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetPrivateLinkResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetPrivateLinkResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetServerlessEndpoint(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetServerlessEndpointAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.ServerlessEndpointCollection GetServerlessEndpoints() { throw null; } public virtual Azure.Response GetStorageAccountKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetStorageAccountKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetWorkspaceFeatures(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -2065,8 +2131,8 @@ protected MachineLearninRegistryComponentVersionCollection() { } public virtual Azure.Response Exists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string orderBy = null, int? top = default(int?), string skip = null, string stage = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string orderBy = null, int? top = default(int?), string skip = null, string stage = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string orderBy = null, int? top = default(int?), string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string orderBy = null, int? top = default(int?), string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.NullableResponse GetIfExists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -2093,12 +2159,371 @@ protected MachineLearninRegistryComponentVersionResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MachineLearningComponentVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MachineLearningComponentVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class MarketplaceSubscriptionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MarketplaceSubscriptionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MarketplaceSubscriptionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MarketplaceSubscriptionData(Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProperties properties) { } + public Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MarketplaceSubscriptionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MarketplaceSubscriptionResource() { } + public virtual Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string name) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RaiBlocklistItemPropertiesBasicResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RaiBlocklistItemPropertiesBasicResource() { } + public virtual Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RaiBlocklistItemPropertiesBasicResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RaiBlocklistItemPropertiesBasicResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string raiBlocklistItemName, Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string raiBlocklistItemName, Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RaiBlocklistItemPropertiesBasicResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiBlocklistItemPropertiesBasicResourceData(Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemProperties properties) { } + public Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RaiBlocklistPropertiesBasicResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RaiBlocklistPropertiesBasicResource() { } + public virtual Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.ResourceManager.ArmOperation> AddBulkConnectionRaiBlocklistItem(Azure.WaitUntil waitUntil, System.Collections.Generic.IEnumerable content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task>> AddBulkConnectionRaiBlocklistItemAsync(Azure.WaitUntil waitUntil, System.Collections.Generic.IEnumerable content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DeleteBulkConnectionRaiBlocklistItem(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteBulkConnectionRaiBlocklistItemAsync(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetRaiBlocklistItemPropertiesBasicResource(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRaiBlocklistItemPropertiesBasicResourceAsync(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceCollection GetRaiBlocklistItemPropertiesBasicResources() { throw null; } + Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RaiBlocklistPropertiesBasicResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RaiBlocklistPropertiesBasicResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string raiBlocklistName, Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string raiBlocklistName, Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RaiBlocklistPropertiesBasicResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiBlocklistPropertiesBasicResourceData(Azure.ResourceManager.MachineLearning.Models.RaiBlocklistProperties properties) { } + public string RaiBlocklistDescription { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RaiPolicyPropertiesBasicResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiPolicyPropertiesBasicResourceData(Azure.ResourceManager.MachineLearning.Models.RaiPolicyProperties properties) { } + public Azure.ResourceManager.MachineLearning.Models.RaiPolicyProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServerlessEndpointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ServerlessEndpointCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.MachineLearning.ServerlessEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.MachineLearning.ServerlessEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ServerlessEndpointData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServerlessEndpointData(Azure.Core.AzureLocation location, Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointProperties properties) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public string Kind { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningSku Sku { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.ServerlessEndpointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.ServerlessEndpointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServerlessEndpointResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ServerlessEndpointResource() { } + public virtual Azure.ResourceManager.MachineLearning.ServerlessEndpointData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string name) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation RegenerateKeys(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointKeyRegenerateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RegenerateKeysAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointKeyRegenerateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.ServerlessEndpointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.ServerlessEndpointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class WorkspaceConnectionDeploymentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkspaceConnectionDeploymentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkspaceConnectionDeploymentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkspaceConnectionDeploymentResource() { } + public virtual Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class WorkspaceConnectionRaiPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkspaceConnectionRaiPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string raiPolicyName, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string raiPolicyName, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkspaceConnectionRaiPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkspaceConnectionRaiPolicyResource() { } + public virtual Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class WorkspaceEndpointDeploymentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkspaceEndpointDeploymentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkspaceEndpointDeploymentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkspaceEndpointDeploymentResource() { } + public virtual Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class WorkspaceEndpointRaiPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkspaceEndpointRaiPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string raiPolicyName, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string raiPolicyName, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkspaceEndpointRaiPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkspaceEndpointRaiPolicyResource() { } + public virtual Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } } namespace Azure.ResourceManager.MachineLearning.Mocking { public partial class MockableMachineLearningArmClient : Azure.ResourceManager.ArmResource { protected MockableMachineLearningArmClient() { } + public virtual Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResource GetEndpointResourcePropertiesBasicResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningBatchDeploymentResource GetMachineLearningBatchDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningBatchEndpointResource GetMachineLearningBatchEndpointResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningCodeContainerResource GetMachineLearningCodeContainerResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -2117,7 +2542,6 @@ protected MockableMachineLearningArmClient() { } public virtual Azure.ResourceManager.MachineLearning.MachineLearningFeatureStoreEntityContainerResource GetMachineLearningFeatureStoreEntityContainerResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningFeaturestoreEntityVersionResource GetMachineLearningFeaturestoreEntityVersionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningJobResource GetMachineLearningJobResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobResource GetMachineLearningLabelingJobResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningModelContainerResource GetMachineLearningModelContainerResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningModelVersionResource GetMachineLearningModelVersionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningOnlineDeploymentResource GetMachineLearningOnlineDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -2138,6 +2562,14 @@ protected MockableMachineLearningArmClient() { } public virtual Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceResource GetMachineLearningWorkspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearninRegistryComponentContainerResource GetMachineLearninRegistryComponentContainerResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearninRegistryComponentVersionResource GetMachineLearninRegistryComponentVersionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionResource GetMarketplaceSubscriptionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResource GetRaiBlocklistItemPropertiesBasicResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResource GetRaiBlocklistPropertiesBasicResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.ServerlessEndpointResource GetServerlessEndpointResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceConnectionDeploymentResource GetWorkspaceConnectionDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceConnectionRaiPolicyResource GetWorkspaceConnectionRaiPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceEndpointDeploymentResource GetWorkspaceEndpointDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceEndpointRaiPolicyResource GetWorkspaceEndpointRaiPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableMachineLearningResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -2160,10 +2592,10 @@ protected MockableMachineLearningSubscriptionResource() { } public virtual Azure.AsyncPageable GetMachineLearningUsagesAsync(Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetMachineLearningVmSizes(Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetMachineLearningVmSizesAsync(Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetMachineLearningWorkspaces(string skip = null, string kind = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetMachineLearningWorkspaces(string kind = null, string skip = null, string aiCapabilities = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Pageable GetMachineLearningWorkspaces(string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetMachineLearningWorkspacesAsync(string skip = null, string kind = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetMachineLearningWorkspacesAsync(string kind = null, string skip = null, string aiCapabilities = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.AsyncPageable GetMachineLearningWorkspacesAsync(string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable UpdateMachineLearningQuotas(Azure.Core.AzureLocation location, Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -2172,6 +2604,15 @@ protected MockableMachineLearningSubscriptionResource() { } } namespace Azure.ResourceManager.MachineLearning.Models { + public partial class AadAuthTypeWorkspaceConnectionProperties : Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AadAuthTypeWorkspaceConnectionProperties() { } + Azure.ResourceManager.MachineLearning.Models.AadAuthTypeWorkspaceConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.AadAuthTypeWorkspaceConnectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AccessKeyAuthTypeWorkspaceConnectionProperties : Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AccessKeyAuthTypeWorkspaceConnectionProperties() { } @@ -2182,6 +2623,46 @@ public AccessKeyAuthTypeWorkspaceConnectionProperties() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class AccountApiKeys : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AccountApiKeys() { } + public string Key1 { get { throw null; } } + public string Key2 { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.AccountApiKeys System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.AccountApiKeys System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AccountKeyAuthTypeWorkspaceConnectionProperties : Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AccountKeyAuthTypeWorkspaceConnectionProperties() { } + public string CredentialsKey { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.AccountKeyAuthTypeWorkspaceConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.AccountKeyAuthTypeWorkspaceConnectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AllowedContentLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AllowedContentLevel(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel High { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel Low { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel Medium { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel left, Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel left, Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel right) { throw null; } + public override string ToString() { throw null; } + } public partial class AmlCompute : Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AmlCompute() { } @@ -2263,6 +2744,15 @@ public AmlTokenComputeIdentity() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class AnonymousAccessCredential : Azure.ResourceManager.MachineLearning.Models.DataReferenceCredential, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AnonymousAccessCredential() { } + Azure.ResourceManager.MachineLearning.Models.AnonymousAccessCredential System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.AnonymousAccessCredential System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ApiKeyAuthWorkspaceConnectionProperties : Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ApiKeyAuthWorkspaceConnectionProperties() { } @@ -2275,27 +2765,46 @@ public ApiKeyAuthWorkspaceConnectionProperties() { } } public static partial class ArmMachineLearningModelFactory { + public static Azure.ResourceManager.MachineLearning.Models.AadAuthTypeWorkspaceConnectionProperties AadAuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AccessKeyAuthTypeWorkspaceConnectionProperties AccessKeyAuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.MachineLearning.Models.WorkspaceConnectionAccessKey credentials = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AccountApiKeys AccountApiKeys(string key1 = null, string key2 = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AccountKeyAuthTypeWorkspaceConnectionProperties AccountKeyAuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsKey = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.AmlCompute AmlCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.AmlComputeProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.AmlComputeNodeInformation AmlComputeNodeInformation(string nodeId = null, System.Net.IPAddress privateIPAddress = null, System.Net.IPAddress publicIPAddress = null, int? port = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningNodeState? nodeState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningNodeState?), string runId = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.AmlComputeProperties AmlComputeProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningOSType? osType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningOSType?), string vmSize = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningVmPriority? vmPriority = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningVmPriority?), string virtualMachineImageId = null, bool? isolatedNetwork = default(bool?), Azure.ResourceManager.MachineLearning.Models.AmlComputeScaleSettings scaleSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningUserAccountCredentials userAccountCredentials = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningRemoteLoginPortPublicAccess? remoteLoginPortPublicAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningRemoteLoginPortPublicAccess?), Azure.ResourceManager.MachineLearning.Models.MachineLearningAllocationState? allocationState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningAllocationState?), System.DateTimeOffset? allocationStateTransitionOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errors = null, int? currentNodeCount = default(int?), int? targetNodeCount = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningNodeStateCounts nodeStateCounts = null, bool? enableNodePublicIP = default(bool?), System.BinaryData propertyBag = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.AutoMLJob AutoMLJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary secretsConfiguration = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary outputs = null, Azure.ResourceManager.MachineLearning.Models.JobQueueSettings queueSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobResourceConfiguration resources = null, Azure.ResourceManager.MachineLearning.Models.AutoMLVertical taskDetails = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ApiKeyAuthWorkspaceConnectionProperties ApiKeyAuthWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsKey = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AutoMLJob AutoMLJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary outputs = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?), Azure.ResourceManager.MachineLearning.Models.MachineLearningJobResourceConfiguration resources = null, Azure.ResourceManager.MachineLearning.Models.AutoMLVertical taskDetails = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.BlobReferenceForConsumptionDto BlobReferenceForConsumptionDto(System.Uri blobUri = null, Azure.ResourceManager.MachineLearning.Models.PendingUploadCredentialDto credential = null, Azure.Core.ResourceIdentifier storageAccountArmId = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.CocoExportSummary CocoExportSummary(System.DateTimeOffset? endOn = default(System.DateTimeOffset?), long? exportedRowCount = default(long?), string labelingJobId = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), string containerName = null, string snapshotPath = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.CsvExportSummary CsvExportSummary(System.DateTimeOffset? endOn = default(System.DateTimeOffset?), long? exportedRowCount = default(long?), string labelingJobId = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), string containerName = null, string snapshotPath = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.DatasetExportSummary DatasetExportSummary(System.DateTimeOffset? endOn = default(System.DateTimeOffset?), long? exportedRowCount = default(long?), string labelingJobId = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), string labeledAssetName = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.ExportSummary ExportSummary(System.DateTimeOffset? endOn = default(System.DateTimeOffset?), long? exportedRowCount = default(long?), string format = null, string labelingJobId = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?)) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.HdfsDatastore HdfsDatastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, Azure.ResourceManager.MachineLearning.Models.IntellectualProperty intellectualProperty = null, bool? isDefault = default(bool?), string hdfsServerCertificate = null, string nameNodeAddress = null, string protocol = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.ImageMetadata ImageMetadata(string currentImageVersion = null, string latestImageVersion = null, bool? isLatestOSImageVersion = default(bool?)) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.JobStatusMessage JobStatusMessage(string code = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.JobStatusMessageLevel? level = default(Azure.ResourceManager.MachineLearning.Models.JobStatusMessageLevel?), string message = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.LabelingJobProperties LabelingJobProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary secretsConfiguration = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.LabelingDataConfiguration dataConfiguration = null, System.Uri jobInstructionsUri = null, System.Collections.Generic.IDictionary labelCategories = null, Azure.ResourceManager.MachineLearning.Models.LabelingJobMediaProperties labelingJobMediaProperties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningAssistConfiguration mlAssistConfiguration = null, Azure.ResourceManager.MachineLearning.Models.ProgressMetrics progressMetrics = null, System.Guid? projectId = default(System.Guid?), Azure.ResourceManager.MachineLearning.Models.JobProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.JobProvisioningState?), System.Collections.Generic.IEnumerable statusMessages = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ContentSafetyEndpointDeploymentResourceProperties ContentSafetyEndpointDeploymentResourceProperties(string failureReason = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model = null, string raiPolicyName = null, Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? versionUpgradeOption = default(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ContentSafetyEndpointResourceProperties ContentSafetyEndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.CustomKeysWorkspaceConnectionProperties CustomKeysWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), System.Collections.Generic.IDictionary credentialsKeys = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.DockerCredential DockerCredential(string password = null, string userName = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties EndpointDeploymentResourceProperties(string failureReason = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), string endpointDeploymentResourcePropertiesType = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData EndpointDeploymentResourcePropertiesBasicResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointKeys EndpointKeys(Azure.ResourceManager.MachineLearning.Models.AccountApiKeys keys = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelDeprecationProperties EndpointModelDeprecationProperties(System.DateTimeOffset? fineTune = default(System.DateTimeOffset?), System.DateTimeOffset? inference = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelProperties EndpointModelProperties(System.Collections.Generic.IReadOnlyDictionary capabilities = null, Azure.ResourceManager.MachineLearning.Models.EndpointModelDeprecationProperties deprecation = null, System.Collections.Generic.IReadOnlyDictionary finetuneCapabilities = null, string format = null, bool? isDefaultVersion = default(bool?), Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus? lifecycleStatus = default(Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus?), int? maxCapacity = default(int?), string name = null, System.Collections.Generic.IEnumerable skus = null, Azure.ResourceManager.Models.SystemData systemData = null, string version = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuCapacityProperties EndpointModelSkuCapacityProperties(int? @default = default(int?), int? maximum = default(int?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuProperties EndpointModelSkuProperties(Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuCapacityProperties capacity = null, System.Collections.Generic.IEnumerable connectionIds = null, System.DateTimeOffset? deprecationOn = default(System.DateTimeOffset?), string name = null, System.Collections.Generic.IEnumerable rateLimits = null, string usageName = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitProperties EndpointModelSkuRateLimitProperties(float? count = default(float?), float? renewalPeriod = default(float?), System.Collections.Generic.IEnumerable rules = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitRulePatternProperties EndpointModelSkuRateLimitRulePatternProperties(string method = null, string path = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitRuleProperties EndpointModelSkuRateLimitRuleProperties(float? count = default(float?), bool? dynamicThrottlingEnabled = default(bool?), string key = null, System.Collections.Generic.IEnumerable matchPatterns = null, float? minCount = default(float?), float? renewalPeriod = default(float?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties EndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, string endpointType = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData EndpointResourcePropertiesBasicResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.FeaturesetVersionBackfillResponse FeaturesetVersionBackfillResponse(System.Collections.Generic.IEnumerable jobIds = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningJob FineTuningJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), Azure.ResourceManager.MachineLearning.Models.FineTuningVertical fineTuningDetails = null, System.Collections.Generic.IEnumerable resourcesInstanceTypes = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?), System.Collections.Generic.IDictionary outputs = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.FqdnOutboundRule FqdnOutboundRule(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory? category = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory?), System.Collections.Generic.IEnumerable parentRuleNames = null, Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus? status = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus?), string destination = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceForConsumptionDto GetBlobReferenceForConsumptionDto(System.Uri blobUri = null, Azure.ResourceManager.MachineLearning.Models.DataReferenceCredential credential = null, string storageAccountArmId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceSasResponseDto GetBlobReferenceSasResponseDto(Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceForConsumptionDto blobReferenceForConsumption = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ImageMetadata ImageMetadata(string currentImageVersion = null, string latestImageVersion = null, bool? isLatestOSImageVersion = default(bool?), Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus osPatchingStatus = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAksCompute MachineLearningAksCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningAksComputeProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAksComputeProperties MachineLearningAksComputeProperties(string clusterFqdn = null, System.Collections.Generic.IEnumerable systemServices = null, int? agentCount = default(int?), string agentVmSize = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningClusterPurpose? clusterPurpose = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningClusterPurpose?), Azure.ResourceManager.MachineLearning.Models.MachineLearningSslConfiguration sslConfiguration = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningAksNetworkingConfiguration aksNetworkingConfiguration = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningLoadBalancerType? loadBalancerType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningLoadBalancerType?), string loadBalancerSubnet = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAksComputeSecrets MachineLearningAksComputeSecrets(string userKubeConfig = null, string adminKubeConfig = null, string imagePullSecretName = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAssetContainer MachineLearningAssetContainer(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAzureBlobDatastore MachineLearningAzureBlobDatastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, Azure.ResourceManager.MachineLearning.Models.IntellectualProperty intellectualProperty = null, bool? isDefault = default(bool?), string accountName = null, string containerName = null, string endpoint = null, string protocol = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?), string resourceGroup = null, string subscriptionId = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureDataLakeGen1Datastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, Azure.ResourceManager.MachineLearning.Models.IntellectualProperty intellectualProperty = null, bool? isDefault = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?), string storeName = null, string resourceGroup = null, string subscriptionId = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureDataLakeGen2Datastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, Azure.ResourceManager.MachineLearning.Models.IntellectualProperty intellectualProperty = null, bool? isDefault = default(bool?), string accountName = null, string endpoint = null, string filesystem = null, string protocol = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?), string resourceGroup = null, string subscriptionId = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAzureFileDatastore MachineLearningAzureFileDatastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, Azure.ResourceManager.MachineLearning.Models.IntellectualProperty intellectualProperty = null, bool? isDefault = default(bool?), string accountName = null, string endpoint = null, string fileShareName = null, string protocol = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?), string resourceGroup = null, string subscriptionId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAzureBlobDatastore MachineLearningAzureBlobDatastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, bool? isDefault = default(bool?), string accountName = null, string containerName = null, string endpoint = null, string protocol = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?), string resourceGroup = null, string subscriptionId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureDataLakeGen1Datastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, bool? isDefault = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?), string storeName = null, string resourceGroup = null, string subscriptionId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureDataLakeGen2Datastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, bool? isDefault = default(bool?), string accountName = null, string endpoint = null, string filesystem = null, string protocol = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?), string resourceGroup = null, string subscriptionId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAzureFileDatastore MachineLearningAzureFileDatastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, bool? isDefault = default(bool?), string accountName = null, string endpoint = null, string fileShareName = null, string protocol = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?), string resourceGroup = null, string subscriptionId = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningBatchDeploymentData MachineLearningBatchDeploymentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchDeploymentProperties properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchDeploymentProperties MachineLearningBatchDeploymentProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration codeConfiguration = null, string description = null, string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary properties = null, string compute = null, Azure.ResourceManager.MachineLearning.Models.BatchDeploymentConfiguration deploymentConfiguration = null, int? errorThreshold = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchLoggingLevel? loggingLevel = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchLoggingLevel?), int? maxConcurrencyPerInstance = default(int?), long? miniBatchSize = default(long?), Azure.ResourceManager.MachineLearning.Models.MachineLearningAssetReferenceBase model = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchOutputAction? outputAction = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchOutputAction?), string outputFileName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentResourceConfiguration resources = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchRetrySettings retrySettings = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningBatchEndpointData MachineLearningBatchEndpointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchEndpointProperties properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null) { throw null; } @@ -2303,12 +2812,12 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.MachineLearningCodeContainerData MachineLearningCodeContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeContainerProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeContainerProperties MachineLearningCodeContainerProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningCodeVersionData MachineLearningCodeVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeVersionProperties properties = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeVersionProperties MachineLearningCodeVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.Uri codeUri = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningCommandJob MachineLearningCommandJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary secretsConfiguration = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLoggerState? mlflowAutologger = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLoggerState?), Azure.Core.ResourceIdentifier codeId = null, string command = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDistributionConfiguration distribution = null, Azure.Core.ResourceIdentifier environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary inputs = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningCommandJobLimits limits = null, System.Collections.Generic.IDictionary outputs = null, System.BinaryData parameters = null, Azure.ResourceManager.MachineLearning.Models.JobQueueSettings queueSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobResourceConfiguration resources = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeVersionProperties MachineLearningCodeVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.Uri codeUri = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningCommandJob MachineLearningCommandJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), Azure.Core.ResourceIdentifier codeId = null, string command = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDistributionConfiguration distribution = null, Azure.Core.ResourceIdentifier environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary inputs = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningCommandJobLimits limits = null, System.Collections.Generic.IDictionary outputs = null, System.BinaryData parameters = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?), Azure.ResourceManager.MachineLearning.Models.MachineLearningJobResourceConfiguration resources = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningComponentContainerData MachineLearningComponentContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComponentContainerProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComponentContainerProperties MachineLearningComponentContainerProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningComponentVersionData MachineLearningComponentVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComponentVersionProperties properties = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComponentVersionProperties MachineLearningComponentVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.BinaryData componentSpec = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string stage = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComponentVersionProperties MachineLearningComponentVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.BinaryData componentSpec = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningComputeData MachineLearningComputeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstance MachineLearningComputeInstance(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceApplication MachineLearningComputeInstanceApplication(string displayName = null, System.Uri endpointUri = null) { throw null; } @@ -2316,7 +2825,6 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceContainer MachineLearningComputeInstanceContainer(string name = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceAutosave? autosave = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceAutosave?), string gpu = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningNetwork? network = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningNetwork?), Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceEnvironmentInfo environment = null, System.Collections.Generic.IEnumerable services = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceCreatedBy MachineLearningComputeInstanceCreatedBy(string userName = null, string userOrgId = null, string userId = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceDataDisk MachineLearningComputeInstanceDataDisk(Azure.ResourceManager.MachineLearning.Models.MachineLearningCachingType? caching = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningCachingType?), int? diskSizeGB = default(int?), int? lun = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningStorageAccountType? storageAccountType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningStorageAccountType?)) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceDataMount MachineLearningComputeInstanceDataMount(string source = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSourceType? sourceType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningSourceType?), string mountName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningMountAction? mountAction = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningMountAction?), string createdBy = null, string mountPath = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningMountState? mountState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningMountState?), System.DateTimeOffset? mountedOn = default(System.DateTimeOffset?), string error = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceEnvironmentInfo MachineLearningComputeInstanceEnvironmentInfo(string name = null, string version = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceLastOperation MachineLearningComputeInstanceLastOperation(Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName? operationName = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName?), System.DateTimeOffset? operationOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus? operationStatus = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus?), Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationTrigger? operationTrigger = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationTrigger?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceSshSettings MachineLearningComputeInstanceSshSettings(Azure.ResourceManager.MachineLearning.Models.MachineLearningSshPublicAccess? sshPublicAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningSshPublicAccess?), string adminUserName = null, int? sshPort = default(int?), string adminPublicKey = null) { throw null; } @@ -2331,7 +2839,7 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDataFactoryCompute MachineLearningDataFactoryCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDataLakeAnalytics MachineLearningDataLakeAnalytics(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), string dataLakeStoreAccountName = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningDatastoreData MachineLearningDatastoreData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreProperties properties = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreProperties MachineLearningDatastoreProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, string datastoreType = null, Azure.ResourceManager.MachineLearning.Models.IntellectualProperty intellectualProperty = null, bool? isDefault = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreProperties MachineLearningDatastoreProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, string datastoreType = null, bool? isDefault = default(bool?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningDataVersionData MachineLearningDataVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDataVersionProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentLogs MachineLearningDeploymentLogs(string content = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDiagnoseResult MachineLearningDiagnoseResult(string code = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDiagnoseResultLevel? level = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDiagnoseResultLevel?), string message = null) { throw null; } @@ -2342,115 +2850,113 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.MachineLearningEnvironmentContainerData MachineLearningEnvironmentContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentContainerProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentContainerProperties MachineLearningEnvironmentContainerProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningEnvironmentVersionData MachineLearningEnvironmentVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentVersionProperties properties = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentVersionProperties MachineLearningEnvironmentVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.AutoRebuildSetting? autoRebuild = default(Azure.ResourceManager.MachineLearning.Models.AutoRebuildSetting?), Azure.ResourceManager.MachineLearning.Models.MachineLearningBuildContext build = null, string condaFile = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentType? environmentType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentType?), string image = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningInferenceContainerProperties inferenceConfig = null, Azure.ResourceManager.MachineLearning.Models.IntellectualProperty intellectualProperty = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOperatingSystemType? osType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningOperatingSystemType?), Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string stage = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentVersionProperties MachineLearningEnvironmentVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.AutoRebuildSetting? autoRebuild = default(Azure.ResourceManager.MachineLearning.Models.AutoRebuildSetting?), Azure.ResourceManager.MachineLearning.Models.MachineLearningBuildContext build = null, string condaFile = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentType? environmentType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentType?), string image = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningInferenceContainerProperties inferenceConfig = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOperatingSystemType? osType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningOperatingSystemType?), Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string stage = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningError MachineLearningError(Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningEstimatedVmPrice MachineLearningEstimatedVmPrice(double retailPrice = 0, Azure.ResourceManager.MachineLearning.Models.MachineLearningVmPriceOSType osType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningVmPriceOSType), Azure.ResourceManager.MachineLearning.Models.MachineLearningVmTier vmTier = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningVmTier)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningEstimatedVmPrices MachineLearningEstimatedVmPrices(Azure.ResourceManager.MachineLearning.Models.MachineLearningBillingCurrency billingCurrency = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningBillingCurrency), Azure.ResourceManager.MachineLearning.Models.MachineLearningUnitOfMeasure unitOfMeasure = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningUnitOfMeasure), System.Collections.Generic.IEnumerable values = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningFeatureData MachineLearningFeatureData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningFeatureSetContainerData MachineLearningFeatureSetContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetContainerProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetContainerProperties MachineLearningFeatureSetContainerProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetJob MachineLearningFeatureSetJob(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string displayName = null, System.TimeSpan? duration = default(System.TimeSpan?), string experimentId = null, Azure.ResourceManager.MachineLearning.Models.FeatureWindow featureWindow = null, string jobId = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.FeatureStoreJobType? featureStoreJobType = default(Azure.ResourceManager.MachineLearning.Models.FeatureStoreJobType?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningFeatureSetVersionData MachineLearningFeatureSetVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetVersionProperties properties = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetVersionProperties MachineLearningFeatureSetVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.Collections.Generic.IEnumerable entities = null, Azure.ResourceManager.MachineLearning.Models.MaterializationSettings materializationSettings = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string specificationPath = null, string stage = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetVersionProperties MachineLearningFeatureSetVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.Collections.Generic.IEnumerable entities = null, Azure.ResourceManager.MachineLearning.Models.MaterializationSettings materializationSettings = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string specificationPath = null, string stage = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningFeatureStoreEntityContainerData MachineLearningFeatureStoreEntityContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureStoreEntityContainerProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureStoreEntityContainerProperties MachineLearningFeatureStoreEntityContainerProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningFeaturestoreEntityVersionData MachineLearningFeaturestoreEntityVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureStoreEntityVersionProperties properties = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureStoreEntityVersionProperties MachineLearningFeatureStoreEntityVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.Collections.Generic.IEnumerable indexColumns = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string stage = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureStoreEntityVersionProperties MachineLearningFeatureStoreEntityVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.Collections.Generic.IEnumerable indexColumns = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string stage = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFqdnEndpoint MachineLearningFqdnEndpoint(string domainName = null, System.Collections.Generic.IEnumerable endpointDetails = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFqdnEndpointDetail MachineLearningFqdnEndpointDetail(int? port = default(int?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFqdnEndpoints MachineLearningFqdnEndpoints(Azure.ResourceManager.MachineLearning.Models.MachineLearningFqdnEndpointsProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFqdnEndpointsProperties MachineLearningFqdnEndpointsProperties(string category = null, System.Collections.Generic.IEnumerable endpoints = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningHDInsightCompute MachineLearningHDInsightCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningHDInsightProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningJobData MachineLearningJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobProperties properties = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobProperties MachineLearningJobProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), string jobType = null, Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary secretsConfiguration = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobProperties MachineLearningJobProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), string jobType = null, Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobService MachineLearningJobService(string endpoint = null, string errorMessage = null, string jobServiceType = null, Azure.ResourceManager.MachineLearning.Models.JobNodes nodes = null, int? port = default(int?), System.Collections.Generic.IDictionary properties = null, string status = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningKubernetesCompute MachineLearningKubernetesCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningKubernetesProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningKubernetesOnlineDeployment MachineLearningKubernetesOnlineDeployment(Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration codeConfiguration = null, string description = null, string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary properties = null, bool? appInsightsEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.DataCollector dataCollector = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType?), string instanceType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings livenessProbe = null, string model = null, string modelMountPath = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings readinessProbe = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineRequestSettings requestSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineScaleSettings scaleSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningContainerResourceRequirements containerResourceRequirements = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.MachineLearningLabelingJobData MachineLearningLabelingJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.LabelingJobProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningManagedIdentityAuthTypeWorkspaceConnection MachineLearningManagedIdentityAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionManagedIdentity credentials = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningManagedOnlineDeployment MachineLearningManagedOnlineDeployment(Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration codeConfiguration = null, string description = null, string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary properties = null, bool? appInsightsEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.DataCollector dataCollector = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType?), string instanceType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings livenessProbe = null, string model = null, string modelMountPath = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings readinessProbe = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineRequestSettings requestSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineScaleSettings scaleSettings = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningModelContainerData MachineLearningModelContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningModelContainerProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningModelContainerProperties MachineLearningModelContainerProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningModelVersionData MachineLearningModelVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningModelVersionProperties properties = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningModelVersionProperties MachineLearningModelVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.Collections.Generic.IDictionary flavors = null, Azure.ResourceManager.MachineLearning.Models.IntellectualProperty intellectualProperty = null, string jobName = null, string modelType = null, System.Uri modelUri = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string stage = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningModelVersionProperties MachineLearningModelVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.Collections.Generic.IDictionary flavors = null, string jobName = null, string modelType = null, System.Uri modelUri = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string stage = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningNodeStateCounts MachineLearningNodeStateCounts(int? idleNodeCount = default(int?), int? runningNodeCount = default(int?), int? preparingNodeCount = default(int?), int? unusableNodeCount = default(int?), int? leavingNodeCount = default(int?), int? preemptedNodeCount = default(int?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningNoneAuthTypeWorkspaceConnection MachineLearningNoneAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningNotebookPreparationError MachineLearningNotebookPreparationError(string errorMessage = null, int? statusCode = default(int?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningNotebookResourceInfo MachineLearningNotebookResourceInfo(string fqdn = null, bool? isPrivateLinkEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningNotebookPreparationError notebookPreparationError = null, string resourceId = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningOnlineDeploymentData MachineLearningOnlineDeploymentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineDeploymentProperties properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineDeploymentProperties MachineLearningOnlineDeploymentProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration codeConfiguration = null, string description = null, string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary properties = null, bool? appInsightsEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.DataCollector dataCollector = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType?), string endpointComputeType = null, string instanceType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings livenessProbe = null, string model = null, string modelMountPath = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings readinessProbe = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineRequestSettings requestSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineScaleSettings scaleSettings = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningOnlineEndpointData MachineLearningOnlineEndpointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineEndpointProperties properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineEndpointProperties MachineLearningOnlineEndpointProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode authMode = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode), string description = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthKeys keys = null, System.Collections.Generic.IDictionary properties = null, System.Uri scoringUri = null, System.Uri swaggerUri = null, string compute = null, System.Collections.Generic.IDictionary mirrorTraffic = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType? publicNetworkAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType?), System.Collections.Generic.IDictionary traffic = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOutboundRule MachineLearningOutboundRule(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory? category = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory?), System.Collections.Generic.IEnumerable parentRuleNames = null, Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus? status = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus?), string outboundRuleType = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningOutboundRuleBasicData MachineLearningOutboundRuleBasicData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOutboundRule properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningPasswordDetail MachineLearningPasswordDetail(string name = null, string value = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningPipelineJob MachineLearningPipelineJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary secretsConfiguration = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), System.Collections.Generic.IDictionary inputs = null, System.Collections.Generic.IDictionary jobs = null, System.Collections.Generic.IDictionary outputs = null, System.BinaryData settings = null, Azure.Core.ResourceIdentifier sourceJobId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningPatAuthTypeWorkspaceConnection MachineLearningPatAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsPat = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningPipelineJob MachineLearningPipelineJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), System.Collections.Generic.IDictionary inputs = null, System.Collections.Generic.IDictionary jobs = null, System.Collections.Generic.IDictionary outputs = null, System.BinaryData settings = null, Azure.Core.ResourceIdentifier sourceJobId = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpoint MachineLearningPrivateEndpoint(Azure.Core.ResourceIdentifier id = null, Azure.Core.ResourceIdentifier subnetArmId = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningPrivateEndpointConnectionData MachineLearningPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpoint privateEndpoint = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpointConnectionProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateLinkResource MachineLearningPrivateLinkResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.MachineLearningRegistryData MachineLearningRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, System.Uri discoveryUri = null, string intellectualPropertyPublisher = null, Azure.Core.ResourceIdentifier managedResourceId = null, System.Uri mlFlowRegistryUri = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, string publicNetworkAccess = null, System.Collections.Generic.IEnumerable regionDetails = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.MachineLearningRegistryData MachineLearningRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, System.Uri discoveryUri = null, string intellectualPropertyPublisher = null, Azure.Core.ResourceIdentifier managedResourceId = null, System.Collections.Generic.IEnumerable managedResourceGroupAssignedIdentities = null, System.Uri mlFlowRegistryUri = null, System.Collections.Generic.IEnumerable registryPrivateEndpointConnections = null, string publicNetworkAccess = null, System.Collections.Generic.IEnumerable regionDetails = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceName MachineLearningResourceName(string value = null, string localizedValue = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceQuota MachineLearningResourceQuota(string id = null, string amlWorkspaceLocation = null, string resourceQuotaType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceName name = null, long? limit = default(long?), Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUnit? unit = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUnit?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSasAuthTypeWorkspaceConnection MachineLearningSasAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsSas = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningScheduleData MachineLearningScheduleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProperties MachineLearningScheduleProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleAction action = null, string displayName = null, bool? isEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProvisioningStatus? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProvisioningStatus?), Azure.ResourceManager.MachineLearning.Models.MachineLearningTriggerBase trigger = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuCapacity MachineLearningSkuCapacity(int? @default = default(int?), int? maximum = default(int?), int? minimum = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuScaleType? scaleType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuScaleType?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuDetail MachineLearningSkuDetail(Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuCapacity capacity = null, string resourceType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuSetting sku = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuSetting MachineLearningSkuSetting(string name = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuTier? tier = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuTier?)) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSweepJob MachineLearningSweepJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary secretsConfiguration = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEarlyTerminationPolicy earlyTermination = null, System.Collections.Generic.IDictionary inputs = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSweepJobLimits limits = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningObjective objective = null, System.Collections.Generic.IDictionary outputs = null, Azure.ResourceManager.MachineLearning.Models.JobQueueSettings queueSettings = null, Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithm samplingAlgorithm = null, System.BinaryData searchSpace = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTrialComponent trial = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSweepJob MachineLearningSweepJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEarlyTerminationPolicy earlyTermination = null, System.Collections.Generic.IDictionary inputs = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSweepJobLimits limits = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningObjective objective = null, System.Collections.Generic.IDictionary outputs = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?), Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithm samplingAlgorithm = null, System.BinaryData searchSpace = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTrialComponent trial = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSynapseSpark MachineLearningSynapseSpark(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningSynapseSparkProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningUsage MachineLearningUsage(string id = null, string amlWorkspaceLocation = null, string usageType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningUsageUnit? unit = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningUsageUnit?), long? currentValue = default(long?), long? limit = default(long?), Azure.ResourceManager.MachineLearning.Models.MachineLearningUsageName name = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningUsageName MachineLearningUsageName(string value = null, string localizedValue = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningUserFeature MachineLearningUserFeature(string id = null, string displayName = null, string description = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningUsernamePasswordAuthTypeWorkspaceConnection MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionUsernamePassword credentials = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningVirtualMachineCompute MachineLearningVirtualMachineCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningVirtualMachineProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningVirtualMachineSecrets MachineLearningVirtualMachineSecrets(Azure.ResourceManager.MachineLearning.Models.MachineLearningVmSshCredentials administratorAccount = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningVmSize MachineLearningVmSize(string name = null, string family = null, int? vCpus = default(int?), int? gpus = default(int?), int? osVhdSizeMB = default(int?), int? maxResourceVolumeMB = default(int?), double? memoryGB = default(double?), bool? lowPriorityCapable = default(bool?), bool? isPremiumIOSupported = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEstimatedVmPrices estimatedVmPrices = null, System.Collections.Generic.IEnumerable supportedComputeTypes = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionData MachineLearningWorkspaceConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties properties = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceData MachineLearningWorkspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, bool? allowPublicAccessWhenBehindVnet = default(bool?), string applicationInsights = null, System.Collections.Generic.IEnumerable associatedWorkspaces = null, System.Collections.Generic.IEnumerable containerRegistries = null, string containerRegistry = null, string description = null, System.Uri discoveryUri = null, bool? enableDataIsolation = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEncryptionSetting encryption = null, System.Collections.Generic.IEnumerable existingWorkspaces = null, Azure.ResourceManager.MachineLearning.Models.FeatureStoreSettings featureStoreSettings = null, string friendlyName = null, bool? isHbiWorkspace = default(bool?), Azure.Core.ResourceIdentifier hubResourceId = null, string imageBuildCompute = null, string keyVault = null, System.Collections.Generic.IEnumerable keyVaults = null, Azure.ResourceManager.MachineLearning.Models.ManagedNetworkSettings managedNetwork = null, System.Uri mlFlowTrackingUri = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningNotebookResourceInfo notebookInfo = null, string primaryUserAssignedIdentity = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, int? privateLinkCount = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType? publicNetworkAccessType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType?), int? cosmosDbCollectionsThroughput = default(int?), string serviceProvisionedResourceGroup = null, System.Collections.Generic.IEnumerable sharedPrivateLinkResources = null, int? softDeleteRetentionInDays = default(int?), string storageAccount = null, System.Collections.Generic.IEnumerable storageAccounts = null, bool? isStorageHnsEnabled = default(bool?), string systemDatastoresAuthMode = null, System.Guid? tenantId = default(System.Guid?), bool? isV1LegacyMode = default(bool?), Azure.ResourceManager.MachineLearning.Models.WorkspaceHubConfig workspaceHubConfig = null, string workspaceId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties MachineLearningWorkspaceConnectionProperties(string authType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceData MachineLearningWorkspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, bool? allowPublicAccessWhenBehindVnet = default(bool?), bool? allowRoleAssignmentOnRG = default(bool?), string applicationInsights = null, System.Collections.Generic.IEnumerable associatedWorkspaces = null, System.Collections.Generic.IEnumerable containerRegistries = null, string containerRegistry = null, string description = null, System.Uri discoveryUri = null, bool? enableDataIsolation = default(bool?), bool? enableServiceSideCMKEncryption = default(bool?), bool? enableSimplifiedCmk = default(bool?), bool? enableSoftwareBillOfMaterials = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEncryptionSetting encryption = null, System.Collections.Generic.IEnumerable existingWorkspaces = null, Azure.ResourceManager.MachineLearning.Models.FeatureStoreSettings featureStoreSettings = null, string friendlyName = null, bool? isHbiWorkspace = default(bool?), Azure.Core.ResourceIdentifier hubResourceId = null, string imageBuildCompute = null, System.Collections.Generic.IEnumerable ipAllowlist = null, string keyVault = null, System.Collections.Generic.IEnumerable keyVaults = null, Azure.ResourceManager.MachineLearning.Models.ManagedNetworkSettings managedNetwork = null, System.Uri mlFlowTrackingUri = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningNotebookResourceInfo notebookInfo = null, string primaryUserAssignedIdentity = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, int? privateLinkCount = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType? publicNetworkAccessType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType?), Azure.ResourceManager.MachineLearning.Models.ServerlessComputeSettings serverlessComputeSettings = null, int? cosmosDbCollectionsThroughput = default(int?), string serviceProvisionedResourceGroup = null, System.Collections.Generic.IEnumerable sharedPrivateLinkResources = null, int? softDeleteRetentionInDays = default(int?), string storageAccount = null, System.Collections.Generic.IEnumerable storageAccounts = null, bool? isStorageHnsEnabled = default(bool?), string systemDatastoresAuthMode = null, System.Guid? tenantId = default(System.Guid?), bool? isV1LegacyMode = default(bool?), Azure.ResourceManager.MachineLearning.Models.WorkspaceHubConfig workspaceHubConfig = null, string workspaceId = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceDiagnoseResult MachineLearningWorkspaceDiagnoseResult(Azure.ResourceManager.MachineLearning.Models.MachineLearningDiagnoseResultValue value = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceGetKeysResult MachineLearningWorkspaceGetKeysResult(string appInsightsInstrumentationKey = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningContainerRegistryCredentials containerRegistryCredentials = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceGetNotebookKeysResult notebookAccessKeys = null, string userStorageResourceId = null, string userStorageKey = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceGetNotebookKeysResult MachineLearningWorkspaceGetNotebookKeysResult(string primaryAccessKey = null, string secondaryAccessKey = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceGetStorageAccountKeysResult MachineLearningWorkspaceGetStorageAccountKeysResult(string userStorageKey = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceNotebookAccessTokenResult MachineLearningWorkspaceNotebookAccessTokenResult(string accessToken = null, int? expiresIn = default(int?), string hostName = null, string notebookResourceId = null, string publicDns = null, string refreshToken = null, string scope = null, string tokenType = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceQuotaUpdate MachineLearningWorkspaceQuotaUpdate(string id = null, string updateWorkspaceQuotasType = null, long? limit = default(long?), Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUnit? unit = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUnit?), Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceQuotaStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceQuotaStatus?)) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.ManagedNetworkSettings ManagedNetworkSettings(Azure.ResourceManager.MachineLearning.Models.IsolationMode? isolationMode = default(Azure.ResourceManager.MachineLearning.Models.IsolationMode?), string networkId = null, System.Collections.Generic.IDictionary outboundRules = null, Azure.ResourceManager.MachineLearning.Models.ManagedNetworkProvisionStatus status = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.ModelPackageContent ModelPackageContent(Azure.ResourceManager.MachineLearning.Models.BaseEnvironmentSource baseEnvironmentSource = null, System.Collections.Generic.IDictionary environmentVariables = null, Azure.ResourceManager.MachineLearning.Models.InferencingServer inferencingServer = null, System.Collections.Generic.IEnumerable inputs = null, Azure.ResourceManager.MachineLearning.Models.ModelConfiguration modelConfiguration = null, System.Collections.Generic.IDictionary tags = null, string targetEnvironmentId = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.ModelPackageResult ModelPackageResult(Azure.ResourceManager.MachineLearning.Models.BaseEnvironmentSource baseEnvironmentSource = null, string buildId = null, Azure.ResourceManager.MachineLearning.Models.PackageBuildState? buildState = default(Azure.ResourceManager.MachineLearning.Models.PackageBuildState?), System.Collections.Generic.IReadOnlyDictionary environmentVariables = null, Azure.ResourceManager.MachineLearning.Models.InferencingServer inferencingServer = null, System.Collections.Generic.IEnumerable inputs = null, System.Uri logUri = null, Azure.ResourceManager.MachineLearning.Models.ModelConfiguration modelConfiguration = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string targetEnvironmentId = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.OneLakeDatastore OneLakeDatastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, Azure.ResourceManager.MachineLearning.Models.IntellectualProperty intellectualProperty = null, bool? isDefault = default(bool?), Azure.ResourceManager.MachineLearning.Models.OneLakeArtifact artifact = null, string endpoint = null, string oneLakeWorkspaceName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedIdentityCredential ManagedIdentityCredential(string managedIdentityType = null, string userManagedIdentityClientId = null, string userManagedIdentityPrincipalId = null, string userManagedIdentityResourceId = null, string userManagedIdentityTenantId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedNetworkSettings ManagedNetworkSettings(Azure.ResourceManager.MachineLearning.Models.IsolationMode? isolationMode = default(Azure.ResourceManager.MachineLearning.Models.IsolationMode?), string networkId = null, System.Collections.Generic.IDictionary outboundRules = null, Azure.ResourceManager.MachineLearning.Models.ManagedNetworkProvisionStatus status = null, System.Collections.Generic.IEnumerable changeableIsolationModes = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedOnlineEndpointDeploymentResourceProperties ManagedOnlineEndpointDeploymentResourceProperties(string failureReason = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointComputeType? endpointComputeType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointComputeType?), string model = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedOnlineEndpointResourceProperties ManagedOnlineEndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode? authMode = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode?), string compute = null, string description = null, System.Collections.Generic.IDictionary mirrorTraffic = null, System.Uri scoringUri = null, System.Collections.Generic.IDictionary traffic = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedResourceGroupAssignedIdentities ManagedResourceGroupAssignedIdentities(System.Guid? principalId = default(System.Guid?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MarketplacePlan MarketplacePlan(string offerId = null, string planId = null, string publisherId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData MarketplaceSubscriptionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProperties MarketplaceSubscriptionProperties(Azure.ResourceManager.MachineLearning.Models.MarketplacePlan marketplacePlan = null, Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default(Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus?), string modelId = null, Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.OAuth2AuthTypeWorkspaceConnectionProperties OAuth2AuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.MachineLearning.Models.WorkspaceConnectionOAuth2 credentials = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.OneLakeDatastore OneLakeDatastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, bool? isDefault = default(bool?), Azure.ResourceManager.MachineLearning.Models.OneLakeArtifact artifact = null, string endpoint = null, string oneLakeWorkspaceName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointDeploymentResourceProperties OpenAIEndpointDeploymentResourceProperties(string failureReason = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model = null, string raiPolicyName = null, Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? versionUpgradeOption = default(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointResourceProperties OpenAIEndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus OSPatchingStatus(Azure.ResourceManager.MachineLearning.Models.PatchStatus? patchStatus = default(Azure.ResourceManager.MachineLearning.Models.PatchStatus?), System.DateTimeOffset? latestPatchOn = default(System.DateTimeOffset?), bool? rebootPending = default(bool?), System.DateTimeOffset? scheduledRebootOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable osPatchingErrors = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.PendingUploadResponseDto PendingUploadResponseDto(Azure.ResourceManager.MachineLearning.Models.BlobReferenceForConsumptionDto blobReferenceForConsumption = null, string pendingUploadId = null, Azure.ResourceManager.MachineLearning.Models.PendingUploadType? pendingUploadType = default(Azure.ResourceManager.MachineLearning.Models.PendingUploadType?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.PrivateEndpointBase PrivateEndpointBase(Azure.Core.ResourceIdentifier id = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.ProgressMetrics ProgressMetrics(long? completedDatapointCount = default(long?), System.DateTimeOffset? incrementalDataLastRefreshOn = default(System.DateTimeOffset?), long? skippedDatapointCount = default(long?), long? totalDatapointCount = default(long?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.PrivateEndpointOutboundRule PrivateEndpointOutboundRule(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory? category = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory?), System.Collections.Generic.IEnumerable parentRuleNames = null, Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus? status = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus?), Azure.ResourceManager.MachineLearning.Models.PrivateEndpointDestination destination = null, System.Collections.Generic.IEnumerable fqdns = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData RaiBlocklistItemPropertiesBasicResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData RaiBlocklistPropertiesBasicResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string raiBlocklistDescription = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData RaiPolicyPropertiesBasicResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.RaiPolicyProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.RegistryPrivateEndpoint RegistryPrivateEndpoint(Azure.Core.ResourceIdentifier id = null, Azure.Core.ResourceIdentifier subnetArmId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.SasCredential SasCredential(System.Uri sasUri = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.SasCredentialDto SasCredentialDto(System.Uri sasUri = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.ServerlessEndpointData ServerlessEndpointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointProperties properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointInferenceEndpoint ServerlessEndpointInferenceEndpoint(System.Collections.Generic.IReadOnlyDictionary headers = null, System.Uri uri = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointProperties ServerlessEndpointProperties(Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode authMode = default(Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode), Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus? contentSafetyStatus = default(Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus?), Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState? endpointState = default(Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState?), Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpoint inferenceEndpoint = null, string marketplaceSubscriptionId = null, string modelId = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointResourceProperties ServerlessEndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?), Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode? authMode = default(Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode?), Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointCapacityReservation capacityReservation = null, Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus? contentSafetyStatus = default(Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus?), Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState? endpointState = default(Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState?), Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointInferenceEndpoint inferenceEndpoint = null, string marketplaceSubscriptionId = null, System.BinaryData metadata = null, string modelId = null, Azure.ResourceManager.MachineLearning.Models.ServerlessOffer offer = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpoint ServerlessInferenceEndpoint(System.Collections.Generic.IReadOnlyDictionary headers = null, System.Uri uri = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServicePrincipalAuthTypeWorkspaceConnectionProperties ServicePrincipalAuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.MachineLearning.Models.WorkspaceConnectionServicePrincipal credentials = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.ServiceTagDestination ServiceTagDestination(Azure.ResourceManager.MachineLearning.Models.NetworkingRuleAction? action = default(Azure.ResourceManager.MachineLearning.Models.NetworkingRuleAction?), System.Collections.Generic.IEnumerable addressPrefixes = null, string portRanges = null, string protocol = null, string serviceTag = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.SparkJob SparkJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary secretsConfiguration = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), System.Collections.Generic.IEnumerable archives = null, string args = null, string codeId = null, System.Collections.Generic.IDictionary conf = null, Azure.ResourceManager.MachineLearning.Models.SparkJobEntry entry = null, string environmentId = null, System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IDictionary inputs = null, System.Collections.Generic.IEnumerable jars = null, System.Collections.Generic.IDictionary outputs = null, System.Collections.Generic.IEnumerable pyFiles = null, Azure.ResourceManager.MachineLearning.Models.JobQueueSettings queueSettings = null, Azure.ResourceManager.MachineLearning.Models.SparkResourceConfiguration resources = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.TextClassificationMultilabel TextClassificationMultilabel(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity? logVerbosity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity?), string targetColumnName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData = null, Azure.ResourceManager.MachineLearning.Models.ClassificationMultilabelPrimaryMetric? primaryMetric = default(Azure.ResourceManager.MachineLearning.Models.ClassificationMultilabelPrimaryMetric?), string featurizationDatasetLanguage = null, Azure.ResourceManager.MachineLearning.Models.NlpFixedParameters fixedParameters = null, Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings limitSettings = null, System.Collections.Generic.IEnumerable searchSpace = null, Azure.ResourceManager.MachineLearning.Models.NlpSweepSettings sweepSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput validationData = null) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.TextNer TextNer(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity? logVerbosity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity?), string targetColumnName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData = null, Azure.ResourceManager.MachineLearning.Models.ClassificationPrimaryMetric? primaryMetric = default(Azure.ResourceManager.MachineLearning.Models.ClassificationPrimaryMetric?), string featurizationDatasetLanguage = null, Azure.ResourceManager.MachineLearning.Models.NlpFixedParameters fixedParameters = null, Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings limitSettings = null, System.Collections.Generic.IEnumerable searchSpace = null, Azure.ResourceManager.MachineLearning.Models.NlpSweepSettings sweepSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput validationData = null) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct AutoDeleteCondition : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public AutoDeleteCondition(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.AutoDeleteCondition CreatedGreaterThan { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.AutoDeleteCondition LastAccessedGreaterThan { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.AutoDeleteCondition other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.AutoDeleteCondition left, Azure.ResourceManager.MachineLearning.Models.AutoDeleteCondition right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.AutoDeleteCondition (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.AutoDeleteCondition left, Azure.ResourceManager.MachineLearning.Models.AutoDeleteCondition right) { throw null; } - public override string ToString() { throw null; } - } - public partial class AutoDeleteSetting : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public AutoDeleteSetting() { } - public Azure.ResourceManager.MachineLearning.Models.AutoDeleteCondition? Condition { get { throw null; } set { } } - public string Value { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServiceTagOutboundRule ServiceTagOutboundRule(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory? category = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory?), System.Collections.Generic.IEnumerable parentRuleNames = null, Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus? status = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus?), Azure.ResourceManager.MachineLearning.Models.ServiceTagDestination destination = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.SparkJob SparkJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), System.Collections.Generic.IEnumerable archives = null, string args = null, Azure.Core.ResourceIdentifier codeId = null, System.Collections.Generic.IDictionary conf = null, Azure.ResourceManager.MachineLearning.Models.SparkJobEntry entry = null, Azure.Core.ResourceIdentifier environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IDictionary inputs = null, System.Collections.Generic.IEnumerable jars = null, System.Collections.Generic.IDictionary outputs = null, System.Collections.Generic.IEnumerable pyFiles = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?), Azure.ResourceManager.MachineLearning.Models.SparkResourceConfiguration resources = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.SpeechEndpointDeploymentResourceProperties SpeechEndpointDeploymentResourceProperties(string failureReason = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model = null, string raiPolicyName = null, Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? versionUpgradeOption = default(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.SpeechEndpointResourceProperties SpeechEndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.TextClassificationMultilabel TextClassificationMultilabel(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity? logVerbosity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity?), string targetColumnName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData = null, Azure.ResourceManager.MachineLearning.Models.ClassificationMultilabelPrimaryMetric? primaryMetric = default(Azure.ResourceManager.MachineLearning.Models.ClassificationMultilabelPrimaryMetric?), string featurizationDatasetLanguage = null, Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings limitSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput validationData = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.TextNer TextNer(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity? logVerbosity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity?), string targetColumnName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData = null, Azure.ResourceManager.MachineLearning.Models.ClassificationPrimaryMetric? primaryMetric = default(Azure.ResourceManager.MachineLearning.Models.ClassificationPrimaryMetric?), string featurizationDatasetLanguage = null, Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings limitSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput validationData = null) { throw null; } } public partial class AutoForecastHorizon : Azure.ResourceManager.MachineLearning.Models.ForecastHorizon, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -2467,7 +2973,7 @@ public AutoMLJob(Azure.ResourceManager.MachineLearning.Models.AutoMLVertical tas public string EnvironmentId { get { throw null; } set { } } public System.Collections.Generic.IDictionary EnvironmentVariables { get { throw null; } set { } } public System.Collections.Generic.IDictionary Outputs { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.JobQueueSettings QueueSettings { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.JobTier? QueueJobTier { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningJobResourceConfiguration Resources { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.AutoMLVertical TaskDetails { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.AutoMLJob System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2493,12 +2999,9 @@ public partial class AutoMLVerticalRegression : Azure.ResourceManager.MachineLea public AutoMLVerticalRegression(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData) : base (default(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput)) { } public System.Collections.Generic.IList CvSplitColumnNames { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.TableVerticalFeaturizationSettings FeaturizationSettings { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.TableFixedParameters FixedParameters { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.TableVerticalLimitSettings LimitSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.NCrossValidations NCrossValidations { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.AutoMLVerticalRegressionPrimaryMetric? PrimaryMetric { get { throw null; } set { } } - public System.Collections.Generic.IList SearchSpace { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.TableSweepSettings SweepSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput TestData { get { throw null; } set { } } public double? TestDataSize { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.RegressionTrainingSettings TrainingSettings { get { throw null; } set { } } @@ -2611,15 +3114,6 @@ public AutoTargetRollingWindowSize() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AzMonMonitoringAlertNotificationSettings : Azure.ResourceManager.MachineLearning.Models.MonitoringAlertNotificationSettingsBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public AzMonMonitoringAlertNotificationSettings() { } - Azure.ResourceManager.MachineLearning.Models.AzMonMonitoringAlertNotificationSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.AzMonMonitoringAlertNotificationSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class AzureDevOpsWebhook : Azure.ResourceManager.MachineLearning.Models.MachineLearningWebhook, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AzureDevOpsWebhook() { } @@ -2629,25 +3123,27 @@ public AzureDevOpsWebhook() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AzureMLBatchInferencingServer : Azure.ResourceManager.MachineLearning.Models.InferencingServer, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AzureOpenAiFineTuning : Azure.ResourceManager.MachineLearning.Models.FineTuningVertical, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AzureMLBatchInferencingServer() { } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration CodeConfiguration { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.AzureMLBatchInferencingServer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.AzureMLBatchInferencingServer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public AzureOpenAiFineTuning(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType taskType, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput trainingData, Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobInput model) : base (default(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType), default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput), default(Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobInput)) { } + public Azure.ResourceManager.MachineLearning.Models.AzureOpenAiHyperParameters HyperParameters { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.AzureOpenAiFineTuning System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.AzureOpenAiFineTuning System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AzureMLOnlineInferencingServer : Azure.ResourceManager.MachineLearning.Models.InferencingServer, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AzureOpenAiHyperParameters : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AzureMLOnlineInferencingServer() { } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration CodeConfiguration { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.AzureMLOnlineInferencingServer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.AzureMLOnlineInferencingServer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public AzureOpenAiHyperParameters() { } + public int? BatchSize { get { throw null; } set { } } + public double? LearningRateMultiplier { get { throw null; } set { } } + public int? NEpochs { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.AzureOpenAiHyperParameters System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.AzureOpenAiHyperParameters System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class BanditPolicy : Azure.ResourceManager.MachineLearning.Models.MachineLearningEarlyTerminationPolicy, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -2660,25 +3156,6 @@ public BanditPolicy() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public abstract partial class BaseEnvironmentSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - protected BaseEnvironmentSource() { } - Azure.ResourceManager.MachineLearning.Models.BaseEnvironmentSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.BaseEnvironmentSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class BaseEnvironmentType : Azure.ResourceManager.MachineLearning.Models.BaseEnvironmentSource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public BaseEnvironmentType(Azure.Core.ResourceIdentifier resourceId) { } - public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.BaseEnvironmentType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.BaseEnvironmentType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public abstract partial class BatchDeploymentConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected BatchDeploymentConfiguration() { } @@ -2865,35 +3342,6 @@ public CategoricalPredictionDriftMetricThreshold(Azure.ResourceManager.MachineLe public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ClassificationModelPerformanceMetric : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public ClassificationModelPerformanceMetric(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetric Accuracy { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetric Precision { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetric Recall { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetric other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetric left, Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetric right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetric (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetric left, Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetric right) { throw null; } - public override string ToString() { throw null; } - } - public partial class ClassificationModelPerformanceMetricThreshold : Azure.ResourceManager.MachineLearning.Models.ModelPerformanceMetricThresholdBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ClassificationModelPerformanceMetricThreshold(Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetric metric) { } - public Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetric Metric { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetricThreshold System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.ClassificationModelPerformanceMetricThreshold System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ClassificationMultilabelPrimaryMetric : System.IEquatable { private readonly object _dummy; @@ -2941,13 +3389,10 @@ public partial class ClassificationTask : Azure.ResourceManager.MachineLearning. public ClassificationTask(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData) : base (default(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput)) { } public System.Collections.Generic.IList CvSplitColumnNames { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.TableVerticalFeaturizationSettings FeaturizationSettings { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.TableFixedParameters FixedParameters { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.TableVerticalLimitSettings LimitSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.NCrossValidations NCrossValidations { get { throw null; } set { } } public string PositiveLabel { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ClassificationPrimaryMetric? PrimaryMetric { get { throw null; } set { } } - public System.Collections.Generic.IList SearchSpace { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.TableSweepSettings SweepSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput TestData { get { throw null; } set { } } public double? TestDataSize { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ClassificationTrainingSettings TrainingSettings { get { throw null; } set { } } @@ -2971,17 +3416,6 @@ public ClassificationTrainingSettings() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class CocoExportSummary : Azure.ResourceManager.MachineLearning.Models.ExportSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public CocoExportSummary() { } - public string ContainerName { get { throw null; } } - public string SnapshotPath { get { throw null; } } - Azure.ResourceManager.MachineLearning.Models.CocoExportSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.CocoExportSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class ColumnTransformer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ColumnTransformer() { } @@ -2993,6 +3427,40 @@ public ColumnTransformer() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeRecurrenceFrequency : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeRecurrenceFrequency(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceFrequency Day { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceFrequency Hour { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceFrequency Minute { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceFrequency Month { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceFrequency Week { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceFrequency other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceFrequency left, Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceFrequency right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceFrequency (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceFrequency left, Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceFrequency right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeRecurrenceSchedule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeRecurrenceSchedule(System.Collections.Generic.IEnumerable hours, System.Collections.Generic.IEnumerable minutes) { } + public System.Collections.Generic.IList Hours { get { throw null; } } + public System.Collections.Generic.IList Minutes { get { throw null; } } + public System.Collections.Generic.IList MonthDays { get { throw null; } set { } } + public System.Collections.Generic.IList WeekDays { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceSchedule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceSchedule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ComputeStartStopCronSchedule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ComputeStartStopCronSchedule() { } @@ -3008,9 +3476,9 @@ public ComputeStartStopCronSchedule() { } public partial class ComputeStartStopRecurrenceSchedule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ComputeStartStopRecurrenceSchedule() { } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningRecurrenceFrequency? Frequency { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceFrequency? Frequency { get { throw null; } set { } } public int? Interval { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningRecurrenceSchedule Schedule { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ComputeRecurrenceSchedule Schedule { get { throw null; } set { } } public string StartTime { get { throw null; } set { } } public string TimeZone { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.ComputeStartStopRecurrenceSchedule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3020,6 +3488,52 @@ public ComputeStartStopRecurrenceSchedule() { } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeWeekDay : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeWeekDay(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay Friday { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay Monday { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay Saturday { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay Sunday { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay Thursday { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay Tuesday { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay Wednesday { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay left, Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay left, Azure.ResourceManager.MachineLearning.Models.ComputeWeekDay right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectionGroup : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectionGroup(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ConnectionGroup Azure { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ConnectionGroup AzureAI { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ConnectionGroup Database { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ConnectionGroup File { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ConnectionGroup GenericProtocol { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ConnectionGroup NoSQL { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ConnectionGroup ServicesAndApps { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup left, Azure.ResourceManager.MachineLearning.Models.ConnectionGroup right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ConnectionGroup (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup left, Azure.ResourceManager.MachineLearning.Models.ConnectionGroup right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerCommunicationProtocol : System.IEquatable { private readonly object _dummy; @@ -3052,6 +3566,45 @@ public ContainerEndpoint() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContentSafetyEndpointDeploymentResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContentSafetyEndpointDeploymentResourceProperties(Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model) { } + public Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel Model { get { throw null; } set { } } + public string RaiPolicyName { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ContentSafetyEndpointDeploymentResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ContentSafetyEndpointDeploymentResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContentSafetyEndpointResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContentSafetyEndpointResourceProperties() { } + Azure.ResourceManager.MachineLearning.Models.ContentSafetyEndpointResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ContentSafetyEndpointResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContentSafetyStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContentSafetyStatus(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus Disabled { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus left, Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus left, Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class CreateMonitorAction : Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleAction, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CreateMonitorAction(Azure.ResourceManager.MachineLearning.Models.MonitorDefinition monitorDefinition) { } @@ -3072,17 +3625,6 @@ public CronTrigger(string expression) { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class CsvExportSummary : Azure.ResourceManager.MachineLearning.Models.ExportSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public CsvExportSummary() { } - public string ContainerName { get { throw null; } } - public string SnapshotPath { get { throw null; } } - Azure.ResourceManager.MachineLearning.Models.CsvExportSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.CsvExportSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class CustomForecastHorizon : Azure.ResourceManager.MachineLearning.Models.ForecastHorizon, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CustomForecastHorizon(int value) { } @@ -3093,16 +3635,6 @@ public CustomForecastHorizon(int value) { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class CustomInferencingServer : Azure.ResourceManager.MachineLearning.Models.InferencingServer, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public CustomInferencingServer() { } - public Azure.ResourceManager.MachineLearning.Models.OnlineInferenceConfiguration InferenceConfiguration { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.CustomInferencingServer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.CustomInferencingServer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class CustomKeysWorkspaceConnectionProperties : Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CustomKeysWorkspaceConnectionProperties() { } @@ -3124,14 +3656,23 @@ public CustomMetricThreshold(string metric) { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class CustomModelFineTuning : Azure.ResourceManager.MachineLearning.Models.FineTuningVertical, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CustomModelFineTuning(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType taskType, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput trainingData, Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobInput model) : base (default(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType), default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput), default(Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobInput)) { } + public System.Collections.Generic.IDictionary HyperParameters { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.CustomModelFineTuning System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.CustomModelFineTuning System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class CustomMonitoringSignal : Azure.ResourceManager.MachineLearning.Models.MonitoringSignalBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public CustomMonitoringSignal(string componentId, System.Collections.Generic.IEnumerable metricThresholds, Azure.ResourceManager.MachineLearning.Models.MonitoringWorkspaceConnection workspaceConnection) { } + public CustomMonitoringSignal(string componentId, System.Collections.Generic.IEnumerable metricThresholds) { } public string ComponentId { get { throw null; } set { } } public System.Collections.Generic.IDictionary InputAssets { get { throw null; } set { } } public System.Collections.Generic.IDictionary Inputs { get { throw null; } set { } } public System.Collections.Generic.IList MetricThresholds { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MonitoringWorkspaceConnection WorkspaceConnection { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.CustomMonitoringSignal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.CustomMonitoringSignal System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3166,6 +3707,7 @@ public CustomService() { } public System.Collections.Generic.IList Endpoints { get { throw null; } } public System.Collections.Generic.IDictionary EnvironmentVariables { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.ImageSetting Image { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.JupyterKernelConfig Kernel { get { throw null; } set { } } public string Name { get { throw null; } set { } } public System.Collections.Generic.IList Volumes { get { throw null; } } Azure.ResourceManager.MachineLearning.Models.CustomService System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3194,18 +3736,25 @@ public CustomTargetRollingWindowSize(int value) { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DatabaseSource : Azure.ResourceManager.MachineLearning.Models.DataImportSource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataAvailabilityStatus : System.IEquatable { - public DatabaseSource() { } - public string Query { get { throw null; } set { } } - public string StoredProcedure { get { throw null; } set { } } - public System.Collections.Generic.IList> StoredProcedureParams { get { throw null; } set { } } - public string TableName { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.DatabaseSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.DatabaseSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataAvailabilityStatus(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.DataAvailabilityStatus Complete { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DataAvailabilityStatus Incomplete { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DataAvailabilityStatus None { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DataAvailabilityStatus Pending { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.DataAvailabilityStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.DataAvailabilityStatus left, Azure.ResourceManager.MachineLearning.Models.DataAvailabilityStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.DataAvailabilityStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.DataAvailabilityStatus left, Azure.ResourceManager.MachineLearning.Models.DataAvailabilityStatus right) { throw null; } + public override string ToString() { throw null; } } public partial class DataCollectionConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -3263,8 +3812,8 @@ protected DataDriftMetricThresholdBase() { } public partial class DataDriftMonitoringSignal : Azure.ResourceManager.MachineLearning.Models.MonitoringSignalBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DataDriftMonitoringSignal(System.Collections.Generic.IEnumerable metricThresholds, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase productionData, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase referenceData) { } - public Azure.ResourceManager.MachineLearning.Models.MonitoringDataSegment DataSegment { get { throw null; } set { } } public System.Collections.Generic.IDictionary FeatureDataTypeOverride { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.FeatureImportanceSettings FeatureImportanceSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MonitoringFeatureFilterBase Features { get { throw null; } set { } } public System.Collections.Generic.IList MetricThresholds { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase ProductionData { get { throw null; } set { } } @@ -3275,27 +3824,6 @@ public DataDriftMonitoringSignal(System.Collections.Generic.IEnumerable.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DataImport : Azure.ResourceManager.MachineLearning.Models.MachineLearningDataVersionProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DataImport(System.Uri dataUri) : base (default(System.Uri)) { } - public string AssetName { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.DataImportSource Source { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.DataImport System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.DataImport System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public abstract partial class DataImportSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - protected DataImportSource() { } - public string Connection { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.DataImportSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.DataImportSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public abstract partial class DataQualityMetricThresholdBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected DataQualityMetricThresholdBase() { } @@ -3310,6 +3838,7 @@ public partial class DataQualityMonitoringSignal : Azure.ResourceManager.Machine { public DataQualityMonitoringSignal(System.Collections.Generic.IEnumerable metricThresholds, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase productionData, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase referenceData) { } public System.Collections.Generic.IDictionary FeatureDataTypeOverride { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.FeatureImportanceSettings FeatureImportanceSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MonitoringFeatureFilterBase Features { get { throw null; } set { } } public System.Collections.Generic.IList MetricThresholds { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase ProductionData { get { throw null; } set { } } @@ -3320,59 +3849,116 @@ public DataQualityMonitoringSignal(System.Collections.Generic.IEnumerable.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DatasetExportSummary : Azure.ResourceManager.MachineLearning.Models.ExportSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DatasetExportSummary() { } - public string LabeledAssetName { get { throw null; } } - Azure.ResourceManager.MachineLearning.Models.DatasetExportSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.DatasetExportSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DockerSetting : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DockerSetting() { } - public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } - public bool? Privileged { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.DockerSetting System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.DockerSetting System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class EmailMonitoringAlertNotificationSettings : Azure.ResourceManager.MachineLearning.Models.MonitoringAlertNotificationSettingsBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public abstract partial class DataReferenceCredential : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public EmailMonitoringAlertNotificationSettings() { } - public Azure.ResourceManager.MachineLearning.Models.NotificationSetting EmailNotificationSetting { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.EmailMonitoringAlertNotificationSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.EmailMonitoringAlertNotificationSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected DataReferenceCredential() { } + Azure.ResourceManager.MachineLearning.Models.DataReferenceCredential System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.DataReferenceCredential System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EmailNotificationEnableType : System.IEquatable + public readonly partial struct DefaultResourceProvisioningState : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EmailNotificationEnableType(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType JobCancelled { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType JobCompleted { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType JobFailed { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType other) { throw null; } + public DefaultResourceProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Disabled { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState NotStarted { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Scaling { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType left, Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType left, Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType right) { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState left, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState left, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState right) { throw null; } public override string ToString() { throw null; } } - public partial class EncryptionKeyVaultUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DeploymentModelVersionUpgradeOption : System.IEquatable { - public EncryptionKeyVaultUpdateProperties(string keyIdentifier) { } + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DeploymentModelVersionUpgradeOption(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption NoAutoUpgrade { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption OnceCurrentVersionExpired { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption OnceNewDefaultVersionAvailable { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption left, Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption left, Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DestinationAsset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DestinationAsset() { } + public string DestinationName { get { throw null; } set { } } + public string DestinationVersion { get { throw null; } set { } } + public string RegistryName { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.DestinationAsset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.DestinationAsset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DockerCredential : Azure.ResourceManager.MachineLearning.Models.DataReferenceCredential, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DockerCredential() { } + public string Password { get { throw null; } } + public string UserName { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.DockerCredential System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.DockerCredential System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DockerSetting : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DockerSetting() { } + public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } + public bool? Privileged { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.DockerSetting System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.DockerSetting System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EmailNotificationEnableType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EmailNotificationEnableType(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType JobCancelled { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType JobCompleted { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType JobFailed { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType left, Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType left, Azure.ResourceManager.MachineLearning.Models.EmailNotificationEnableType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EncryptionKeyVaultUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EncryptionKeyVaultUpdateProperties(string keyIdentifier) { } public string KeyIdentifier { get { throw null; } } Azure.ResourceManager.MachineLearning.Models.EncryptionKeyVaultUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3391,6 +3977,174 @@ public EncryptionUpdateProperties(string keyIdentifier) { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class EndpointDeploymentModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EndpointDeploymentModel() { } + public string Format { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string Source { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class EndpointDeploymentResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected EndpointDeploymentResourceProperties() { } + public string FailureReason { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? ProvisioningState { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointKeys : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointKeys() { } + public Azure.ResourceManager.MachineLearning.Models.AccountApiKeys Keys { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointKeys System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointKeys System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelDeprecationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelDeprecationProperties() { } + public System.DateTimeOffset? FineTune { get { throw null; } } + public System.DateTimeOffset? Inference { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelDeprecationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelDeprecationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelProperties() { } + public System.Collections.Generic.IReadOnlyDictionary Capabilities { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.EndpointModelDeprecationProperties Deprecation { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary FinetuneCapabilities { get { throw null; } } + public string Format { get { throw null; } } + public bool? IsDefaultVersion { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus? LifecycleStatus { get { throw null; } } + public int? MaxCapacity { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Skus { get { throw null; } } + public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + public string Version { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelSkuCapacityProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelSkuCapacityProperties() { } + public int? Default { get { throw null; } } + public int? Maximum { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuCapacityProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuCapacityProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelSkuProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelSkuProperties() { } + public Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuCapacityProperties Capacity { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ConnectionIds { get { throw null; } } + public System.DateTimeOffset? DeprecationOn { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RateLimits { get { throw null; } } + public string UsageName { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelSkuRateLimitProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelSkuRateLimitProperties() { } + public float? Count { get { throw null; } } + public float? RenewalPeriod { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Rules { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelSkuRateLimitRulePatternProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelSkuRateLimitRulePatternProperties() { } + public string Method { get { throw null; } } + public string Path { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitRulePatternProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitRulePatternProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelSkuRateLimitRuleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelSkuRateLimitRuleProperties() { } + public float? Count { get { throw null; } } + public bool? DynamicThrottlingEnabled { get { throw null; } } + public string Key { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MatchPatterns { get { throw null; } } + public float? MinCount { get { throw null; } } + public float? RenewalPeriod { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitRuleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitRuleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class EndpointResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected EndpointResourceProperties() { } + public Azure.Core.ResourceIdentifier AssociatedResourceId { get { throw null; } set { } } + public System.Collections.Generic.IList Deployments { get { throw null; } } + public System.Uri EndpointUri { get { throw null; } set { } } + public string FailureReason { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? ProvisioningState { get { throw null; } } + public bool? ShouldCreateAiServicesEndpoint { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EndpointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EndpointType(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointType AzureContentSafety { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.EndpointType AzureLlama { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.EndpointType AzureOpenAI { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.EndpointType AzureSpeech { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.EndpointType ManagedOnlineEndpoint { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.EndpointType ServerlessEndpoint { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.EndpointType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.EndpointType left, Azure.ResourceManager.MachineLearning.Models.EndpointType right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.EndpointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.EndpointType left, Azure.ResourceManager.MachineLearning.Models.EndpointType right) { throw null; } + public override string ToString() { throw null; } + } public partial class EnvironmentVariable : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public EnvironmentVariable() { } @@ -3420,22 +4174,11 @@ public EnvironmentVariable() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.EnvironmentVariableType left, Azure.ResourceManager.MachineLearning.Models.EnvironmentVariableType right) { throw null; } public override string ToString() { throw null; } } - public abstract partial class ExportSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - protected ExportSummary() { } - public System.DateTimeOffset? EndOn { get { throw null; } } - public long? ExportedRowCount { get { throw null; } } - public string LabelingJobId { get { throw null; } } - public System.DateTimeOffset? StartOn { get { throw null; } } - Azure.ResourceManager.MachineLearning.Models.ExportSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.ExportSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class FeatureAttributionDriftMonitoringSignal : Azure.ResourceManager.MachineLearning.Models.MonitoringSignalBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public FeatureAttributionDriftMonitoringSignal(Azure.ResourceManager.MachineLearning.Models.FeatureAttributionMetricThreshold metricThreshold, System.Collections.Generic.IEnumerable productionData, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase referenceData) { } + public FeatureAttributionDriftMonitoringSignal(Azure.ResourceManager.MachineLearning.Models.FeatureImportanceSettings featureImportanceSettings, Azure.ResourceManager.MachineLearning.Models.FeatureAttributionMetricThreshold metricThreshold, System.Collections.Generic.IEnumerable productionData, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase referenceData) { } + public System.Collections.Generic.IDictionary FeatureDataTypeOverride { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.FeatureImportanceSettings FeatureImportanceSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.FeatureAttributionMetricThreshold MetricThreshold { get { throw null; } set { } } public System.Collections.Generic.IList ProductionData { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase ReferenceData { get { throw null; } set { } } @@ -3497,12 +4240,44 @@ public FeatureAttributionMetricThreshold(Azure.ResourceManager.MachineLearning.M public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.FeatureDataType left, Azure.ResourceManager.MachineLearning.Models.FeatureDataType right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FeatureImportanceMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FeatureImportanceMode(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.FeatureImportanceMode Disabled { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FeatureImportanceMode Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.FeatureImportanceMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.FeatureImportanceMode left, Azure.ResourceManager.MachineLearning.Models.FeatureImportanceMode right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.FeatureImportanceMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.FeatureImportanceMode left, Azure.ResourceManager.MachineLearning.Models.FeatureImportanceMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class FeatureImportanceSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FeatureImportanceSettings() { } + public Azure.ResourceManager.MachineLearning.Models.FeatureImportanceMode? Mode { get { throw null; } set { } } + public string TargetColumn { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.FeatureImportanceSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.FeatureImportanceSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class FeatureSetVersionBackfillContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public FeatureSetVersionBackfillContent() { } + public System.Collections.Generic.IList DataAvailabilityStatus { get { throw null; } } public string Description { get { throw null; } set { } } public string DisplayName { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.FeatureWindow FeatureWindow { get { throw null; } set { } } + public string JobId { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Properties { get { throw null; } } public string ResourceInstanceType { get { throw null; } set { } } public System.Collections.Generic.IDictionary SparkConfiguration { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } @@ -3512,23 +4287,15 @@ public FeatureSetVersionBackfillContent() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct FeatureStoreJobType : System.IEquatable + public partial class FeaturesetVersionBackfillResponse : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public FeatureStoreJobType(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.FeatureStoreJobType BackfillMaterialization { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.FeatureStoreJobType RecurrentMaterialization { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.FeatureStoreJobType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.FeatureStoreJobType left, Azure.ResourceManager.MachineLearning.Models.FeatureStoreJobType right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.FeatureStoreJobType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.FeatureStoreJobType left, Azure.ResourceManager.MachineLearning.Models.FeatureStoreJobType right) { throw null; } - public override string ToString() { throw null; } + internal FeaturesetVersionBackfillResponse() { } + public System.Collections.Generic.IReadOnlyList JobIds { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.FeaturesetVersionBackfillResponse System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.FeaturesetVersionBackfillResponse System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class FeatureStoreSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -3563,15 +4330,58 @@ public FeatureWindow() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class FileSystemSource : Azure.ResourceManager.MachineLearning.Models.DataImportSource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class FineTuningJob : Azure.ResourceManager.MachineLearning.Models.MachineLearningJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public FileSystemSource() { } - public string Path { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.FileSystemSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.FileSystemSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public FineTuningJob(Azure.ResourceManager.MachineLearning.Models.FineTuningVertical fineTuningDetails, System.Collections.Generic.IDictionary outputs) { } + public Azure.ResourceManager.MachineLearning.Models.FineTuningVertical FineTuningDetails { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Outputs { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.JobTier? QueueJobTier { get { throw null; } set { } } + public System.Collections.Generic.IList ResourcesInstanceTypes { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.FineTuningJob System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.FineTuningJob System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FineTuningTaskType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FineTuningTaskType(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType ChatCompletion { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType ImageClassification { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType ImageInstanceSegmentation { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType ImageObjectDetection { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType QuestionAnswering { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType TextClassification { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType TextCompletion { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType TextSummarization { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType TextTranslation { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType TokenClassification { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType VideoMultiObjectTracking { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType left, Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType left, Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class FineTuningVertical : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected FineTuningVertical(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType taskType, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput trainingData, Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobInput model) { } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobInput Model { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType TaskType { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput TrainingData { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput ValidationData { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.FineTuningVertical System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.FineTuningVertical System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class FixedInputData : Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -3661,7 +4471,6 @@ public ForecastingSettings() { } public string CountryOrRegionForHolidays { get { throw null; } set { } } public int? CvStepSize { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureLag? FeatureLags { get { throw null; } set { } } - public System.Collections.Generic.IList FeaturesUnknownAtForecastTime { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ForecastHorizon ForecastHorizon { get { throw null; } set { } } public string Frequency { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ForecastingSeasonality Seasonality { get { throw null; } set { } } @@ -3699,96 +4508,38 @@ public FqdnOutboundRule() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct GenerationSafetyQualityMetric : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public GenerationSafetyQualityMetric(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric AcceptableCoherenceScorePerInstance { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric AcceptableFluencyScorePerInstance { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric AcceptableGroundednessScorePerInstance { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric AcceptableRelevanceScorePerInstance { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric AcceptableSimilarityScorePerInstance { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric AggregatedCoherencePassRate { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric AggregatedFluencyPassRate { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric AggregatedGroundednessPassRate { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric AggregatedRelevancePassRate { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric AggregatedSimilarityPassRate { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric left, Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric left, Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric right) { throw null; } - public override string ToString() { throw null; } - } - public partial class GenerationSafetyQualityMetricThreshold : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public GenerationSafetyQualityMetricThreshold(Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric metric) { } - public Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetric Metric { get { throw null; } set { } } - public double? ThresholdValue { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetricThreshold System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMetricThreshold System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class GenerationSafetyQualityMonitoringSignal : Azure.ResourceManager.MachineLearning.Models.MonitoringSignalBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public GenerationSafetyQualityMonitoringSignal(System.Collections.Generic.IEnumerable metricThresholds, double samplingRate) { } - public System.Collections.Generic.IList MetricThresholds { get { throw null; } } - public System.Collections.Generic.IList ProductionData { get { throw null; } set { } } - public double SamplingRate { get { throw null; } set { } } - public string WorkspaceConnectionId { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMonitoringSignal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.GenerationSafetyQualityMonitoringSignal System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct GenerationTokenStatisticsMetric : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public GenerationTokenStatisticsMetric(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsMetric TotalTokenCount { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsMetric TotalTokenCountPerGroup { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsMetric other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsMetric left, Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsMetric right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsMetric (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsMetric left, Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsMetric right) { throw null; } - public override string ToString() { throw null; } - } - public partial class GenerationTokenStatisticsMetricThreshold : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public GenerationTokenStatisticsMetricThreshold(Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsMetric metric) { } - public Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsMetric Metric { get { throw null; } set { } } - public double? ThresholdValue { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsMetricThreshold System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsMetricThreshold System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class GenerationTokenStatisticsSignal : Azure.ResourceManager.MachineLearning.Models.MonitoringSignalBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class GetBlobReferenceForConsumptionDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public GenerationTokenStatisticsSignal(System.Collections.Generic.IEnumerable metricThresholds, double samplingRate) { } - public System.Collections.Generic.IList MetricThresholds { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase ProductionData { get { throw null; } set { } } - public double SamplingRate { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsSignal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.GenerationTokenStatisticsSignal System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + internal GetBlobReferenceForConsumptionDto() { } + public System.Uri BlobUri { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.DataReferenceCredential Credential { get { throw null; } } + public string StorageAccountArmId { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceForConsumptionDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceForConsumptionDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GetBlobReferenceSasRequestDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GetBlobReferenceSasRequestDto() { } + public string AssetId { get { throw null; } set { } } + public System.Uri BlobUri { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceSasRequestDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceSasRequestDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GetBlobReferenceSasResponseDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal GetBlobReferenceSasResponseDto() { } + public Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceForConsumptionDto BlobReferenceForConsumption { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceSasResponseDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceSasResponseDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class GridSamplingAlgorithm : Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithm, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -3799,18 +4550,6 @@ public GridSamplingAlgorithm() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class HdfsDatastore : Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public HdfsDatastore(Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials, string nameNodeAddress) : base (default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials)) { } - public string HdfsServerCertificate { get { throw null; } set { } } - public string NameNodeAddress { get { throw null; } set { } } - public string Protocol { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.HdfsDatastore System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.HdfsDatastore System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class IdleShutdownSetting : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public IdleShutdownSetting() { } @@ -3821,25 +4560,6 @@ public IdleShutdownSetting() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ImageAnnotationType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public ImageAnnotationType(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.ImageAnnotationType BoundingBox { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.ImageAnnotationType Classification { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.ImageAnnotationType InstanceSegmentation { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.ImageAnnotationType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ImageAnnotationType left, Azure.ResourceManager.MachineLearning.Models.ImageAnnotationType right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.ImageAnnotationType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ImageAnnotationType left, Azure.ResourceManager.MachineLearning.Models.ImageAnnotationType right) { throw null; } - public override string ToString() { throw null; } - } public partial class ImageClassification : Azure.ResourceManager.MachineLearning.Models.AutoMLVertical, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ImageClassification(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData, Azure.ResourceManager.MachineLearning.Models.ImageLimitSettings limitSettings) : base (default(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput)) { } @@ -3906,6 +4626,7 @@ internal ImageMetadata() { } public string CurrentImageVersion { get { throw null; } } public bool? IsLatestOSImageVersion { get { throw null; } } public string LatestImageVersion { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus OSPatchingStatus { get { throw null; } } Azure.ResourceManager.MachineLearning.Models.ImageMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.ImageMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4044,8 +4765,6 @@ public ImageModelSettingsObjectDetection() { } public int? BoxDetectionsPerImage { get { throw null; } set { } } public float? BoxScoreThreshold { get { throw null; } set { } } public int? ImageSize { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.LogTrainingMetric? LogTrainingMetrics { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.LogValidationLoss? LogValidationLoss { get { throw null; } set { } } public int? MaxSize { get { throw null; } set { } } public int? MinSize { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningModelSize? ModelSize { get { throw null; } set { } } @@ -4084,6 +4803,7 @@ public ImageSetting() { } public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.ImageType? ImageType { get { throw null; } set { } } public string Reference { get { throw null; } set { } } + public string Version { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.ImageSetting System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.ImageSetting System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4119,34 +4839,6 @@ public ImageSweepSettings(Azure.ResourceManager.MachineLearning.Models.SamplingA public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ImageType left, Azure.ResourceManager.MachineLearning.Models.ImageType right) { throw null; } public override string ToString() { throw null; } } - public partial class ImportDataAction : Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleAction, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ImportDataAction(Azure.ResourceManager.MachineLearning.Models.DataImport dataImportDefinition) { } - public Azure.ResourceManager.MachineLearning.Models.DataImport DataImportDefinition { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.ImportDataAction System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.ImportDataAction System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct IncrementalDataRefresh : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public IncrementalDataRefresh(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.IncrementalDataRefresh Disabled { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.IncrementalDataRefresh Enabled { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.IncrementalDataRefresh other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.IncrementalDataRefresh left, Azure.ResourceManager.MachineLearning.Models.IncrementalDataRefresh right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.IncrementalDataRefresh (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.IncrementalDataRefresh left, Azure.ResourceManager.MachineLearning.Models.IncrementalDataRefresh right) { throw null; } - public override string ToString() { throw null; } - } public partial class IndexColumn : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public IndexColumn() { } @@ -4158,15 +4850,6 @@ public IndexColumn() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public abstract partial class InferencingServer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - protected InferencingServer() { } - Azure.ResourceManager.MachineLearning.Models.InferencingServer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.InferencingServer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct InstanceSegmentationPrimaryMetric : System.IEquatable { @@ -4184,35 +4867,6 @@ protected InferencingServer() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.InstanceSegmentationPrimaryMetric left, Azure.ResourceManager.MachineLearning.Models.InstanceSegmentationPrimaryMetric right) { throw null; } public override string ToString() { throw null; } } - public partial class IntellectualProperty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public IntellectualProperty(string publisher) { } - public Azure.ResourceManager.MachineLearning.Models.IntellectualProtectionLevel? ProtectionLevel { get { throw null; } set { } } - public string Publisher { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.IntellectualProperty System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.IntellectualProperty System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct IntellectualProtectionLevel : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public IntellectualProtectionLevel(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.IntellectualProtectionLevel All { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.IntellectualProtectionLevel None { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.IntellectualProtectionLevel other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.IntellectualProtectionLevel left, Azure.ResourceManager.MachineLearning.Models.IntellectualProtectionLevel right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.IntellectualProtectionLevel (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.IntellectualProtectionLevel left, Azure.ResourceManager.MachineLearning.Models.IntellectualProtectionLevel right) { throw null; } - public override string ToString() { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct IsolationMode : System.IEquatable { @@ -4274,69 +4928,6 @@ protected JobNodes() { } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct JobProvisioningState : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public JobProvisioningState(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.JobProvisioningState Canceled { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.JobProvisioningState Failed { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.JobProvisioningState InProgress { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.JobProvisioningState Succeeded { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.JobProvisioningState other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.JobProvisioningState left, Azure.ResourceManager.MachineLearning.Models.JobProvisioningState right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.JobProvisioningState (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.JobProvisioningState left, Azure.ResourceManager.MachineLearning.Models.JobProvisioningState right) { throw null; } - public override string ToString() { throw null; } - } - public partial class JobQueueSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public JobQueueSettings() { } - public Azure.ResourceManager.MachineLearning.Models.JobTier? JobTier { get { throw null; } set { } } - public int? Priority { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.JobQueueSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.JobQueueSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class JobStatusMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal JobStatusMessage() { } - public string Code { get { throw null; } } - public System.DateTimeOffset? CreatedOn { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.JobStatusMessageLevel? Level { get { throw null; } } - public string Message { get { throw null; } } - Azure.ResourceManager.MachineLearning.Models.JobStatusMessage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.JobStatusMessage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct JobStatusMessageLevel : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public JobStatusMessageLevel(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.JobStatusMessageLevel Error { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.JobStatusMessageLevel Information { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.JobStatusMessageLevel Warning { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.JobStatusMessageLevel other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.JobStatusMessageLevel left, Azure.ResourceManager.MachineLearning.Models.JobStatusMessageLevel right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.JobStatusMessageLevel (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.JobStatusMessageLevel left, Azure.ResourceManager.MachineLearning.Models.JobStatusMessageLevel right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct JobTier : System.IEquatable { private readonly object _dummy; @@ -4357,151 +4948,17 @@ internal JobStatusMessage() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.JobTier left, Azure.ResourceManager.MachineLearning.Models.JobTier right) { throw null; } public override string ToString() { throw null; } } - public partial class KerberosKeytabCredentials : Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public KerberosKeytabCredentials(Azure.ResourceManager.MachineLearning.Models.KerberosKeytabSecrets secrets, string kerberosKdcAddress, string kerberosPrincipal, string kerberosRealm) { } - public string KerberosKdcAddress { get { throw null; } set { } } - public string KerberosPrincipal { get { throw null; } set { } } - public string KerberosRealm { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.KerberosKeytabSecrets Secrets { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.KerberosKeytabCredentials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.KerberosKeytabCredentials System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class KerberosKeytabSecrets : Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreSecrets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public KerberosKeytabSecrets() { } - public string KerberosKeytab { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.KerberosKeytabSecrets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.KerberosKeytabSecrets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class KerberosPasswordCredentials : Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public KerberosPasswordCredentials(Azure.ResourceManager.MachineLearning.Models.KerberosPasswordSecrets secrets, string kerberosKdcAddress, string kerberosPrincipal, string kerberosRealm) { } - public string KerberosKdcAddress { get { throw null; } set { } } - public string KerberosPrincipal { get { throw null; } set { } } - public string KerberosRealm { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.KerberosPasswordSecrets Secrets { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.KerberosPasswordCredentials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.KerberosPasswordCredentials System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class KerberosPasswordSecrets : Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreSecrets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public KerberosPasswordSecrets() { } - public string KerberosPassword { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.KerberosPasswordSecrets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.KerberosPasswordSecrets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class LabelCategory : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public LabelCategory() { } - public System.Collections.Generic.IDictionary Classes { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.LabelCategoryMultiSelect? MultiSelect { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.LabelCategory System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.LabelCategory System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct LabelCategoryMultiSelect : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public LabelCategoryMultiSelect(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.LabelCategoryMultiSelect Disabled { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.LabelCategoryMultiSelect Enabled { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.LabelCategoryMultiSelect other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.LabelCategoryMultiSelect left, Azure.ResourceManager.MachineLearning.Models.LabelCategoryMultiSelect right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.LabelCategoryMultiSelect (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.LabelCategoryMultiSelect left, Azure.ResourceManager.MachineLearning.Models.LabelCategoryMultiSelect right) { throw null; } - public override string ToString() { throw null; } - } - public partial class LabelClass : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class JupyterKernelConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public LabelClass() { } + public JupyterKernelConfig() { } + public System.Collections.Generic.IList Argv { get { throw null; } } public string DisplayName { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Subclasses { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.LabelClass System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.LabelClass System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class LabelingDataConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public LabelingDataConfiguration() { } - public string DataId { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.IncrementalDataRefresh? IncrementalDataRefresh { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.LabelingDataConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.LabelingDataConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class LabelingJobImageProperties : Azure.ResourceManager.MachineLearning.Models.LabelingJobMediaProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public LabelingJobImageProperties() { } - public Azure.ResourceManager.MachineLearning.Models.ImageAnnotationType? AnnotationType { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.LabelingJobImageProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.LabelingJobImageProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public abstract partial class LabelingJobMediaProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - protected LabelingJobMediaProperties() { } - Azure.ResourceManager.MachineLearning.Models.LabelingJobMediaProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.LabelingJobMediaProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class LabelingJobProperties : Azure.ResourceManager.MachineLearning.Models.MachineLearningJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public LabelingJobProperties() { } - public System.DateTimeOffset? CreatedOn { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.LabelingDataConfiguration DataConfiguration { get { throw null; } set { } } - public System.Uri JobInstructionsUri { get { throw null; } set { } } - public System.Collections.Generic.IDictionary LabelCategories { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.LabelingJobMediaProperties LabelingJobMediaProperties { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningAssistConfiguration MlAssistConfiguration { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.ProgressMetrics ProgressMetrics { get { throw null; } } - public System.Guid? ProjectId { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.JobProvisioningState? ProvisioningState { get { throw null; } } - public System.Collections.Generic.IReadOnlyList StatusMessages { get { throw null; } } - Azure.ResourceManager.MachineLearning.Models.LabelingJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.LabelingJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class LabelingJobTextProperties : Azure.ResourceManager.MachineLearning.Models.LabelingJobMediaProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public LabelingJobTextProperties() { } - public Azure.ResourceManager.MachineLearning.Models.TextAnnotationType? AnnotationType { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.LabelingJobTextProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.LabelingJobTextProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public string Language { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.JupyterKernelConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.JupyterKernelConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class LakeHouseArtifact : Azure.ResourceManager.MachineLearning.Models.OneLakeArtifact, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -4531,42 +4988,6 @@ public LakeHouseArtifact(string artifactName) : base (default(string)) { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.LearningRateScheduler left, Azure.ResourceManager.MachineLearning.Models.LearningRateScheduler right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct LogTrainingMetric : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public LogTrainingMetric(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.LogTrainingMetric Disable { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.LogTrainingMetric Enable { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.LogTrainingMetric other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.LogTrainingMetric left, Azure.ResourceManager.MachineLearning.Models.LogTrainingMetric right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.LogTrainingMetric (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.LogTrainingMetric left, Azure.ResourceManager.MachineLearning.Models.LogTrainingMetric right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct LogValidationLoss : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public LogValidationLoss(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.LogValidationLoss Disable { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.LogValidationLoss Enable { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.LogValidationLoss other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.LogValidationLoss left, Azure.ResourceManager.MachineLearning.Models.LogValidationLoss right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.LogValidationLoss (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.LogValidationLoss left, Azure.ResourceManager.MachineLearning.Models.LogValidationLoss right) { throw null; } - public override string ToString() { throw null; } - } public partial class MachineLearningAccountKeyDatastoreCredentials : Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningAccountKeyDatastoreCredentials(Azure.ResourceManager.MachineLearning.Models.MachineLearningAccountKeyDatastoreSecrets secrets) { } @@ -4688,7 +5109,6 @@ public MachineLearningAllFeatures() { } public partial class MachineLearningAssetBase : Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningAssetBase() { } - public Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting AutoDeleteSetting { get { throw null; } set { } } public bool? IsAnonymous { get { throw null; } set { } } public bool? IsArchived { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningAssetBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4718,26 +5138,6 @@ protected MachineLearningAssetReferenceBase() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public abstract partial class MachineLearningAssistConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - protected MachineLearningAssistConfiguration() { } - Azure.ResourceManager.MachineLearning.Models.MachineLearningAssistConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.MachineLearningAssistConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MachineLearningAssistEnabledConfiguration : Azure.ResourceManager.MachineLearning.Models.MachineLearningAssistConfiguration, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public MachineLearningAssistEnabledConfiguration(string inferencingComputeBinding, string trainingComputeBinding) { } - public string InferencingComputeBinding { get { throw null; } set { } } - public string TrainingComputeBinding { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.MachineLearningAssistEnabledConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.MachineLearningAssistEnabledConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class MachineLearningAutoPauseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningAutoPauseProperties() { } @@ -5046,10 +5446,9 @@ public MachineLearningCommandJob(string command, Azure.Core.ResourceIdentifier e public System.Collections.Generic.IDictionary EnvironmentVariables { get { throw null; } set { } } public System.Collections.Generic.IDictionary Inputs { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningCommandJobLimits Limits { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLoggerState? MlflowAutologger { get { throw null; } set { } } public System.Collections.Generic.IDictionary Outputs { get { throw null; } set { } } public System.BinaryData Parameters { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.JobQueueSettings QueueSettings { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.JobTier? QueueJobTier { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningJobResourceConfiguration Resources { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningCommandJob System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -5081,7 +5480,6 @@ public partial class MachineLearningComponentVersionProperties : Azure.ResourceM public MachineLearningComponentVersionProperties() { } public System.BinaryData ComponentSpec { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? ProvisioningState { get { throw null; } } - public string Stage { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningComponentVersionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.MachineLearningComponentVersionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5209,16 +5607,17 @@ internal MachineLearningComputeInstanceDataDisk() { } } public partial class MachineLearningComputeInstanceDataMount : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal MachineLearningComputeInstanceDataMount() { } - public string CreatedBy { get { throw null; } } - public string Error { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningMountAction? MountAction { get { throw null; } } - public System.DateTimeOffset? MountedOn { get { throw null; } } - public string MountName { get { throw null; } } - public string MountPath { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningMountState? MountState { get { throw null; } } - public string Source { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningSourceType? SourceType { get { throw null; } } + public MachineLearningComputeInstanceDataMount() { } + public string CreatedBy { get { throw null; } set { } } + public string Error { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningMountAction? MountAction { get { throw null; } set { } } + public System.DateTimeOffset? MountedOn { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MountMode? MountMode { get { throw null; } set { } } + public string MountName { get { throw null; } set { } } + public string MountPath { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningMountState? MountState { get { throw null; } set { } } + public string Source { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningSourceType? SourceType { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceDataMount System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceDataMount System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5262,12 +5661,16 @@ public MachineLearningComputeInstanceProperties() { } public System.Collections.Generic.IReadOnlyList DataDisks { get { throw null; } } public System.Collections.Generic.IReadOnlyList DataMounts { get { throw null; } } public bool? EnableNodePublicIP { get { throw null; } set { } } + public bool? EnableOSPatching { get { throw null; } set { } } + public bool? EnableRootAccess { get { throw null; } set { } } + public bool? EnableSso { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } public string IdleTimeBeforeShutdown { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceLastOperation LastOperation { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLogger? MlflowAutologger { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ImageMetadata OSImageMetadata { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceAssignedUser PersonalComputeInstanceAssignedUser { get { throw null; } set { } } + public bool? ReleaseQuotaOnStop { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList SchedulesComputeStartStop { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningScriptsToExecute Scripts { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceSshSettings SshSettings { get { throw null; } set { } } @@ -5304,6 +5707,7 @@ public MachineLearningComputeInstanceSshSettings() { } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState Creating { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState Deleting { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState JobRunning { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState Resizing { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState Restarting { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState Running { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState SettingUp { get { throw null; } } @@ -5439,21 +5843,107 @@ internal MachineLearningComputeSystemService() { } private readonly int _dummyPrimitive; public MachineLearningConnectionCategory(string value) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AdlsGen2 { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AIServices { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AmazonMws { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AmazonRdsForOracle { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AmazonRdsForSqlServer { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AmazonRedshift { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AmazonS3Compatible { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory ApiKey { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AzureBlob { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AzureDatabricksDeltaLake { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AzureDataExplorer { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AzureMariaDb { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AzureMySqlDB { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AzureOneLake { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AzureOpenAI { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AzurePostgresDB { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AzureSqlDB { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AzureSqlMi { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AzureSynapseAnalytics { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory AzureTableStorage { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory BingLLMSearch { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Cassandra { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory CognitiveSearch { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory CognitiveService { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Concur { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory ContainerRegistry { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory CosmosDb { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory CosmosDbMongoDbApi { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Couchbase { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory CustomKeys { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Db2 { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Drill { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Dynamics { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory DynamicsAx { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory DynamicsCrm { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Eloqua { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory FileServer { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory FtpServer { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory GenericContainerRegistry { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory GenericHttp { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory GenericRest { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Git { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory GoogleAdWords { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory GoogleBigQuery { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory GoogleCloudStorage { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Greenplum { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Hbase { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Hdfs { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Hive { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Hubspot { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Impala { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Informix { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Jira { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Magento { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory MariaDb { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Marketo { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory MicrosoftAccess { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory MongoDbAtlas { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory MongoDbV2 { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory MySql { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Netezza { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory ODataRest { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Odbc { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Office365 { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory OpenAI { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Oracle { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory OracleCloudStorage { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory OracleServiceCloud { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory PayPal { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Phoenix { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory PostgreSql { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Presto { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory PythonFeed { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory QuickBooks { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Redis { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Responsys { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory S3 { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Salesforce { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory SalesforceMarketingCloud { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory SalesforceServiceCloud { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory SapBw { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory SapCloudForCustomer { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory SapEcc { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory SapHana { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory SapOpenHub { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory SapTable { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Serp { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Serverless { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory ServiceNow { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Sftp { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory SharePointOnlineList { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Shopify { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Snowflake { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Spark { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory SqlServer { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Square { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Sybase { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Teradata { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Vertica { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory WebTable { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Xero { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory Zoho { get { throw null; } } public bool Equals(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } @@ -5506,7 +5996,6 @@ public MachineLearningContainerResourceSettings() { } private readonly int _dummyPrimitive; public MachineLearningContainerType(string value) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningContainerType InferenceServer { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningContainerType ModelDataCollector { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningContainerType StorageInitializer { get { throw null; } } public bool Equals(Azure.ResourceManager.MachineLearning.Models.MachineLearningContainerType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -5532,9 +6021,6 @@ public MachineLearningCustomModelJobInput(System.Uri uri) { } public partial class MachineLearningCustomModelJobOutput : Azure.ResourceManager.MachineLearning.Models.MachineLearningJobOutput, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningCustomModelJobOutput() { } - public string AssetName { get { throw null; } set { } } - public string AssetVersion { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting AutoDeleteSetting { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningOutputDeliveryMode? Mode { get { throw null; } set { } } public System.Uri Uri { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningCustomModelJobOutput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5638,7 +6124,6 @@ public partial class MachineLearningDatastoreProperties : Azure.ResourceManager. { public MachineLearningDatastoreProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials) { } public Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials Credentials { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.IntellectualProperty IntellectualProperty { get { throw null; } set { } } public bool? IsDefault { get { throw null; } } Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -5674,22 +6159,10 @@ protected MachineLearningDatastoreSecrets() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.MachineLearningDataType left, Azure.ResourceManager.MachineLearning.Models.MachineLearningDataType right) { throw null; } public override string ToString() { throw null; } } - public partial class MachineLearningDataVersionCollectionGetAllOptions - { - public MachineLearningDataVersionCollectionGetAllOptions() { } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? ListViewType { get { throw null; } set { } } - public string OrderBy { get { throw null; } set { } } - public string Skip { get { throw null; } set { } } - public string Stage { get { throw null; } set { } } - public string Tags { get { throw null; } set { } } - public int? Top { get { throw null; } set { } } - } public partial class MachineLearningDataVersionProperties : Azure.ResourceManager.MachineLearning.Models.MachineLearningAssetBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningDataVersionProperties(System.Uri dataUri) { } public System.Uri DataUri { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.IntellectualProperty IntellectualProperty { get { throw null; } set { } } - public string Stage { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningDataVersionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.MachineLearningDataVersionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -6088,7 +6561,6 @@ public MachineLearningEnvironmentVersionProperties() { } public Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentType? EnvironmentType { get { throw null; } } public string Image { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningInferenceContainerProperties InferenceConfig { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.IntellectualProperty IntellectualProperty { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningOperatingSystemType? OSType { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? ProvisioningState { get { throw null; } } public string Stage { get { throw null; } set { } } @@ -6132,6 +6604,16 @@ internal MachineLearningEstimatedVmPrices() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MachineLearningFeatureCollectionGetAllOptions + { + public MachineLearningFeatureCollectionGetAllOptions() { } + public string Description { get { throw null; } set { } } + public string FeatureName { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? ListViewType { get { throw null; } set { } } + public int? PageSize { get { throw null; } set { } } + public string Skip { get { throw null; } set { } } + public string Tags { get { throw null; } set { } } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MachineLearningFeatureLag : System.IEquatable { @@ -6182,24 +6664,6 @@ public MachineLearningFeatureSetContainerProperties() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class MachineLearningFeatureSetJob : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MachineLearningFeatureSetJob() { } - public System.DateTimeOffset? CreatedOn { get { throw null; } } - public string DisplayName { get { throw null; } } - public System.TimeSpan? Duration { get { throw null; } } - public string ExperimentId { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.FeatureStoreJobType? FeatureStoreJobType { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.FeatureWindow FeatureWindow { get { throw null; } } - public string JobId { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? Status { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } - Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetJob System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetJob System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class MachineLearningFeatureSetVersionCollectionGetAllOptions { public MachineLearningFeatureSetVersionCollectionGetAllOptions() { } @@ -6330,24 +6794,6 @@ public MachineLearningFlavorData() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLogger left, Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLogger right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MachineLearningFlowAutoLoggerState : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public MachineLearningFlowAutoLoggerState(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLoggerState Disabled { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLoggerState Enabled { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLoggerState other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLoggerState left, Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLoggerState right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLoggerState (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLoggerState left, Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLoggerState right) { throw null; } - public override string ToString() { throw null; } - } public partial class MachineLearningFlowModelJobInput : Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningFlowModelJobInput(System.Uri uri) { } @@ -6362,9 +6808,6 @@ public MachineLearningFlowModelJobInput(System.Uri uri) { } public partial class MachineLearningFlowModelJobOutput : Azure.ResourceManager.MachineLearning.Models.MachineLearningJobOutput, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningFlowModelJobOutput() { } - public string AssetName { get { throw null; } set { } } - public string AssetVersion { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting AutoDeleteSetting { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningOutputDeliveryMode? Mode { get { throw null; } set { } } public System.Uri Uri { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobOutput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -6378,13 +6821,10 @@ public partial class MachineLearningForecasting : Azure.ResourceManager.MachineL public MachineLearningForecasting(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData) : base (default(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput)) { } public System.Collections.Generic.IList CvSplitColumnNames { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.TableVerticalFeaturizationSettings FeaturizationSettings { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.TableFixedParameters FixedParameters { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ForecastingSettings ForecastingSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.TableVerticalLimitSettings LimitSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.NCrossValidations NCrossValidations { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ForecastingPrimaryMetric? PrimaryMetric { get { throw null; } set { } } - public System.Collections.Generic.IList SearchSpace { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.TableSweepSettings SweepSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput TestData { get { throw null; } set { } } public double? TestDataSize { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ForecastingTrainingSettings TrainingSettings { get { throw null; } set { } } @@ -6565,17 +7005,6 @@ public MachineLearningInstanceTypeSchemaResources() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class MachineLearningJobCollectionGetAllOptions - { - public MachineLearningJobCollectionGetAllOptions() { } - public string AssetName { get { throw null; } set { } } - public string JobType { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningListViewType? ListViewType { get { throw null; } set { } } - public bool? Scheduled { get { throw null; } set { } } - public string ScheduleId { get { throw null; } set { } } - public string Skip { get { throw null; } set { } } - public string Tag { get { throw null; } set { } } - } public abstract partial class MachineLearningJobInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected MachineLearningJobInput() { } @@ -6606,16 +7035,6 @@ protected MachineLearningJobOutput() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class MachineLearningJobPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public MachineLearningJobPatch() { } - public System.Collections.Generic.IDictionary NotificationSettingWebhooks { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.MachineLearningJobPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.MachineLearningJobPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class MachineLearningJobProperties : Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningJobProperties() { } @@ -6626,7 +7045,6 @@ public MachineLearningJobProperties() { } public Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration Identity { get { throw null; } set { } } public bool? IsArchived { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.NotificationSetting NotificationSetting { get { throw null; } set { } } - public System.Collections.Generic.IDictionary SecretsConfiguration { get { throw null; } set { } } public System.Collections.Generic.IDictionary Services { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? Status { get { throw null; } } Azure.ResourceManager.MachineLearning.Models.MachineLearningJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -6690,7 +7108,6 @@ public MachineLearningJobService() { } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus Provisioning { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus Queued { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus Running { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus Scheduled { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus Starting { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus Unknown { get { throw null; } } public bool Equals(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus other) { throw null; } @@ -6899,7 +7316,6 @@ public MachineLearningModelVersionCollectionGetAllOptions() { } public string OrderBy { get { throw null; } set { } } public string Properties { get { throw null; } set { } } public string Skip { get { throw null; } set { } } - public string Stage { get { throw null; } set { } } public string Tags { get { throw null; } set { } } public int? Top { get { throw null; } set { } } public string Version { get { throw null; } set { } } @@ -6908,7 +7324,6 @@ public partial class MachineLearningModelVersionProperties : Azure.ResourceManag { public MachineLearningModelVersionProperties() { } public System.Collections.Generic.IDictionary Flavors { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.IntellectualProperty IntellectualProperty { get { throw null; } set { } } public string JobName { get { throw null; } set { } } public string ModelType { get { throw null; } set { } } public System.Uri ModelUri { get { throw null; } set { } } @@ -7171,6 +7586,7 @@ protected MachineLearningOnlineScaleSettings() { } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Create { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Delete { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Reimage { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Resize { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Restart { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Start { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Stop { get { throw null; } } @@ -7194,6 +7610,7 @@ protected MachineLearningOnlineScaleSettings() { } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus DeleteFailed { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus InProgress { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus ReimageFailed { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus ResizeFailed { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus RestartFailed { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus StartFailed { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus StopFailed { get { throw null; } } @@ -7269,6 +7686,7 @@ public abstract partial class MachineLearningOutboundRule : System.ClientModel.P { protected MachineLearningOutboundRule() { } public Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory? Category { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList ParentRuleNames { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus? Status { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningOutboundRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -7650,8 +8068,6 @@ public partial class MachineLearningResourceConfiguration : System.ClientModel.P public MachineLearningResourceConfiguration() { } public int? InstanceCount { get { throw null; } set { } } public string InstanceType { get { throw null; } set { } } - public System.Collections.Generic.IList Locations { get { throw null; } set { } } - public int? MaxInstanceCount { get { throw null; } set { } } public System.Collections.Generic.IDictionary Properties { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -8172,7 +8588,7 @@ public MachineLearningSweepJob(Azure.ResourceManager.MachineLearning.Models.Mach public Azure.ResourceManager.MachineLearning.Models.MachineLearningSweepJobLimits Limits { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningObjective Objective { get { throw null; } set { } } public System.Collections.Generic.IDictionary Outputs { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.JobQueueSettings QueueSettings { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.JobTier? QueueJobTier { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithm SamplingAlgorithm { get { throw null; } set { } } public System.BinaryData SearchSpace { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningTrialComponent Trial { get { throw null; } set { } } @@ -8247,9 +8663,6 @@ public MachineLearningTableJobInput(System.Uri uri) { } public partial class MachineLearningTableJobOutput : Azure.ResourceManager.MachineLearning.Models.MachineLearningJobOutput, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningTableJobOutput() { } - public string AssetName { get { throw null; } set { } } - public string AssetVersion { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting AutoDeleteSetting { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningOutputDeliveryMode? Mode { get { throw null; } set { } } public System.Uri Uri { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobOutput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -8281,7 +8694,6 @@ public MachineLearningTrainingSettings() { } public bool? IsStackEnsembleEnabled { get { throw null; } set { } } public bool? IsVoteEnsembleEnabled { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningStackEnsembleSettings StackEnsembleSettings { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.TrainingMode? TrainingMode { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningTrainingSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.MachineLearningTrainingSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -8347,9 +8759,6 @@ public MachineLearningTritonModelJobInput(System.Uri uri) { } public partial class MachineLearningTritonModelJobOutput : Azure.ResourceManager.MachineLearning.Models.MachineLearningJobOutput, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningTritonModelJobOutput() { } - public string AssetName { get { throw null; } set { } } - public string AssetVersion { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting AutoDeleteSetting { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningOutputDeliveryMode? Mode { get { throw null; } set { } } public System.Uri Uri { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningTritonModelJobOutput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -8416,9 +8825,6 @@ public MachineLearningUriFileJobInput(System.Uri uri) { } public partial class MachineLearningUriFileJobOutput : Azure.ResourceManager.MachineLearning.Models.MachineLearningJobOutput, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningUriFileJobOutput() { } - public string AssetName { get { throw null; } set { } } - public string AssetVersion { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting AutoDeleteSetting { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningOutputDeliveryMode? Mode { get { throw null; } set { } } public System.Uri Uri { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningUriFileJobOutput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -8450,9 +8856,6 @@ public MachineLearningUriFolderJobInput(System.Uri uri) { } public partial class MachineLearningUriFolderJobOutput : Azure.ResourceManager.MachineLearning.Models.MachineLearningJobOutput, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningUriFolderJobOutput() { } - public string AssetName { get { throw null; } set { } } - public string AssetVersion { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.AutoDeleteSetting AutoDeleteSetting { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningOutputDeliveryMode? Mode { get { throw null; } set { } } public System.Uri Uri { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningUriFolderJobOutput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -8743,9 +9146,17 @@ public abstract partial class MachineLearningWorkspaceConnectionProperties : Sys { protected MachineLearningWorkspaceConnectionProperties() { } public Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? Category { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier CreatedByWorkspaceArmId { get { throw null; } } + public string Error { get { throw null; } set { } } public System.DateTimeOffset? ExpiryOn { get { throw null; } set { } } - public System.BinaryData Metadata { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? Group { get { throw null; } } + public bool? IsSharedToAll { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? PeRequirement { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? PeStatus { get { throw null; } set { } } + public System.Collections.Generic.IList SharedUserList { get { throw null; } } public string Target { get { throw null; } set { } } + public bool? UseWorkspaceManagedIdentity { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public string Value { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -8760,6 +9171,7 @@ public partial class MachineLearningWorkspaceConnectionUsernamePassword : System { public MachineLearningWorkspaceConnectionUsernamePassword() { } public string Password { get { throw null; } set { } } + public string SecurityToken { get { throw null; } set { } } public string Username { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionUsernamePassword System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -8786,6 +9198,7 @@ public MachineLearningWorkspaceDiagnoseProperties() { } public System.Collections.Generic.IDictionary KeyVault { get { throw null; } } public System.Collections.Generic.IDictionary Nsg { get { throw null; } } public System.Collections.Generic.IDictionary Others { get { throw null; } } + public System.Collections.Generic.IDictionary RequiredResourceProviders { get { throw null; } } public System.Collections.Generic.IDictionary ResourceLock { get { throw null; } } public System.Collections.Generic.IDictionary StorageAccount { get { throw null; } } public System.Collections.Generic.IDictionary Udr { get { throw null; } } @@ -8860,21 +9273,25 @@ internal MachineLearningWorkspaceNotebookAccessTokenResult() { } public partial class MachineLearningWorkspacePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningWorkspacePatch() { } + public bool? AllowRoleAssignmentOnRG { get { throw null; } set { } } public string ApplicationInsights { get { throw null; } set { } } public string ContainerRegistry { get { throw null; } set { } } public int? CosmosDbCollectionsThroughput { get { throw null; } set { } } public string Description { get { throw null; } set { } } public bool? EnableDataIsolation { get { throw null; } set { } } + public bool? EnableSoftwareBillOfMaterials { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.FeatureStoreSettings FeatureStoreSettings { get { throw null; } set { } } public string FriendlyName { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public string ImageBuildCompute { get { throw null; } set { } } + public System.Collections.Generic.IList IPAllowlist { get { throw null; } } public string KeyIdentifier { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ManagedNetworkSettings ManagedNetwork { get { throw null; } set { } } public string PrimaryUserAssignedIdentity { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType? PublicNetworkAccessType { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessComputeSettings ServerlessComputeSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningSku Sku { get { throw null; } set { } } public int? SoftDeleteRetentionInDays { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } @@ -8933,6 +9350,20 @@ public ManagedComputeIdentity() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ManagedIdentityCredential : Azure.ResourceManager.MachineLearning.Models.DataReferenceCredential, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ManagedIdentityCredential() { } + public string ManagedIdentityType { get { throw null; } } + public string UserManagedIdentityClientId { get { throw null; } } + public string UserManagedIdentityPrincipalId { get { throw null; } } + public string UserManagedIdentityResourceId { get { throw null; } } + public string UserManagedIdentityTenantId { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.ManagedIdentityCredential System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ManagedIdentityCredential System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ManagedNetworkProvisionContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ManagedNetworkProvisionContent() { } @@ -8957,6 +9388,7 @@ public ManagedNetworkProvisionStatus() { } public partial class ManagedNetworkSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ManagedNetworkSettings() { } + public System.Collections.Generic.IReadOnlyList ChangeableIsolationModes { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.IsolationMode? IsolationMode { get { throw null; } set { } } public string NetworkId { get { throw null; } } public System.Collections.Generic.IDictionary OutboundRules { get { throw null; } set { } } @@ -8985,6 +9417,146 @@ public ManagedNetworkSettings() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ManagedNetworkStatus left, Azure.ResourceManager.MachineLearning.Models.ManagedNetworkStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class ManagedOnlineEndpointDeploymentResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedOnlineEndpointDeploymentResourceProperties() { } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointComputeType? EndpointComputeType { get { throw null; } set { } } + public string Model { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ManagedOnlineEndpointDeploymentResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ManagedOnlineEndpointDeploymentResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ManagedOnlineEndpointResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedOnlineEndpointResourceProperties() { } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode? AuthMode { get { throw null; } set { } } + public string Compute { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IDictionary MirrorTraffic { get { throw null; } } + public System.Uri ScoringUri { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Traffic { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.ManagedOnlineEndpointResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ManagedOnlineEndpointResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedPERequirement : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedPERequirement(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement NotApplicable { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement NotRequired { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement Required { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement left, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement left, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedPEStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedPEStatus(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus Active { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus Inactive { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus NotApplicable { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus left, Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus left, Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedResourceGroupAssignedIdentities : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedResourceGroupAssignedIdentities() { } + public System.Guid? PrincipalId { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.ManagedResourceGroupAssignedIdentities System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ManagedResourceGroupAssignedIdentities System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MarketplacePlan : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MarketplacePlan() { } + public string OfferId { get { throw null; } } + public string PlanId { get { throw null; } } + public string PublisherId { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.MarketplacePlan System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.MarketplacePlan System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MarketplaceSubscriptionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MarketplaceSubscriptionProperties(string modelId) { } + public Azure.ResourceManager.MachineLearning.Models.MarketplacePlan MarketplacePlan { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get { throw null; } } + public string ModelId { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState? ProvisioningState { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MarketplaceSubscriptionProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MarketplaceSubscriptionProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState left, Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState left, Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MarketplaceSubscriptionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MarketplaceSubscriptionStatus(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus Subscribed { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus Suspended { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus Unsubscribed { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus left, Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus left, Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class MaterializationSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MaterializationSettings() { } @@ -9028,96 +9600,23 @@ public MedianStoppingPolicy() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class MLAssistConfigurationDisabled : Azure.ResourceManager.MachineLearning.Models.MachineLearningAssistConfiguration, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public MLAssistConfigurationDisabled() { } - Azure.ResourceManager.MachineLearning.Models.MLAssistConfigurationDisabled System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.MLAssistConfigurationDisabled System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class ModelConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ModelConfiguration() { } - public Azure.ResourceManager.MachineLearning.Models.PackageInputDeliveryMode? Mode { get { throw null; } set { } } - public string MountPath { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.ModelConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.ModelConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class ModelPackageContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ModelPackageContent(Azure.ResourceManager.MachineLearning.Models.InferencingServer inferencingServer, string targetEnvironmentId) { } - public Azure.ResourceManager.MachineLearning.Models.BaseEnvironmentSource BaseEnvironmentSource { get { throw null; } set { } } - public System.Collections.Generic.IDictionary EnvironmentVariables { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.InferencingServer InferencingServer { get { throw null; } } - public System.Collections.Generic.IList Inputs { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.ModelConfiguration ModelConfiguration { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } set { } } - public string TargetEnvironmentId { get { throw null; } } - Azure.ResourceManager.MachineLearning.Models.ModelPackageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.ModelPackageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class ModelPackageInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ModelPackageInput(Azure.ResourceManager.MachineLearning.Models.PackageInputType inputType, Azure.ResourceManager.MachineLearning.Models.PackageInputPathBase path) { } - public Azure.ResourceManager.MachineLearning.Models.PackageInputType InputType { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.PackageInputDeliveryMode? Mode { get { throw null; } set { } } - public string MountPath { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.PackageInputPathBase Path { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.ModelPackageInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.ModelPackageInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class ModelPackageResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal ModelPackageResult() { } - public Azure.ResourceManager.MachineLearning.Models.BaseEnvironmentSource BaseEnvironmentSource { get { throw null; } } - public string BuildId { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.PackageBuildState? BuildState { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary EnvironmentVariables { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.InferencingServer InferencingServer { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Inputs { get { throw null; } } - public System.Uri LogUri { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.ModelConfiguration ModelConfiguration { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } - public string TargetEnvironmentId { get { throw null; } } - Azure.ResourceManager.MachineLearning.Models.ModelPackageResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.ModelPackageResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public abstract partial class ModelPerformanceMetricThresholdBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - protected ModelPerformanceMetricThresholdBase() { } - public double? ThresholdValue { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.ModelPerformanceMetricThresholdBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.ModelPerformanceMetricThresholdBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class ModelPerformanceSignal : Azure.ResourceManager.MachineLearning.Models.MonitoringSignalBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ModelLifecycleStatus : System.IEquatable { - public ModelPerformanceSignal(Azure.ResourceManager.MachineLearning.Models.ModelPerformanceMetricThresholdBase metricThreshold, System.Collections.Generic.IEnumerable productionData, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase referenceData) { } - public Azure.ResourceManager.MachineLearning.Models.MonitoringDataSegment DataSegment { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.ModelPerformanceMetricThresholdBase MetricThreshold { get { throw null; } set { } } - public System.Collections.Generic.IList ProductionData { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase ReferenceData { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.ModelPerformanceSignal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.ModelPerformanceSignal System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ModelLifecycleStatus(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus GenerallyAvailable { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus Preview { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus left, Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus left, Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus right) { throw null; } + public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ModelTaskType : System.IEquatable @@ -9126,7 +9625,6 @@ public ModelPerformanceSignal(Azure.ResourceManager.MachineLearning.Models.Model private readonly int _dummyPrimitive; public ModelTaskType(string value) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.ModelTaskType Classification { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.ModelTaskType QuestionAnswering { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.ModelTaskType Regression { get { throw null; } } public bool Equals(Azure.ResourceManager.MachineLearning.Models.ModelTaskType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -9159,8 +9657,8 @@ protected MonitorComputeIdentityBase() { } public partial class MonitorDefinition : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MonitorDefinition(Azure.ResourceManager.MachineLearning.Models.MonitorComputeConfigurationBase computeConfiguration, System.Collections.Generic.IDictionary signals) { } - public Azure.ResourceManager.MachineLearning.Models.MonitoringAlertNotificationSettingsBase AlertNotificationSetting { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MonitorComputeConfigurationBase ComputeConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IList Emails { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MonitoringTarget MonitoringTarget { get { throw null; } set { } } public System.Collections.Generic.IDictionary Signals { get { throw null; } } Azure.ResourceManager.MachineLearning.Models.MonitorDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -9169,26 +9667,6 @@ public MonitorDefinition(Azure.ResourceManager.MachineLearning.Models.MonitorCom string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public abstract partial class MonitoringAlertNotificationSettingsBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - protected MonitoringAlertNotificationSettingsBase() { } - Azure.ResourceManager.MachineLearning.Models.MonitoringAlertNotificationSettingsBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.MonitoringAlertNotificationSettingsBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MonitoringDataSegment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public MonitoringDataSegment() { } - public string Feature { get { throw null; } set { } } - public System.Collections.Generic.IList Values { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.MonitoringDataSegment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.MonitoringDataSegment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MonitoringFeatureDataType : System.IEquatable { @@ -9230,45 +9708,26 @@ protected MonitoringInputDataBase(Azure.ResourceManager.MachineLearning.Models.J System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MonitoringModelType : System.IEquatable + public readonly partial struct MonitoringNotificationType : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public MonitoringModelType(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MonitoringModelType Classification { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.MonitoringModelType Regression { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.MonitoringModelType other) { throw null; } + public MonitoringNotificationType(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationType AmlNotification { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.MonitoringModelType left, Azure.ResourceManager.MachineLearning.Models.MonitoringModelType right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.MonitoringModelType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.MonitoringModelType left, Azure.ResourceManager.MachineLearning.Models.MonitoringModelType right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MonitoringNotificationMode : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public MonitoringNotificationMode(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationMode Disabled { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationMode Enabled { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationMode other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationMode left, Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationMode right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationMode left, Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationMode right) { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationType left, Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationType right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationType left, Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationType right) { throw null; } public override string ToString() { throw null; } } public abstract partial class MonitoringSignalBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected MonitoringSignalBase() { } - public Azure.ResourceManager.MachineLearning.Models.MonitoringNotificationMode? Mode { get { throw null; } set { } } + public System.Collections.Generic.IList NotificationTypes { get { throw null; } set { } } public System.Collections.Generic.IDictionary Properties { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MonitoringSignalBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -9288,17 +9747,6 @@ public MonitoringTarget(Azure.ResourceManager.MachineLearning.Models.ModelTaskTy string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class MonitoringWorkspaceConnection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public MonitoringWorkspaceConnection() { } - public System.Collections.Generic.IDictionary EnvironmentVariables { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Secrets { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.MonitoringWorkspaceConnection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.MonitoringWorkspaceConnection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class MonitorServerlessSparkCompute : Azure.ResourceManager.MachineLearning.Models.MonitorComputeConfigurationBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MonitorServerlessSparkCompute(Azure.ResourceManager.MachineLearning.Models.MonitorComputeIdentityBase computeIdentity, string instanceType, string runtimeVersion) { } @@ -9323,6 +9771,24 @@ public MountBindOptions() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MountMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MountMode(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MountMode ReadOnly { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MountMode ReadWrite { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.MountMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.MountMode left, Azure.ResourceManager.MachineLearning.Models.MountMode right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.MountMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.MountMode left, Azure.ResourceManager.MachineLearning.Models.MountMode right) { throw null; } + public override string ToString() { throw null; } + } public partial class MpiDistributionConfiguration : Azure.ResourceManager.MachineLearning.Models.MachineLearningDistributionConfiguration, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MpiDistributionConfiguration() { } @@ -9360,84 +9826,12 @@ protected NCrossValidations() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.NetworkingRuleAction left, Azure.ResourceManager.MachineLearning.Models.NetworkingRuleAction right) { throw null; } public override string ToString() { throw null; } } - public partial class NlpFixedParameters : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public NlpFixedParameters() { } - public int? GradientAccumulationSteps { get { throw null; } set { } } - public float? LearningRate { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler? LearningRateScheduler { get { throw null; } set { } } - public string ModelName { get { throw null; } set { } } - public int? NumberOfEpochs { get { throw null; } set { } } - public int? TrainingBatchSize { get { throw null; } set { } } - public int? ValidationBatchSize { get { throw null; } set { } } - public float? WarmupRatio { get { throw null; } set { } } - public float? WeightDecay { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.NlpFixedParameters System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.NlpFixedParameters System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct NlpLearningRateScheduler : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public NlpLearningRateScheduler(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler Constant { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler ConstantWithWarmup { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler Cosine { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler CosineWithRestarts { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler Linear { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler None { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler Polynomial { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler left, Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler left, Azure.ResourceManager.MachineLearning.Models.NlpLearningRateScheduler right) { throw null; } - public override string ToString() { throw null; } - } - public partial class NlpParameterSubspace : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public NlpParameterSubspace() { } - public string GradientAccumulationSteps { get { throw null; } set { } } - public string LearningRate { get { throw null; } set { } } - public string LearningRateScheduler { get { throw null; } set { } } - public string ModelName { get { throw null; } set { } } - public string NumberOfEpochs { get { throw null; } set { } } - public string TrainingBatchSize { get { throw null; } set { } } - public string ValidationBatchSize { get { throw null; } set { } } - public string WarmupRatio { get { throw null; } set { } } - public string WeightDecay { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.NlpParameterSubspace System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.NlpParameterSubspace System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class NlpSweepSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public NlpSweepSettings(Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithmType samplingAlgorithm) { } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningEarlyTerminationPolicy EarlyTermination { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithmType SamplingAlgorithm { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.NlpSweepSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.NlpSweepSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class NlpVerticalLimitSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NlpVerticalLimitSettings() { } public int? MaxConcurrentTrials { get { throw null; } set { } } - public int? MaxNodes { get { throw null; } set { } } public int? MaxTrials { get { throw null; } set { } } public System.TimeSpan? Timeout { get { throw null; } set { } } - public System.TimeSpan? TrialTimeout { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -9545,6 +9939,16 @@ public NumericalPredictionDriftMetricThreshold(Azure.ResourceManager.MachineLear string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class OAuth2AuthTypeWorkspaceConnectionProperties : Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OAuth2AuthTypeWorkspaceConnectionProperties() { } + public Azure.ResourceManager.MachineLearning.Models.WorkspaceConnectionOAuth2 Credentials { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.OAuth2AuthTypeWorkspaceConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.OAuth2AuthTypeWorkspaceConnectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ObjectDetectionPrimaryMetric : System.IEquatable { @@ -9585,19 +9989,40 @@ public OneLakeDatastore(Azure.ResourceManager.MachineLearning.Models.MachineLear string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class OnlineInferenceConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public OnlineInferenceConfiguration() { } - public System.Collections.Generic.IDictionary Configurations { get { throw null; } set { } } - public string EntryScript { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningInferenceContainerRoute LivenessRoute { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningInferenceContainerRoute ReadinessRoute { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningInferenceContainerRoute ScoringRoute { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.OnlineInferenceConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.OnlineInferenceConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public partial class OpenAIEndpointDeploymentResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenAIEndpointDeploymentResourceProperties(Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model) { } + public Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel Model { get { throw null; } set { } } + public string RaiPolicyName { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointDeploymentResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointDeploymentResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenAIEndpointResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenAIEndpointResourceProperties() { } + Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OSPatchingStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OSPatchingStatus() { } + public System.DateTimeOffset? LatestPatchOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList OSPatchingErrors { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.PatchStatus? PatchStatus { get { throw null; } } + public bool? RebootPending { get { throw null; } } + public System.DateTimeOffset? ScheduledRebootOn { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct OutboundRuleCategory : System.IEquatable @@ -9605,6 +10030,7 @@ public OnlineInferenceConfiguration() { } private readonly object _dummy; private readonly int _dummyPrimitive; public OutboundRuleCategory(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory Dependency { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory Recommended { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory Required { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory UserDefined { get { throw null; } } @@ -9637,99 +10063,24 @@ public OnlineInferenceConfiguration() { } public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct PackageBuildState : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public PackageBuildState(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.PackageBuildState Failed { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.PackageBuildState NotStarted { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.PackageBuildState Running { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.PackageBuildState Succeeded { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.PackageBuildState other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.PackageBuildState left, Azure.ResourceManager.MachineLearning.Models.PackageBuildState right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.PackageBuildState (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.PackageBuildState left, Azure.ResourceManager.MachineLearning.Models.PackageBuildState right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct PackageInputDeliveryMode : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public PackageInputDeliveryMode(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.PackageInputDeliveryMode Copy { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.PackageInputDeliveryMode Download { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.PackageInputDeliveryMode other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.PackageInputDeliveryMode left, Azure.ResourceManager.MachineLearning.Models.PackageInputDeliveryMode right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.PackageInputDeliveryMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.PackageInputDeliveryMode left, Azure.ResourceManager.MachineLearning.Models.PackageInputDeliveryMode right) { throw null; } - public override string ToString() { throw null; } - } - public abstract partial class PackageInputPathBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - protected PackageInputPathBase() { } - Azure.ResourceManager.MachineLearning.Models.PackageInputPathBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.PackageInputPathBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class PackageInputPathId : Azure.ResourceManager.MachineLearning.Models.PackageInputPathBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public PackageInputPathId() { } - public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.PackageInputPathId System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.PackageInputPathId System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class PackageInputPathUri : Azure.ResourceManager.MachineLearning.Models.PackageInputPathBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public PackageInputPathUri() { } - public System.Uri Uri { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.PackageInputPathUri System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.PackageInputPathUri System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class PackageInputPathVersion : Azure.ResourceManager.MachineLearning.Models.PackageInputPathBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public PackageInputPathVersion() { } - public string ResourceName { get { throw null; } set { } } - public string ResourceVersion { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.PackageInputPathVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.PackageInputPathVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct PackageInputType : System.IEquatable + public readonly partial struct PatchStatus : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public PackageInputType(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.PackageInputType UriFile { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.PackageInputType UriFolder { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.PackageInputType other) { throw null; } + public PatchStatus(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.PatchStatus CompletedWithWarnings { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.PatchStatus Failed { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.PatchStatus InProgress { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.PatchStatus Succeeded { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.PatchStatus Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.PatchStatus other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.PackageInputType left, Azure.ResourceManager.MachineLearning.Models.PackageInputType right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.PackageInputType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.PackageInputType left, Azure.ResourceManager.MachineLearning.Models.PackageInputType right) { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.PatchStatus left, Azure.ResourceManager.MachineLearning.Models.PatchStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.PatchStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.PatchStatus left, Azure.ResourceManager.MachineLearning.Models.PatchStatus right) { throw null; } public override string ToString() { throw null; } } public abstract partial class PendingUploadCredentialDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -9794,9 +10145,9 @@ protected PredictionDriftMetricThresholdBase() { } } public partial class PredictionDriftMonitoringSignal : Azure.ResourceManager.MachineLearning.Models.MonitoringSignalBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public PredictionDriftMonitoringSignal(System.Collections.Generic.IEnumerable metricThresholds, Azure.ResourceManager.MachineLearning.Models.MonitoringModelType modelType, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase productionData, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase referenceData) { } + public PredictionDriftMonitoringSignal(System.Collections.Generic.IEnumerable metricThresholds, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase productionData, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase referenceData) { } + public System.Collections.Generic.IDictionary FeatureDataTypeOverride { get { throw null; } set { } } public System.Collections.Generic.IList MetricThresholds { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MonitoringModelType ModelType { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase ProductionData { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase ReferenceData { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.PredictionDriftMonitoringSignal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -9818,7 +10169,7 @@ public PrivateEndpointBase() { } public partial class PrivateEndpointDestination : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public PrivateEndpointDestination() { } - public string ServiceResourceId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ServiceResourceId { get { throw null; } set { } } public bool? SparkEnabled { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus? SparkStatus { get { throw null; } set { } } public string SubresourceTarget { get { throw null; } set { } } @@ -9832,25 +10183,13 @@ public partial class PrivateEndpointOutboundRule : Azure.ResourceManager.Machine { public PrivateEndpointOutboundRule() { } public Azure.ResourceManager.MachineLearning.Models.PrivateEndpointDestination Destination { get { throw null; } set { } } + public System.Collections.Generic.IList Fqdns { get { throw null; } } Azure.ResourceManager.MachineLearning.Models.PrivateEndpointOutboundRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.PrivateEndpointOutboundRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ProgressMetrics : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal ProgressMetrics() { } - public long? CompletedDatapointCount { get { throw null; } } - public System.DateTimeOffset? IncrementalDataLastRefreshOn { get { throw null; } } - public long? SkippedDatapointCount { get { throw null; } } - public long? TotalDatapointCount { get { throw null; } } - Azure.ResourceManager.MachineLearning.Models.ProgressMetrics System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.ProgressMetrics System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class PyTorchDistributionConfiguration : Azure.ResourceManager.MachineLearning.Models.MachineLearningDistributionConfiguration, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public PyTorchDistributionConfiguration() { } @@ -9861,10 +10200,136 @@ public PyTorchDistributionConfiguration() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class RaiBlocklistConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiBlocklistConfig() { } + public bool? Blocking { get { throw null; } set { } } + public string BlocklistName { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RaiBlocklistItemBulkRequest : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiBlocklistItemBulkRequest() { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemBulkRequest System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemBulkRequest System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RaiBlocklistItemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiBlocklistItemProperties() { } + public bool? IsRegex { get { throw null; } set { } } + public string Pattern { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RaiBlocklistProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiBlocklistProperties() { } + public string Description { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RaiPolicyContentFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiPolicyContentFilter() { } + public Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel? AllowedContentLevel { get { throw null; } set { } } + public bool? Blocking { get { throw null; } set { } } + public bool? Enabled { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource? Source { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RaiPolicyContentSource : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RaiPolicyContentSource(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource Completion { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource Prompt { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource left, Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource left, Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RaiPolicyMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RaiPolicyMode(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode Blocking { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode Default { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode Deferred { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode left, Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode left, Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RaiPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiPolicyProperties() { } + public string BasePolicyName { get { throw null; } set { } } + public System.Collections.Generic.IList CompletionBlocklists { get { throw null; } } + public System.Collections.Generic.IList ContentFilters { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode? Mode { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.RaiPolicyType? PolicyType { get { throw null; } set { } } + public System.Collections.Generic.IList PromptBlocklists { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.RaiPolicyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RaiPolicyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RaiPolicyType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RaiPolicyType(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyType SystemManaged { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyType UserManaged { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.RaiPolicyType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.RaiPolicyType left, Azure.ResourceManager.MachineLearning.Models.RaiPolicyType right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.RaiPolicyType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.RaiPolicyType left, Azure.ResourceManager.MachineLearning.Models.RaiPolicyType right) { throw null; } + public override string ToString() { throw null; } + } public partial class RandomSamplingAlgorithm : Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithm, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RandomSamplingAlgorithm() { } - public string Logbase { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.RandomSamplingAlgorithmRule? Rule { get { throw null; } set { } } public int? Seed { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.RandomSamplingAlgorithm System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -9891,20 +10356,15 @@ public RandomSamplingAlgorithm() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.RandomSamplingAlgorithmRule left, Azure.ResourceManager.MachineLearning.Models.RandomSamplingAlgorithmRule right) { throw null; } public override string ToString() { throw null; } } - public partial class RayDistributionConfiguration : Azure.ResourceManager.MachineLearning.Models.MachineLearningDistributionConfiguration, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class RegenerateServiceAccountKeyContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public RayDistributionConfiguration() { } - public string Address { get { throw null; } set { } } - public int? DashboardPort { get { throw null; } set { } } - public string HeadNodeAdditionalArgs { get { throw null; } set { } } - public bool? IncludeDashboard { get { throw null; } set { } } - public int? Port { get { throw null; } set { } } - public string WorkerNodeAdditionalArgs { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.RayDistributionConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.RayDistributionConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public RegenerateServiceAccountKeyContent() { } + public Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName? KeyName { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RegenerateServiceAccountKeyContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RegenerateServiceAccountKeyContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class RegistryAcrDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -9956,8 +10416,8 @@ public RegistryPrivateEndpointConnection() { } public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } public Azure.Core.AzureLocation? Location { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.RegistryPrivateEndpoint PrivateEndpoint { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.RegistryPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get { throw null; } set { } } public string ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.RegistryPrivateLinkServiceConnectionState RegistryPrivateLinkServiceConnectionState { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.RegistryPrivateEndpointConnection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.RegistryPrivateEndpointConnection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -9988,35 +10448,6 @@ public RegistryRegionArmDetails() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct RegressionModelPerformanceMetric : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public RegressionModelPerformanceMetric(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetric MeanAbsoluteError { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetric MeanSquaredError { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetric RootMeanSquaredError { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetric other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetric left, Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetric right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetric (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetric left, Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetric right) { throw null; } - public override string ToString() { throw null; } - } - public partial class RegressionModelPerformanceMetricThreshold : Azure.ResourceManager.MachineLearning.Models.ModelPerformanceMetricThresholdBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public RegressionModelPerformanceMetricThreshold(Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetric metric) { } - public Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetric Metric { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetricThreshold System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.RegressionModelPerformanceMetricThreshold System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class RegressionTrainingSettings : Azure.ResourceManager.MachineLearning.Models.MachineLearningTrainingSettings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RegressionTrainingSettings() { } @@ -10028,6 +10459,28 @@ public RegressionTrainingSettings() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ResizeSchema : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ResizeSchema() { } + public string TargetVmSize { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ResizeSchema System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ResizeSchema System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RollingInputData : Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RollingInputData(Azure.ResourceManager.MachineLearning.Models.JobInputType jobInputType, System.Uri uri, System.TimeSpan windowOffset, System.TimeSpan windowSize) : base (default(Azure.ResourceManager.MachineLearning.Models.JobInputType), default(System.Uri)) { } + public string PreprocessingComponentId { get { throw null; } set { } } + public System.TimeSpan WindowOffset { get { throw null; } set { } } + public System.TimeSpan WindowSize { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RollingInputData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RollingInputData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct RollingRateType : System.IEquatable { @@ -10077,6 +10530,16 @@ protected SamplingAlgorithm() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithmType left, Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithmType right) { throw null; } public override string ToString() { throw null; } } + public partial class SasCredential : Azure.ResourceManager.MachineLearning.Models.DataReferenceCredential, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SasCredential() { } + public System.Uri SasUri { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.SasCredential System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.SasCredential System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SasCredentialDto : Azure.ResourceManager.MachineLearning.Models.PendingUploadCredentialDto, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal SasCredentialDto() { } @@ -10087,16 +10550,176 @@ internal SasCredentialDto() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class SecretConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public SecretConfiguration() { } + public partial class SecretExpiry : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecretExpiry() { } + public bool? ExpirableSecret { get { throw null; } set { } } + public int? ExpireAfterHours { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.SecretExpiry System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.SecretExpiry System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServerlessComputeSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServerlessComputeSettings() { } + public bool? HasNoPublicIP { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ServerlessComputeCustomSubnet { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ServerlessComputeSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ServerlessComputeSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServerlessEndpointCapacityReservation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServerlessEndpointCapacityReservation(string capacityReservationGroupId) { } + public string CapacityReservationGroupId { get { throw null; } set { } } + public int? EndpointReservedCapacity { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointCapacityReservation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointCapacityReservation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServerlessEndpointInferenceEndpoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServerlessEndpointInferenceEndpoint(System.Uri uri) { } + public System.Collections.Generic.IReadOnlyDictionary Headers { get { throw null; } } public System.Uri Uri { get { throw null; } set { } } - public string WorkspaceSecretName { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.SecretConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.SecretConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointInferenceEndpoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointInferenceEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServerlessEndpointPatch : Azure.ResourceManager.MachineLearning.Models.MachineLearningResourcePatch, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServerlessEndpointPatch() { } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningPartialManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuPatch Sku { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServerlessEndpointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServerlessEndpointProperties(Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode authMode) { } + public Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode AuthMode { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus? ContentSafetyStatus { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState? EndpointState { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpoint InferenceEndpoint { get { throw null; } } + public string MarketplaceSubscriptionId { get { throw null; } } + public string ModelId { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState? ProvisioningState { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServerlessEndpointResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServerlessEndpointResourceProperties() { } + public Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode? AuthMode { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointCapacityReservation CapacityReservation { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus? ContentSafetyStatus { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState? EndpointState { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointInferenceEndpoint InferenceEndpoint { get { throw null; } set { } } + public string MarketplaceSubscriptionId { get { throw null; } set { } } + public System.BinaryData Metadata { get { throw null; } set { } } + public string ModelId { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessOffer Offer { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ServerlessEndpointState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ServerlessEndpointState(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState Creating { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState CreationFailed { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState Deleting { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState DeletionFailed { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState Online { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState Reinstating { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState Suspended { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState Suspending { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState left, Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState left, Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ServerlessInferenceEndpoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ServerlessInferenceEndpoint() { } + public System.Collections.Generic.IReadOnlyDictionary Headers { get { throw null; } } + public System.Uri Uri { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ServerlessInferenceEndpointAuthMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ServerlessInferenceEndpointAuthMode(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode Key { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode left, Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode left, Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ServerlessOffer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServerlessOffer(string offerName, string publisher) { } + public string OfferName { get { throw null; } set { } } + public string Publisher { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ServerlessOffer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ServerlessOffer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ServiceAccountKeyName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ServiceAccountKeyName(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName Key1 { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName Key2 { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName left, Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName left, Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName right) { throw null; } + public override string ToString() { throw null; } } public partial class ServicePrincipalAuthTypeWorkspaceConnectionProperties : Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -10134,19 +10757,20 @@ public ServiceTagOutboundRule() { } } public partial class SparkJob : Azure.ResourceManager.MachineLearning.Models.MachineLearningJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public SparkJob(string codeId, Azure.ResourceManager.MachineLearning.Models.SparkJobEntry entry) { } + public SparkJob(Azure.Core.ResourceIdentifier codeId, Azure.ResourceManager.MachineLearning.Models.SparkJobEntry entry) { } public System.Collections.Generic.IList Archives { get { throw null; } set { } } public string Args { get { throw null; } set { } } - public string CodeId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier CodeId { get { throw null; } set { } } public System.Collections.Generic.IDictionary Conf { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.SparkJobEntry Entry { get { throw null; } set { } } - public string EnvironmentId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier EnvironmentId { get { throw null; } set { } } + public System.Collections.Generic.IDictionary EnvironmentVariables { get { throw null; } set { } } public System.Collections.Generic.IList Files { get { throw null; } set { } } public System.Collections.Generic.IDictionary Inputs { get { throw null; } set { } } public System.Collections.Generic.IList Jars { get { throw null; } set { } } public System.Collections.Generic.IDictionary Outputs { get { throw null; } set { } } public System.Collections.Generic.IList PyFiles { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.JobQueueSettings QueueSettings { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.JobTier? QueueJobTier { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.SparkResourceConfiguration Resources { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.SparkJob System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -10194,6 +10818,27 @@ public SparkResourceConfiguration() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class SpeechEndpointDeploymentResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SpeechEndpointDeploymentResourceProperties(Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model) { } + public Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel Model { get { throw null; } set { } } + public string RaiPolicyName { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.SpeechEndpointDeploymentResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.SpeechEndpointDeploymentResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SpeechEndpointResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SpeechEndpointResourceProperties() { } + Azure.ResourceManager.MachineLearning.Models.SpeechEndpointResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.SpeechEndpointResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class StaticInputData : Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public StaticInputData(Azure.ResourceManager.MachineLearning.Models.JobInputType jobInputType, System.Uri uri, System.DateTimeOffset windowEnd, System.DateTimeOffset windowStart) : base (default(Azure.ResourceManager.MachineLearning.Models.JobInputType), default(System.Uri)) { } @@ -10263,75 +10908,6 @@ public SystemCreatedStorageAccount() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class TableFixedParameters : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public TableFixedParameters() { } - public string Booster { get { throw null; } set { } } - public string BoostingType { get { throw null; } set { } } - public string GrowPolicy { get { throw null; } set { } } - public double? LearningRate { get { throw null; } set { } } - public int? MaxBin { get { throw null; } set { } } - public int? MaxDepth { get { throw null; } set { } } - public int? MaxLeaves { get { throw null; } set { } } - public int? MinDataInLeaf { get { throw null; } set { } } - public double? MinSplitGain { get { throw null; } set { } } - public string ModelName { get { throw null; } set { } } - public int? NEstimators { get { throw null; } set { } } - public int? NumLeaves { get { throw null; } set { } } - public string PreprocessorName { get { throw null; } set { } } - public double? RegAlpha { get { throw null; } set { } } - public double? RegLambda { get { throw null; } set { } } - public double? Subsample { get { throw null; } set { } } - public double? SubsampleFreq { get { throw null; } set { } } - public string TreeMethod { get { throw null; } set { } } - public bool? WithMean { get { throw null; } set { } } - public bool? WithStd { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.TableFixedParameters System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.TableFixedParameters System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class TableParameterSubspace : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public TableParameterSubspace() { } - public string Booster { get { throw null; } set { } } - public string BoostingType { get { throw null; } set { } } - public string GrowPolicy { get { throw null; } set { } } - public string LearningRate { get { throw null; } set { } } - public string MaxBin { get { throw null; } set { } } - public string MaxDepth { get { throw null; } set { } } - public string MaxLeaves { get { throw null; } set { } } - public string MinDataInLeaf { get { throw null; } set { } } - public string MinSplitGain { get { throw null; } set { } } - public string ModelName { get { throw null; } set { } } - public string NEstimators { get { throw null; } set { } } - public string NumLeaves { get { throw null; } set { } } - public string PreprocessorName { get { throw null; } set { } } - public string RegAlpha { get { throw null; } set { } } - public string RegLambda { get { throw null; } set { } } - public string Subsample { get { throw null; } set { } } - public string SubsampleFreq { get { throw null; } set { } } - public string TreeMethod { get { throw null; } set { } } - public string WithMean { get { throw null; } set { } } - public string WithStd { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.TableParameterSubspace System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.TableParameterSubspace System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class TableSweepSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public TableSweepSettings(Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithmType samplingAlgorithm) { } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningEarlyTerminationPolicy EarlyTermination { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithmType SamplingAlgorithm { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.TableSweepSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.TableSweepSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class TableVerticalFeaturizationSettings : Azure.ResourceManager.MachineLearning.Models.MachineLearningFeaturizationSettings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public TableVerticalFeaturizationSettings() { } @@ -10353,10 +10929,7 @@ public TableVerticalLimitSettings() { } public double? ExitScore { get { throw null; } set { } } public int? MaxConcurrentTrials { get { throw null; } set { } } public int? MaxCoresPerTrial { get { throw null; } set { } } - public int? MaxNodes { get { throw null; } set { } } public int? MaxTrials { get { throw null; } set { } } - public int? SweepConcurrentTrials { get { throw null; } set { } } - public int? SweepTrials { get { throw null; } set { } } public System.TimeSpan? Timeout { get { throw null; } set { } } public System.TimeSpan? TrialTimeout { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.TableVerticalLimitSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -10415,33 +10988,12 @@ public TensorFlowDistributionConfiguration() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct TextAnnotationType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public TextAnnotationType(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.TextAnnotationType Classification { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.TextAnnotationType NamedEntityRecognition { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.TextAnnotationType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.TextAnnotationType left, Azure.ResourceManager.MachineLearning.Models.TextAnnotationType right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.TextAnnotationType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.TextAnnotationType left, Azure.ResourceManager.MachineLearning.Models.TextAnnotationType right) { throw null; } - public override string ToString() { throw null; } - } public partial class TextClassification : Azure.ResourceManager.MachineLearning.Models.AutoMLVertical, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public TextClassification(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData) : base (default(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput)) { } public string FeaturizationDatasetLanguage { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.NlpFixedParameters FixedParameters { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings LimitSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ClassificationPrimaryMetric? PrimaryMetric { get { throw null; } set { } } - public System.Collections.Generic.IList SearchSpace { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.NlpSweepSettings SweepSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput ValidationData { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.TextClassification System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -10453,11 +11005,8 @@ public partial class TextClassificationMultilabel : Azure.ResourceManager.Machin { public TextClassificationMultilabel(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData) : base (default(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput)) { } public string FeaturizationDatasetLanguage { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.NlpFixedParameters FixedParameters { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings LimitSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ClassificationMultilabelPrimaryMetric? PrimaryMetric { get { throw null; } } - public System.Collections.Generic.IList SearchSpace { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.NlpSweepSettings SweepSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput ValidationData { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.TextClassificationMultilabel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -10469,11 +11018,8 @@ public partial class TextNer : Azure.ResourceManager.MachineLearning.Models.Auto { public TextNer(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData) : base (default(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput)) { } public string FeaturizationDatasetLanguage { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.NlpFixedParameters FixedParameters { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings LimitSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ClassificationPrimaryMetric? PrimaryMetric { get { throw null; } } - public System.Collections.Generic.IList SearchSpace { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.NlpSweepSettings SweepSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput ValidationData { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.TextNer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -10491,47 +11037,6 @@ public TopNFeaturesByAttribution() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class TrailingInputData : Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public TrailingInputData(Azure.ResourceManager.MachineLearning.Models.JobInputType jobInputType, System.Uri uri, System.TimeSpan windowOffset, System.TimeSpan windowSize) : base (default(Azure.ResourceManager.MachineLearning.Models.JobInputType), default(System.Uri)) { } - public string PreprocessingComponentId { get { throw null; } set { } } - public System.TimeSpan WindowOffset { get { throw null; } set { } } - public System.TimeSpan WindowSize { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.TrailingInputData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.TrailingInputData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct TrainingMode : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public TrainingMode(string value) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.TrainingMode Auto { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.TrainingMode Distributed { get { throw null; } } - public static Azure.ResourceManager.MachineLearning.Models.TrainingMode NonDistributed { get { throw null; } } - public bool Equals(Azure.ResourceManager.MachineLearning.Models.TrainingMode other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.TrainingMode left, Azure.ResourceManager.MachineLearning.Models.TrainingMode right) { throw null; } - public static implicit operator Azure.ResourceManager.MachineLearning.Models.TrainingMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.TrainingMode left, Azure.ResourceManager.MachineLearning.Models.TrainingMode right) { throw null; } - public override string ToString() { throw null; } - } - public partial class TritonInferencingServer : Azure.ResourceManager.MachineLearning.Models.InferencingServer, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public TritonInferencingServer() { } - public Azure.ResourceManager.MachineLearning.Models.OnlineInferenceConfiguration InferenceConfiguration { get { throw null; } set { } } - Azure.ResourceManager.MachineLearning.Models.TritonInferencingServer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.MachineLearning.Models.TritonInferencingServer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class TruncationSelectionPolicy : Azure.ResourceManager.MachineLearning.Models.MachineLearningEarlyTerminationPolicy, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public TruncationSelectionPolicy() { } @@ -10610,6 +11115,23 @@ public WorkspaceConnectionAccessKey() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class WorkspaceConnectionOAuth2 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WorkspaceConnectionOAuth2() { } + public System.Uri AuthUri { get { throw null; } set { } } + public System.Guid? ClientId { get { throw null; } set { } } + public string ClientSecret { get { throw null; } set { } } + public string DeveloperToken { get { throw null; } set { } } + public string Password { get { throw null; } set { } } + public string RefreshToken { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + public string Username { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.WorkspaceConnectionOAuth2 System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.WorkspaceConnectionOAuth2 System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class WorkspaceConnectionServicePrincipal : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public WorkspaceConnectionServicePrincipal() { } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResource.cs new file mode 100644 index 0000000000000..b85a2edf37c27 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResource.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_EndpointResourcePropertiesBasicResource + { + // Get Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/get.json + // this example is just showing the usage of "Endpoint_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation + EndpointResourcePropertiesBasicResource result = await endpointResourcePropertiesBasicResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/create.json + // this example is just showing the usage of "Endpoint_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation + EndpointResourcePropertiesBasicResourceData data = new EndpointResourcePropertiesBasicResourceData(new OpenAIEndpointResourceProperties() + { + AssociatedResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/test-rg/providers/Microsoft.CognitiveService/account/account-1"), + Name = "Azure.OpenAI", + }); + ArmOperation lro = await endpointResourcePropertiesBasicResource.UpdateAsync(WaitUntil.Completed, data); + EndpointResourcePropertiesBasicResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // List Endpoint Keys + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetKeys_ListEndpointKeys() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/listKeys.json + // this example is just showing the usage of "Endpoint_ListKeys" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation + EndpointKeys result = await endpointResourcePropertiesBasicResource.GetKeysAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Endpoint Models + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetModels_GetEndpointModels() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/getModels.json + // this example is just showing the usage of "Endpoint_GetModels" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation and iterate over the result + await foreach (EndpointModelProperties item in endpointResourcePropertiesBasicResource.GetModelsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Regenerate Endpoint Keys + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task RegenerateKeys_RegenerateEndpointKeys() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/regenerateKey.json + // this example is just showing the usage of "Endpoint_RegenerateKeys" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation + RegenerateServiceAccountKeyContent content = new RegenerateServiceAccountKeyContent() + { + KeyName = ServiceAccountKeyName.Key1, + }; + AccountApiKeys result = await endpointResourcePropertiesBasicResource.RegenerateKeysAsync(content); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResourceCollection.cs new file mode 100644 index 0000000000000..c87bb000906f4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResourceCollection.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_EndpointResourcePropertiesBasicResourceCollection + { + // List Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/list.json + // this example is just showing the usage of "Endpoint_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation and iterate over the result + EndpointType? endpointType = EndpointType.AzureOpenAI; + string skip = "skip_string"; + await foreach (EndpointResourcePropertiesBasicResource item in collection.GetAllAsync(endpointType: endpointType, skip: skip)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointResourcePropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/get.json + // this example is just showing the usage of "Endpoint_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation + string endpointName = "Azure.OpenAI"; + EndpointResourcePropertiesBasicResource result = await collection.GetAsync(endpointName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/get.json + // this example is just showing the usage of "Endpoint_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation + string endpointName = "Azure.OpenAI"; + bool result = await collection.ExistsAsync(endpointName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/get.json + // this example is just showing the usage of "Endpoint_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation + string endpointName = "Azure.OpenAI"; + NullableResponse response = await collection.GetIfExistsAsync(endpointName); + EndpointResourcePropertiesBasicResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/create.json + // this example is just showing the usage of "Endpoint_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation + string endpointName = "Azure.OpenAI"; + EndpointResourcePropertiesBasicResourceData data = new EndpointResourcePropertiesBasicResourceData(new OpenAIEndpointResourceProperties() + { + AssociatedResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/test-rg/providers/Microsoft.CognitiveService/account/account-1"), + Name = "Azure.OpenAI", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointName, data); + EndpointResourcePropertiesBasicResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerCollection.cs index 358b9768eef64..b037335159a1d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearninRegistryComponentContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/list.json // this example is just showing the usage of "RegistryComponentContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_ListRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/get.json // this example is just showing the usage of "RegistryComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/get.json // this example is just showing the usage of "RegistryComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/get.json // this example is just showing the usage of "RegistryComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/createOrUpdate.json // this example is just showing the usage of "RegistryComponentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerResource.cs index e313a64b2aa4b..31468d1db6a45 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearninRegistryComponentContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/delete.json // this example is just showing the usage of "RegistryComponentContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/get.json // this example is just showing the usage of "RegistryComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/createOrUpdate.json // this example is just showing the usage of "RegistryComponentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionCollection.cs index 805397cd3a9e5..a1abf8574e176 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearninRegistryComponentVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/list.json // this example is just showing the usage of "RegistryComponentVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task GetAll_ListRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/get.json // this example is just showing the usage of "RegistryComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_GetRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/get.json // this example is just showing the usage of "RegistryComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task Exists_GetRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/get.json // this example is just showing the usage of "RegistryComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +173,7 @@ public async Task GetIfExists_GetRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/createOrUpdate.json // this example is just showing the usage of "RegistryComponentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionResource.cs index 4f3ae02c632b0..13c4cf31e577e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearninRegistryComponentVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/delete.json // this example is just showing the usage of "RegistryComponentVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Delete_DeleteRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/get.json // this example is just showing the usage of "RegistryComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task Get_GetRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/createOrUpdate.json // this example is just showing the usage of "RegistryComponentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentCollection.cs index 2ed214013cd40..a410a3bd78b90 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_MachineLearningBatchDeploymentCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/list.json // this example is just showing the usage of "BatchDeployments_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task GetAll_ListWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/get.json // this example is just showing the usage of "BatchDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task Get_GetWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/get.json // this example is just showing the usage of "BatchDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task Exists_GetWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/get.json // this example is just showing the usage of "BatchDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -175,7 +175,7 @@ public async Task GetIfExists_GetWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/createOrUpdate.json // this example is just showing the usage of "BatchDeployments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentResource.cs index 5d7c84a31476c..120915ad21fe4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningBatchDeploymentResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/delete.json // this example is just showing the usage of "BatchDeployments_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/get.json // this example is just showing the usage of "BatchDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/update.json // this example is just showing the usage of "BatchDeployments_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointCollection.cs index ad51d10f136f0..2a562c959df9e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningBatchEndpointCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/list.json // this example is just showing the usage of "BatchEndpoints_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_ListWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/get.json // this example is just showing the usage of "BatchEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/get.json // this example is just showing the usage of "BatchEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Exists_GetWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/get.json // this example is just showing the usage of "BatchEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task GetIfExists_GetWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/createOrUpdate.json // this example is just showing the usage of "BatchEndpoints_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointResource.cs index fa2b890474d5e..426ea064a7c90 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningBatchEndpointResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/delete.json // this example is just showing the usage of "BatchEndpoints_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/get.json // this example is just showing the usage of "BatchEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +81,7 @@ public async Task Get_GetWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/update.json // this example is just showing the usage of "BatchEndpoints_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task Update_UpdateWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListKeysWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/listKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/listKeys.json // this example is just showing the usage of "BatchEndpoints_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerCollection.cs index 85fd962527603..fbc05457edd07 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningCodeContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/list.json // this example is just showing the usage of "CodeContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_ListWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/get.json // this example is just showing the usage of "CodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/get.json // this example is just showing the usage of "CodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/get.json // this example is just showing the usage of "CodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/createOrUpdate.json // this example is just showing the usage of "CodeContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerResource.cs index ff117e0d7a303..e8f668094ce90 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningCodeContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/delete.json // this example is just showing the usage of "CodeContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/get.json // this example is just showing the usage of "CodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/createOrUpdate.json // this example is just showing the usage of "CodeContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionCollection.cs index 9ca9eb2efb7ed..58eca4e07e99d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningCodeVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/list.json // this example is just showing the usage of "CodeVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_ListWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/get.json // this example is just showing the usage of "CodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_GetWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/get.json // this example is just showing the usage of "CodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task Exists_GetWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/get.json // this example is just showing the usage of "CodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +172,7 @@ public async Task GetIfExists_GetWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/createOrUpdate.json // this example is just showing the usage of "CodeVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionResource.cs index b6dd152dd3706..9c6db8418b8de 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningCodeVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/delete.json // this example is just showing the usage of "CodeVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/get.json // this example is just showing the usage of "CodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/createOrUpdate.json // this example is just showing the usage of "CodeVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,12 +125,47 @@ public async Task Update_CreateOrUpdateWorkspaceCodeVersion() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Publish Workspace Code Version. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Publish_PublishWorkspaceCodeVersion() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/publish.json + // this example is just showing the usage of "CodeVersions_Publish" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningCodeVersionResource created on azure + // for more information of creating MachineLearningCodeVersionResource, please refer to the document of MachineLearningCodeVersionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + string version = "string"; + ResourceIdentifier machineLearningCodeVersionResourceId = MachineLearningCodeVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name, version); + MachineLearningCodeVersionResource machineLearningCodeVersion = client.GetMachineLearningCodeVersionResource(machineLearningCodeVersionResourceId); + + // invoke the operation + DestinationAsset body = new DestinationAsset() + { + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", + }; + await machineLearningCodeVersion.PublishAsync(WaitUntil.Completed, body); + + Console.WriteLine($"Succeeded"); + } + // CreateOrGetStartPendingUpload Workspace Code Version. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/createOrGetStartPendingUpload.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/createOrGetStartPendingUpload.json // this example is just showing the usage of "CodeVersions_CreateOrGetStartPendingUpload" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -152,7 +187,7 @@ public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadWor PendingUploadRequestDto body = new PendingUploadRequestDto() { PendingUploadId = "string", - PendingUploadType = PendingUploadType.TemporaryBlobReference, + PendingUploadType = PendingUploadType.None, }; PendingUploadResponseDto result = await machineLearningCodeVersion.CreateOrGetStartPendingUploadAsync(body); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerCollection.cs index b1674dc96de40..1f34c30936247 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningComponentContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/list.json // this example is just showing the usage of "ComponentContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_ListWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/get.json // this example is just showing the usage of "ComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/get.json // this example is just showing the usage of "ComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/get.json // this example is just showing the usage of "ComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/createOrUpdate.json // this example is just showing the usage of "ComponentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerResource.cs index 60097ab23f19a..d292981d4f427 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningComponentContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/delete.json // this example is just showing the usage of "ComponentContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/get.json // this example is just showing the usage of "ComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/createOrUpdate.json // this example is just showing the usage of "ComponentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionCollection.cs index b9147859d58b9..0e269451ac340 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningComponentVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/list.json // this example is just showing the usage of "ComponentVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task GetAll_ListWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/get.json // this example is just showing the usage of "ComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_GetWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/get.json // this example is just showing the usage of "ComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task Exists_GetWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/get.json // this example is just showing the usage of "ComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +173,7 @@ public async Task GetIfExists_GetWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/createOrUpdate.json // this example is just showing the usage of "ComponentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionResource.cs index 6768ffbba8889..957b44d9bcaeb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningComponentVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/delete.json // this example is just showing the usage of "ComponentVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Delete_DeleteWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/get.json // this example is just showing the usage of "ComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task Get_GetWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/createOrUpdate.json // this example is just showing the usage of "ComponentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,5 +128,40 @@ public async Task Update_CreateOrUpdateWorkspaceComponentVersion() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // Publish Workspace Component Version. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Publish_PublishWorkspaceComponentVersion() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/publish.json + // this example is just showing the usage of "ComponentVersions_Publish" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComponentVersionResource created on azure + // for more information of creating MachineLearningComponentVersionResource, please refer to the document of MachineLearningComponentVersionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + string version = "string"; + ResourceIdentifier machineLearningComponentVersionResourceId = MachineLearningComponentVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name, version); + MachineLearningComponentVersionResource machineLearningComponentVersion = client.GetMachineLearningComponentVersionResource(machineLearningComponentVersionResourceId); + + // invoke the operation + DestinationAsset body = new DestinationAsset() + { + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", + }; + await machineLearningComponentVersion.PublishAsync(WaitUntil.Completed, body); + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs index ce39b03be9fa4..941b234767a73 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningComputeCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetComputes() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/list.json // this example is just showing the usage of "Compute_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_GetComputes() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAAKSCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AKSCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AKSCompute.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_GetAAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAAKSCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AKSCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AKSCompute.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Exists_GetAAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAAKSCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AKSCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AKSCompute.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task GetIfExists_GetAAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAAMLCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AmlCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AmlCompute.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -202,7 +202,7 @@ public async Task Get_GetAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAAMLCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AmlCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AmlCompute.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -233,7 +233,7 @@ public async Task Exists_GetAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAAMLCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AmlCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AmlCompute.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -276,7 +276,7 @@ public async Task GetIfExists_GetAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAKubernetesCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/KubernetesCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/KubernetesCompute.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -311,7 +311,7 @@ public async Task Get_GetAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAKubernetesCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/KubernetesCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/KubernetesCompute.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -342,7 +342,7 @@ public async Task Exists_GetAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAKubernetesCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/KubernetesCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/KubernetesCompute.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -385,7 +385,7 @@ public async Task GetIfExists_GetAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnComputeInstance() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/ComputeInstance.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/ComputeInstance.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -420,7 +420,7 @@ public async Task Get_GetAnComputeInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAnComputeInstance() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/ComputeInstance.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/ComputeInstance.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -451,7 +451,7 @@ public async Task Exists_GetAnComputeInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAnComputeInstance() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/ComputeInstance.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/ComputeInstance.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -494,7 +494,7 @@ public async Task GetIfExists_GetAnComputeInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_AttachAKubernetesCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/KubernetesCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/KubernetesCompute.json // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -567,7 +567,7 @@ public async Task CreateOrUpdate_AttachAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAAMLCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/BasicAmlCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/BasicAmlCompute.json // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -624,7 +624,7 @@ public async Task CreateOrUpdate_CreateAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateADataFactoryCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -664,7 +664,7 @@ public async Task CreateOrUpdate_CreateADataFactoryCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnAKSCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/BasicAKSCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/BasicAKSCompute.json // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -704,7 +704,7 @@ public async Task CreateOrUpdate_CreateAnAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnComputeInstanceCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/ComputeInstance.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/ComputeInstance.json // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -782,9 +782,22 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceCompute() Target = "/home/testuser/", } }, +Kernel = new JupyterKernelConfig() +{ +Argv = +{ +"option1","option2","option3" +}, +DisplayName = "TestKernel", +Language = "python", +}, } }, ComputeInstanceAuthorizationType = MachineLearningComputeInstanceAuthorizationType.Personal, + EnableOSPatching = true, + EnableRootAccess = true, + EnableSso = true, + ReleaseQuotaOnStop = true, PersonalComputeInstanceAssignedUser = new MachineLearningComputeInstanceAssignedUser("00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000")), }, }, @@ -804,7 +817,7 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithSchedules() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -857,7 +870,7 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithSchedules() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithMinimalInputs() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -903,7 +916,7 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithMinimalInputs [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdateAAMLCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/AmlCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/AmlCompute.json // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -954,7 +967,7 @@ public async Task CreateOrUpdate_UpdateAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdateAnAKSCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/AKSCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/AKSCompute.json // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeResource.cs index 1b877c7c410bd..31e2e2a57a790 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeResource.cs @@ -22,7 +22,7 @@ public partial class Sample_MachineLearningComputeResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAAKSCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AKSCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AKSCompute.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_GetAAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAAMLCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AmlCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AmlCompute.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Get_GetAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAKubernetesCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/KubernetesCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/KubernetesCompute.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -118,7 +118,7 @@ public async Task Get_GetAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnComputeInstance() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/ComputeInstance.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/ComputeInstance.json // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -150,7 +150,7 @@ public async Task Get_GetAnComputeInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAAmlComputeCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/patch.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/patch.json // this example is just showing the usage of "Compute_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -191,7 +191,7 @@ public async Task Update_UpdateAAmlComputeCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/delete.json // this example is just showing the usage of "Compute_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -220,7 +220,7 @@ public async Task Delete_DeleteCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpdateCustomServices_UpdateCustomServices() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/updateCustomServices.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/updateCustomServices.json // this example is just showing the usage of "Compute_UpdateCustomServices" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -293,7 +293,7 @@ public async Task UpdateCustomServices_UpdateCustomServices() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNodes_GetComputeNodesInformationForACompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/listNodes.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/listNodes.json // this example is just showing the usage of "Compute_ListNodes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -324,7 +324,7 @@ public async Task GetNodes_GetComputeNodesInformationForACompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListAKSComputeKeys() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/listKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/listKeys.json // this example is just showing the usage of "Compute_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -347,12 +347,52 @@ public async Task GetKeys_ListAKSComputeKeys() Console.WriteLine($"Succeeded: {result}"); } + // Update Data Mounts + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task UpdateDataMounts_UpdateDataMounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/updateDataMounts.json + // this example is just showing the usage of "Compute_UpdateDataMounts" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComputeResource created on azure + // for more information of creating MachineLearningComputeResource, please refer to the document of MachineLearningComputeResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + string computeName = "compute123"; + ResourceIdentifier machineLearningComputeResourceId = MachineLearningComputeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, computeName); + MachineLearningComputeResource machineLearningCompute = client.GetMachineLearningComputeResource(machineLearningComputeResourceId); + + // invoke the operation + IEnumerable dataMounts = new MachineLearningComputeInstanceDataMount[] + { +new MachineLearningComputeInstanceDataMount() +{ +Source = "azureml://subscriptions/some-sub/resourcegroups/some-rg/workspaces/some-ws/data/some-data-asset-name/versions/some-data-asset-version", +SourceType = MachineLearningSourceType.Uri, +MountName = "hello", +MountAction = MachineLearningMountAction.Mount, +MountMode = MountMode.ReadOnly, +MountPath = "/some/random/path/on/host", +} + }; + await machineLearningCompute.UpdateDataMountsAsync(dataMounts); + + Console.WriteLine($"Succeeded"); + } + // Start ComputeInstance Compute [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Start_StartComputeInstanceCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/start.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/start.json // this example is just showing the usage of "Compute_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -380,7 +420,7 @@ public async Task Start_StartComputeInstanceCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Stop_StopComputeInstanceCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/stop.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/stop.json // this example is just showing the usage of "Compute_Stop" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -408,7 +448,7 @@ public async Task Stop_StopComputeInstanceCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_RestartComputeInstanceCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/restart.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/restart.json // this example is just showing the usage of "Compute_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -436,7 +476,7 @@ public async Task Restart_RestartComputeInstanceCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpdateIdleShutdownSetting_UpdateIdleShutdownSettingOfComputeInstance() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/updateIdleShutdownSetting.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/updateIdleShutdownSetting.json // this example is just showing the usage of "Compute_UpdateIdleShutdownSetting" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -462,5 +502,68 @@ public async Task UpdateIdleShutdownSetting_UpdateIdleShutdownSettingOfComputeIn Console.WriteLine($"Succeeded"); } + + // List VM Sizes + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAllowedResizeSizes_ListVMSizes() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/getAllowedVMSizesForResize.json + // this example is just showing the usage of "Compute_GetAllowedResizeSizes" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComputeResource created on azure + // for more information of creating MachineLearningComputeResource, please refer to the document of MachineLearningComputeResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + string computeName = "compute123"; + ResourceIdentifier machineLearningComputeResourceId = MachineLearningComputeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, computeName); + MachineLearningComputeResource machineLearningCompute = client.GetMachineLearningComputeResource(machineLearningComputeResourceId); + + // invoke the operation and iterate over the result + await foreach (MachineLearningVmSize item in machineLearningCompute.GetAllowedResizeSizesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // List VM Sizes + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Resize_ListVMSizes() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/resize.json + // this example is just showing the usage of "Compute_Resize" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComputeResource created on azure + // for more information of creating MachineLearningComputeResource, please refer to the document of MachineLearningComputeResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + string computeName = "compute123"; + ResourceIdentifier machineLearningComputeResourceId = MachineLearningComputeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, computeName); + MachineLearningComputeResource machineLearningCompute = client.GetMachineLearningComputeResource(machineLearningComputeResourceId); + + // invoke the operation + ResizeSchema resizeSchema = new ResizeSchema() + { + TargetVmSize = "Standard_DS11_v2", + }; + await machineLearningCompute.ResizeAsync(WaitUntil.Completed, resizeSchema); + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerCollection.cs index 44231630d0c08..3937c29f1adbf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningDataContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/list.json // this example is just showing the usage of "DataContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_ListWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/get.json // this example is just showing the usage of "DataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/get.json // this example is just showing the usage of "DataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/get.json // this example is just showing the usage of "DataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/createOrUpdate.json // this example is just showing the usage of "DataContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerResource.cs index 866afb33a81d8..492a2a6af754b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningDataContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/delete.json // this example is just showing the usage of "DataContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/get.json // this example is just showing the usage of "DataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/createOrUpdate.json // this example is just showing the usage of "DataContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionCollection.cs index 279f665d7943a..c3539c21473c0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningDataVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/list.json // this example is just showing the usage of "DataVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -41,8 +41,10 @@ public async Task GetAll_ListWorkspaceDataVersionBase() MachineLearningDataVersionCollection collection = machineLearningDataContainer.GetMachineLearningDataVersions(); // invoke the operation and iterate over the result - MachineLearningDataVersionCollectionGetAllOptions options = new MachineLearningDataVersionCollectionGetAllOptions() { OrderBy = "string", Top = 1, Tags = "string" }; - await foreach (MachineLearningDataVersionResource item in collection.GetAllAsync(options)) + string orderBy = "string"; + int? top = 1; + string tags = "string"; + await foreach (MachineLearningDataVersionResource item in collection.GetAllAsync(orderBy: orderBy, top: top, tags: tags)) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -59,7 +61,7 @@ public async Task GetAll_ListWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/get.json // this example is just showing the usage of "DataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +97,7 @@ public async Task Get_GetWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/get.json // this example is just showing the usage of "DataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +129,7 @@ public async Task Exists_GetWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/get.json // this example is just showing the usage of "DataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +173,7 @@ public async Task GetIfExists_GetWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/createOrUpdate.json // this example is just showing the usage of "DataVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionResource.cs index 7d8a7d6ade0d3..b7d2f6e815957 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningDataVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/delete.json // this example is just showing the usage of "DataVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/get.json // this example is just showing the usage of "DataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/createOrUpdate.json // this example is just showing the usage of "DataVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,5 +123,40 @@ public async Task Update_CreateOrUpdateWorkspaceDataVersionBase() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // Publish Workspace Data Version Base. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Publish_PublishWorkspaceDataVersionBase() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/publish.json + // this example is just showing the usage of "DataVersions_Publish" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningDataVersionResource created on azure + // for more information of creating MachineLearningDataVersionResource, please refer to the document of MachineLearningDataVersionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + string version = "string"; + ResourceIdentifier machineLearningDataVersionResourceId = MachineLearningDataVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name, version); + MachineLearningDataVersionResource machineLearningDataVersion = client.GetMachineLearningDataVersionResource(machineLearningDataVersionResourceId); + + // invoke the operation + DestinationAsset body = new DestinationAsset() + { + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", + }; + await machineLearningDataVersion.PublishAsync(WaitUntil.Completed, body); + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreCollection.cs index 03c06dfd3d4bd..7af753635dc01 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningDatastoreCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDatastore() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/get.json // this example is just showing the usage of "Datastores_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetDatastore() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/get.json // this example is just showing the usage of "Datastores_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Exists_GetDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetDatastore() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/get.json // this example is just showing the usage of "Datastores_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetIfExists_GetDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureDataLakeGen1WServicePrincipal() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -184,7 +184,7 @@ public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureDataLakeGen1WServic [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureDataLakeGen2WServicePrincipal() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -241,7 +241,7 @@ public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureDataLakeGen2WServic [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureFileStoreWAccountKey() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -294,7 +294,7 @@ public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureFileStoreWAccountKe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureBlobWAccountKey() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreResource.cs index 13fdf9376fbd3..fdd397e1bbb22 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningDatastoreResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteDatastore() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/delete.json // this example is just showing the usage of "Datastores_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDatastore() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/get.json // this example is just showing the usage of "Datastores_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateDatastoreAzureDataLakeGen1WServicePrincipal() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +132,7 @@ public async Task Update_CreateOrUpdateDatastoreAzureDataLakeGen1WServicePrincip [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateDatastoreAzureDataLakeGen2WServicePrincipal() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -186,7 +186,7 @@ public async Task Update_CreateOrUpdateDatastoreAzureDataLakeGen2WServicePrincip [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateDatastoreAzureFileStoreWAccountKey() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -236,7 +236,7 @@ public async Task Update_CreateOrUpdateDatastoreAzureFileStoreWAccountKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateDatastoreAzureBlobWAccountKey() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -288,7 +288,7 @@ public async Task Update_CreateOrUpdateDatastoreAzureBlobWAccountKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSecrets_GetDatastoreSecrets() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/listSecrets.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/listSecrets.json // this example is just showing the usage of "Datastores_ListSecrets" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -306,7 +306,12 @@ public async Task GetSecrets_GetDatastoreSecrets() MachineLearningDatastoreResource machineLearningDatastore = client.GetMachineLearningDatastoreResource(machineLearningDatastoreResourceId); // invoke the operation - MachineLearningDatastoreSecrets result = await machineLearningDatastore.GetSecretsAsync(); + SecretExpiry body = new SecretExpiry() + { + ExpirableSecret = false, + ExpireAfterHours = 1, + }; + MachineLearningDatastoreSecrets result = await machineLearningDatastore.GetSecretsAsync(body: body); Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerCollection.cs index 054896ffd3680..210023b977225 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningEnvironmentContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/list.json // this example is just showing the usage of "EnvironmentContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_ListWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/get.json // this example is just showing the usage of "EnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/get.json // this example is just showing the usage of "EnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/get.json // this example is just showing the usage of "EnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json // this example is just showing the usage of "EnvironmentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerResource.cs index b1a518198faaf..3b19437c84b96 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningEnvironmentContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/delete.json // this example is just showing the usage of "EnvironmentContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/get.json // this example is just showing the usage of "EnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json // this example is just showing the usage of "EnvironmentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionCollection.cs index aa45f79c4bc35..240f5fc7f67fa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningEnvironmentVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/list.json // this example is just showing the usage of "EnvironmentVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_ListWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/get.json // this example is just showing the usage of "EnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_GetWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/get.json // this example is just showing the usage of "EnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task Exists_GetWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/get.json // this example is just showing the usage of "EnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +172,7 @@ public async Task GetIfExists_GetWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json // this example is just showing the usage of "EnvironmentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionResource.cs index 3fbcb0eac6307..e27a0544fdb0a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningEnvironmentVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/delete.json // this example is just showing the usage of "EnvironmentVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/get.json // this example is just showing the usage of "EnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json // this example is just showing the usage of "EnvironmentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,5 +135,40 @@ public async Task Update_CreateOrUpdateWorkspaceEnvironmentVersion() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // Publish Workspace Environment Version. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Publish_PublishWorkspaceEnvironmentVersion() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/publish.json + // this example is just showing the usage of "EnvironmentVersions_Publish" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningEnvironmentVersionResource created on azure + // for more information of creating MachineLearningEnvironmentVersionResource, please refer to the document of MachineLearningEnvironmentVersionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + string version = "string"; + ResourceIdentifier machineLearningEnvironmentVersionResourceId = MachineLearningEnvironmentVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name, version); + MachineLearningEnvironmentVersionResource machineLearningEnvironmentVersion = client.GetMachineLearningEnvironmentVersionResource(machineLearningEnvironmentVersionResourceId); + + // invoke the operation + DestinationAsset body = new DestinationAsset() + { + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", + }; + await machineLearningEnvironmentVersion.PublishAsync(WaitUntil.Completed, body); + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureCollection.cs index 71451ff7433c3..cb63f4b174632 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; namespace Azure.ResourceManager.MachineLearning.Samples { @@ -19,7 +20,7 @@ public partial class Sample_MachineLearningFeatureCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListFeature() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Feature/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/list.json // this example is just showing the usage of "Features_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -41,10 +42,8 @@ public async Task GetAll_ListFeature() MachineLearningFeatureCollection collection = machineLearningFeatureSetVersion.GetMachineLearningFeatures(); // invoke the operation and iterate over the result - string tags = "string"; - string featureName = "string"; - string description = "string"; - await foreach (MachineLearningFeatureResource item in collection.GetAllAsync(tags: tags, featureName: featureName, description: description)) + MachineLearningFeatureCollectionGetAllOptions options = new MachineLearningFeatureCollectionGetAllOptions() { Tags = "string", FeatureName = "string", Description = "string" }; + await foreach (MachineLearningFeatureResource item in collection.GetAllAsync(options)) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -61,7 +60,7 @@ public async Task GetAll_ListFeature() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetFeature() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Feature/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/get.json // this example is just showing the usage of "Features_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +97,7 @@ public async Task Get_GetFeature() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetFeature() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Feature/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/get.json // this example is just showing the usage of "Features_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +130,7 @@ public async Task Exists_GetFeature() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetFeature() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Feature/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/get.json // this example is just showing the usage of "Features_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureResource.cs index 31d43d88a4f59..345ad94183b7b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureResource.cs @@ -19,7 +19,7 @@ public partial class Sample_MachineLearningFeatureResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetFeature() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Feature/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/get.json // this example is just showing the usage of "Features_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerCollection.cs index de134c2fed8c3..4910280ac2ab7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeatureSetContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/list.json // this example is just showing the usage of "FeaturesetContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_ListWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEntityWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json // this example is just showing the usage of "FeaturesetContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_GetEntityWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetEntityWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json // this example is just showing the usage of "FeaturesetContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Exists_GetEntityWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetEntityWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json // this example is just showing the usage of "FeaturesetContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task GetIfExists_GetEntityWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json // this example is just showing the usage of "FeaturesetContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerResource.cs index 90fa83d23d450..c98876f53bd37 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeatureSetContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/delete.json // this example is just showing the usage of "FeaturesetContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEntityWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json // this example is just showing the usage of "FeaturesetContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetEntityWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json // this example is just showing the usage of "FeaturesetContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionCollection.cs index 328edb827c948..017cf5f9f64f7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeatureSetVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/list.json // this example is just showing the usage of "FeaturesetVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_ListWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/get.json // this example is just showing the usage of "FeaturesetVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Get_GetWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/get.json // this example is just showing the usage of "FeaturesetVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task Exists_GetWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/get.json // this example is just showing the usage of "FeaturesetVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +171,7 @@ public async Task GetIfExists_GetWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json // this example is just showing the usage of "FeaturesetVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionResource.cs index 5ed2a6230139d..0322fbecb1c2d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeatureSetVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/delete.json // this example is just showing the usage of "FeaturesetVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/get.json // this example is just showing the usage of "FeaturesetVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json // this example is just showing the usage of "FeaturesetVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -179,7 +179,7 @@ public async Task Update_CreateOrUpdateWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Backfill_BackfillWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/backfill.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/backfill.json // this example is just showing the usage of "FeaturesetVersions_Backfill" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -200,6 +200,10 @@ public async Task Backfill_BackfillWorkspaceFeaturesetVersion() // invoke the operation FeatureSetVersionBackfillContent content = new FeatureSetVersionBackfillContent() { + DataAvailabilityStatus = +{ +DataAvailabilityStatus.None +}, Description = "string", DisplayName = "string", FeatureWindow = new FeatureWindow() @@ -207,6 +211,7 @@ public async Task Backfill_BackfillWorkspaceFeaturesetVersion() FeatureWindowEnd = DateTimeOffset.Parse("2020-01-01T12:34:56.999+00:51"), FeatureWindowStart = DateTimeOffset.Parse("2020-01-01T12:34:56.999+00:51"), }, + JobId = "string", ResourceInstanceType = "string", SparkConfiguration = { @@ -217,45 +222,10 @@ public async Task Backfill_BackfillWorkspaceFeaturesetVersion() ["string"] = "string", }, }; - ArmOperation lro = await machineLearningFeatureSetVersion.BackfillAsync(WaitUntil.Completed, content); - MachineLearningFeatureSetJob result = lro.Value; + ArmOperation lro = await machineLearningFeatureSetVersion.BackfillAsync(WaitUntil.Completed, content); + FeaturesetVersionBackfillResponse result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } - - // ListMaterializationJobs Workspace Featureset Version. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetMaterializationJobs_ListMaterializationJobsWorkspaceFeaturesetVersion() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/listMaterializationJobs.json - // this example is just showing the usage of "FeaturesetVersions_ListMaterializationJobs" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningFeatureSetVersionResource created on azure - // for more information of creating MachineLearningFeatureSetVersionResource, please refer to the document of MachineLearningFeatureSetVersionResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "test-rg"; - string workspaceName = "my-aml-workspace"; - string name = "string"; - string version = "string"; - ResourceIdentifier machineLearningFeatureSetVersionResourceId = MachineLearningFeatureSetVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name, version); - MachineLearningFeatureSetVersionResource machineLearningFeatureSetVersion = client.GetMachineLearningFeatureSetVersionResource(machineLearningFeatureSetVersionResourceId); - - // invoke the operation and iterate over the result - string filters = "string"; - string featureWindowStart = "string"; - string featureWindowEnd = "string"; - await foreach (MachineLearningFeatureSetJob item in machineLearningFeatureSetVersion.GetMaterializationJobsAsync(filters: filters, featureWindowStart: featureWindowStart, featureWindowEnd: featureWindowEnd)) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerCollection.cs index 5f0f4bcfabeea..5703389d9baf8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeatureStoreEntityContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/list.json // this example is just showing the usage of "FeaturestoreEntityContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_ListWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEntityWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json // this example is just showing the usage of "FeaturestoreEntityContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_GetEntityWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetEntityWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json // this example is just showing the usage of "FeaturestoreEntityContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Exists_GetEntityWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetEntityWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json // this example is just showing the usage of "FeaturestoreEntityContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task GetIfExists_GetEntityWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json // this example is just showing the usage of "FeaturestoreEntityContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerResource.cs index 43d6f30770ef6..29a8f77229aaf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeatureStoreEntityContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/delete.json // this example is just showing the usage of "FeaturestoreEntityContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEntityWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json // this example is just showing the usage of "FeaturestoreEntityContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetEntityWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json // this example is just showing the usage of "FeaturestoreEntityContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionCollection.cs index 474c9532cdc9e..0c243903be494 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeaturestoreEntityVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/list.json // this example is just showing the usage of "FeaturestoreEntityVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_ListWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json // this example is just showing the usage of "FeaturestoreEntityVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Get_GetWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json // this example is just showing the usage of "FeaturestoreEntityVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task Exists_GetWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json // this example is just showing the usage of "FeaturestoreEntityVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +171,7 @@ public async Task GetIfExists_GetWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json // this example is just showing the usage of "FeaturestoreEntityVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionResource.cs index deb9ac3799a0c..9adb6dc0282e5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeaturestoreEntityVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/delete.json // this example is just showing the usage of "FeaturestoreEntityVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json // this example is just showing the usage of "FeaturestoreEntityVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json // this example is just showing the usage of "FeaturestoreEntityVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobCollection.cs index 73e6c7d1de477..6552673667bc1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_MachineLearningJobCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAutoMLJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/AutoMLJob/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/list.json // this example is just showing the usage of "Jobs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -42,8 +42,7 @@ public async Task GetAll_ListAutoMLJob() MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); // invoke the operation and iterate over the result - MachineLearningJobCollectionGetAllOptions options = new MachineLearningJobCollectionGetAllOptions() { JobType = "string", Tag = "string", ListViewType = MachineLearningListViewType.All, AssetName = "string", Scheduled = false, ScheduleId = "string" }; - await foreach (MachineLearningJobResource item in collection.GetAllAsync(options)) + await foreach (MachineLearningJobResource item in collection.GetAllAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -60,7 +59,7 @@ public async Task GetAll_ListAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListCommandJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/CommandJob/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/list.json // this example is just showing the usage of "Jobs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,8 +79,49 @@ public async Task GetAll_ListCommandJob() MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); // invoke the operation and iterate over the result - MachineLearningJobCollectionGetAllOptions options = new MachineLearningJobCollectionGetAllOptions() { JobType = "string", Tag = "string", ListViewType = MachineLearningListViewType.ActiveOnly, AssetName = "string", Scheduled = false, ScheduleId = "string" }; - await foreach (MachineLearningJobResource item in collection.GetAllAsync(options)) + string jobType = "string"; + string tag = "string"; + await foreach (MachineLearningJobResource item in collection.GetAllAsync(jobType: jobType, tag: tag)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // List FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/list.json + // this example is just showing the usage of "Jobs_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation and iterate over the result + string jobType = "string"; + string tag = "string"; + MachineLearningListViewType? listViewType = MachineLearningListViewType.All; + await foreach (MachineLearningJobResource item in collection.GetAllAsync(jobType: jobType, tag: tag, listViewType: listViewType)) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -98,7 +138,7 @@ public async Task GetAll_ListCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListPipelineJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/PipelineJob/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/list.json // this example is just showing the usage of "Jobs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -118,8 +158,9 @@ public async Task GetAll_ListPipelineJob() MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); // invoke the operation and iterate over the result - MachineLearningJobCollectionGetAllOptions options = new MachineLearningJobCollectionGetAllOptions() { JobType = "string", Tag = "string" }; - await foreach (MachineLearningJobResource item in collection.GetAllAsync(options)) + string jobType = "string"; + string tag = "string"; + await foreach (MachineLearningJobResource item in collection.GetAllAsync(jobType: jobType, tag: tag)) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -136,7 +177,7 @@ public async Task GetAll_ListPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/SweepJob/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/list.json // this example is just showing the usage of "Jobs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,8 +197,9 @@ public async Task GetAll_ListSweepJob() MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); // invoke the operation and iterate over the result - MachineLearningJobCollectionGetAllOptions options = new MachineLearningJobCollectionGetAllOptions() { JobType = "string", Tag = "string", ListViewType = MachineLearningListViewType.ActiveOnly, AssetName = "string", Scheduled = false, ScheduleId = "string" }; - await foreach (MachineLearningJobResource item in collection.GetAllAsync(options)) + string jobType = "string"; + string tag = "string"; + await foreach (MachineLearningJobResource item in collection.GetAllAsync(jobType: jobType, tag: tag)) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -174,7 +216,7 @@ public async Task GetAll_ListSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAutoMLJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/AutoMLJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -209,7 +251,7 @@ public async Task Get_GetAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAutoMLJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/AutoMLJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -240,7 +282,7 @@ public async Task Exists_GetAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAutoMLJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/AutoMLJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -283,7 +325,7 @@ public async Task GetIfExists_GetAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetCommandJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/CommandJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -318,7 +360,7 @@ public async Task Get_GetCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetCommandJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/CommandJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -349,7 +391,116 @@ public async Task Exists_GetCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetCommandJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/CommandJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/get.json + // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation + string id = "string"; + NullableResponse response = await collection.GetIfExistsAsync(id); + MachineLearningJobResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Get FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json + // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation + string id = "string"; + MachineLearningJobResource result = await collection.GetAsync(id); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json + // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation + string id = "string"; + bool result = await collection.ExistsAsync(id); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -392,7 +543,7 @@ public async Task GetIfExists_GetCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetPipelineJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/PipelineJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -427,7 +578,7 @@ public async Task Get_GetPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetPipelineJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/PipelineJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -458,7 +609,7 @@ public async Task Exists_GetPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetPipelineJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/PipelineJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -501,7 +652,7 @@ public async Task GetIfExists_GetPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/SweepJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -536,7 +687,7 @@ public async Task Get_GetSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/SweepJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -567,7 +718,7 @@ public async Task Exists_GetSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/SweepJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -610,7 +761,7 @@ public async Task GetIfExists_GetSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAutoMLJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/AutoMLJob/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/createOrUpdate.json // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -631,87 +782,61 @@ public async Task CreateOrUpdate_CreateOrUpdateAutoMLJob() // invoke the operation string id = "string"; - MachineLearningJobData data = new MachineLearningJobData(new MachineLearningCommandJob("string", new ResourceIdentifier("string")) + MachineLearningJobData data = new MachineLearningJobData(new AutoMLJob(new ImageClassification(new MachineLearningTableJobInput(new Uri("string")), new ImageLimitSettings() { - MlflowAutologger = MachineLearningFlowAutoLoggerState.Disabled, - CodeId = new ResourceIdentifier("string"), - Distribution = new TensorFlowDistributionConfiguration() + MaxTrials = 2, + }) + { + ModelSettings = new ImageModelSettingsClassification() { - ParameterServerCount = 1, - WorkerCount = 1, + ValidationCropSize = 2, }, - EnvironmentVariables = + SearchSpace = { -["string"] = "string", -}, - Inputs = -{ -["string"] = new MachineLearningLiteralJobInput("string") +new ImageModelDistributionSettingsClassification() { -Description = "string", +ValidationCropSize = "choice(2, 360)", +} }, + TargetColumnName = "string", + }) + { + EnvironmentId = "string", + EnvironmentVariables = +{ +["string"] = "string", }, - Limits = new MachineLearningCommandJobLimits() - { - Timeout = XmlConvert.ToTimeSpan("PT5M"), - }, Outputs = { ["string"] = new MachineLearningUriFileJobOutput() { -AssetName = "string", -AssetVersion = "string", -Mode = MachineLearningOutputDeliveryMode.Direct, +Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, Uri = new Uri("string"), Description = "string", }, }, - QueueSettings = new JobQueueSettings() - { - JobTier = JobTier.Premium, - Priority = 1, - }, Resources = new MachineLearningJobResourceConfiguration() { - DockerArgs = "string", - ShmSize = "2g", InstanceCount = 1, InstanceType = "string", - Locations = -{ -"string" -}, Properties = { ["string"] = BinaryData.FromObjectAsJson(new Dictionary() { -["f69c8d5a-9b39-4183-92d3-a2b18944cf95"] = null}), +["9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad"] = null}), }, }, - ComponentId = new ResourceIdentifier("string"), ComputeId = new ResourceIdentifier("string"), DisplayName = "string", ExperimentName = "string", Identity = new AmlToken(), IsArchived = false, - NotificationSetting = new NotificationSetting() - { - EmailOn = -{ -EmailNotificationEnableType.JobCompleted -}, - Emails = -{ -"string" -}, - }, Services = { ["string"] = new MachineLearningJobService() { Endpoint = "string", JobServiceType = "string", -Nodes = new JobAllNodes(), Port = 1, Properties = { @@ -744,7 +869,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateCommandJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/CommandJob/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/createOrUpdate.json // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -767,7 +892,6 @@ public async Task CreateOrUpdate_CreateOrUpdateCommandJob() string id = "string"; MachineLearningJobData data = new MachineLearningJobData(new MachineLearningCommandJob("string", new ResourceIdentifier("string")) { - MlflowAutologger = MachineLearningFlowAutoLoggerState.Disabled, CodeId = new ResourceIdentifier("string"), Distribution = new TensorFlowDistributionConfiguration() { @@ -793,59 +917,32 @@ public async Task CreateOrUpdate_CreateOrUpdateCommandJob() { ["string"] = new MachineLearningUriFileJobOutput() { -AssetName = "string", -AssetVersion = "string", -Mode = MachineLearningOutputDeliveryMode.Upload, +Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, Uri = new Uri("string"), Description = "string", }, }, - QueueSettings = new JobQueueSettings() - { - JobTier = JobTier.Basic, - Priority = 1, - }, Resources = new MachineLearningJobResourceConfiguration() { - DockerArgs = "string", - ShmSize = "2g", InstanceCount = 1, InstanceType = "string", - Locations = -{ -"string" -}, Properties = { ["string"] = BinaryData.FromObjectAsJson(new Dictionary() { -["c9ac10d0-915b-4de5-afe8-a4c78a37a558"] = null}), +["e6b6493e-7d5e-4db3-be1e-306ec641327e"] = null}), }, }, - ComponentId = new ResourceIdentifier("string"), ComputeId = new ResourceIdentifier("string"), DisplayName = "string", ExperimentName = "string", Identity = new AmlToken(), - IsArchived = false, - NotificationSetting = new NotificationSetting() - { - EmailOn = -{ -EmailNotificationEnableType.JobCancelled -}, - Emails = -{ -"string" -}, - }, Services = { ["string"] = new MachineLearningJobService() { Endpoint = "string", JobServiceType = "string", -Nodes = new JobAllNodes(), Port = 1, Properties = { @@ -873,12 +970,68 @@ public async Task CreateOrUpdate_CreateOrUpdateCommandJob() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // CreateOrUpdate FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation + string id = "string"; + MachineLearningJobData data = new MachineLearningJobData(new FineTuningJob(new CustomModelFineTuning(FineTuningTaskType.TextCompletion, new MachineLearningUriFileJobInput(new Uri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + { + Mode = MachineLearningInputDeliveryMode.ReadOnlyMount, + Description = null, + }, new MachineLearningFlowModelJobInput(new Uri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + { + Mode = MachineLearningInputDeliveryMode.ReadOnlyMount, + Description = null, + }), new Dictionary() + { + ["string"] = new MachineLearningFlowModelJobOutput() + { + Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, + Uri = new Uri("string"), + Description = "string", + }, + }) + { + ExperimentName = "llm-finetuning", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, id, data); + MachineLearningJobResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // CreateOrUpdate Pipeline Job. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdatePipelineJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/PipelineJob/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/createOrUpdate.json // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -961,7 +1114,7 @@ public async Task CreateOrUpdate_CreateOrUpdatePipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/SweepJob/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/createOrUpdate.json // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -982,87 +1135,55 @@ public async Task CreateOrUpdate_CreateOrUpdateSweepJob() // invoke the operation string id = "string"; - MachineLearningJobData data = new MachineLearningJobData(new MachineLearningCommandJob("string", new ResourceIdentifier("string")) + MachineLearningJobData data = new MachineLearningJobData(new MachineLearningSweepJob(new MachineLearningObjective(MachineLearningGoal.Minimize, "string"), new GridSamplingAlgorithm(), BinaryData.FromObjectAsJson(new Dictionary() + { + ["string"] = new Dictionary() + { + } + }), new MachineLearningTrialComponent("string", new ResourceIdentifier("string")) { - MlflowAutologger = MachineLearningFlowAutoLoggerState.Disabled, CodeId = new ResourceIdentifier("string"), - Distribution = new TensorFlowDistributionConfiguration() + Distribution = new MpiDistributionConfiguration() { - ParameterServerCount = 1, - WorkerCount = 1, + ProcessCountPerInstance = 1, }, EnvironmentVariables = { ["string"] = "string", }, - Inputs = -{ -["string"] = new MachineLearningLiteralJobInput("string") -{ -Description = "string", -}, -}, - Limits = new MachineLearningCommandJobLimits() - { - Timeout = XmlConvert.ToTimeSpan("PT5M"), - }, - Outputs = -{ -["string"] = new MachineLearningUriFileJobOutput() -{ -AssetName = "string", -AssetVersion = "string", -Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, -Uri = new Uri("string"), -Description = "string", -}, -}, - QueueSettings = new JobQueueSettings() - { - JobTier = JobTier.Basic, - Priority = 1, - }, Resources = new MachineLearningJobResourceConfiguration() { - DockerArgs = "string", - ShmSize = "2g", InstanceCount = 1, InstanceType = "string", - Locations = -{ -"string" -}, Properties = { ["string"] = BinaryData.FromObjectAsJson(new Dictionary() { -["5fc1f627-491e-45a0-a6a2-f5b4be884911"] = null}), +["e6b6493e-7d5e-4db3-be1e-306ec641327e"] = null}), }, }, - ComponentId = new ResourceIdentifier("string"), + }) + { + EarlyTermination = new MedianStoppingPolicy() + { + DelayEvaluation = 1, + EvaluationInterval = 1, + }, + Limits = new MachineLearningSweepJobLimits() + { + MaxConcurrentTrials = 1, + MaxTotalTrials = 1, + TrialTimeout = XmlConvert.ToTimeSpan("PT1S"), + }, ComputeId = new ResourceIdentifier("string"), DisplayName = "string", ExperimentName = "string", - Identity = new AmlToken(), - IsArchived = false, - NotificationSetting = new NotificationSetting() - { - EmailOn = -{ -EmailNotificationEnableType.JobCompleted -}, - Emails = -{ -"string" -}, - }, Services = { ["string"] = new MachineLearningJobService() { Endpoint = "string", JobServiceType = "string", -Nodes = new JobAllNodes(), Port = 1, Properties = { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobResource.cs index 4e7991dd89b8f..4c1dd15df8746 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobResource.cs @@ -6,7 +6,9 @@ #nullable disable using System; +using System.Collections.Generic; using System.Threading.Tasks; +using System.Xml; using Azure.Core; using Azure.Identity; using Azure.ResourceManager.MachineLearning.Models; @@ -20,7 +22,7 @@ public partial class Sample_MachineLearningJobResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/delete.json // this example is just showing the usage of "Jobs_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -33,7 +35,7 @@ public async Task Delete_DeleteJob() string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "test-rg"; string workspaceName = "my-aml-workspace"; - string id = "string"; + string id = "http://subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/my-favorite-aml-job"; ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); @@ -48,7 +50,7 @@ public async Task Delete_DeleteJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAutoMLJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/AutoMLJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +82,39 @@ public async Task Get_GetAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetCommandJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/CommandJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/get.json + // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningJobResource created on azure + // for more information of creating MachineLearningJobResource, please refer to the document of MachineLearningJobResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string id = "string"; + ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); + MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); + + // invoke the operation + MachineLearningJobResource result = await machineLearningJob.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -112,7 +146,7 @@ public async Task Get_GetCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetPipelineJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/PipelineJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,7 +178,7 @@ public async Task Get_GetPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/SweepJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,13 +205,354 @@ public async Task Get_GetSweepJob() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Update Job. + // CreateOrUpdate AutoML Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdateAutoMLJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningJobResource created on azure + // for more information of creating MachineLearningJobResource, please refer to the document of MachineLearningJobResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string id = "string"; + ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); + MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); + + // invoke the operation + MachineLearningJobData data = new MachineLearningJobData(new AutoMLJob(new ImageClassification(new MachineLearningTableJobInput(new Uri("string")), new ImageLimitSettings() + { + MaxTrials = 2, + }) + { + ModelSettings = new ImageModelSettingsClassification() + { + ValidationCropSize = 2, + }, + SearchSpace = +{ +new ImageModelDistributionSettingsClassification() +{ +ValidationCropSize = "choice(2, 360)", +} +}, + TargetColumnName = "string", + }) + { + EnvironmentId = "string", + EnvironmentVariables = +{ +["string"] = "string", +}, + Outputs = +{ +["string"] = new MachineLearningUriFileJobOutput() +{ +Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, +Uri = new Uri("string"), +Description = "string", +}, +}, + Resources = new MachineLearningJobResourceConfiguration() + { + InstanceCount = 1, + InstanceType = "string", + Properties = +{ +["string"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +["9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad"] = null}), +}, + }, + ComputeId = new ResourceIdentifier("string"), + DisplayName = "string", + ExperimentName = "string", + Identity = new AmlToken(), + IsArchived = false, + Services = +{ +["string"] = new MachineLearningJobService() +{ +Endpoint = "string", +JobServiceType = "string", +Port = 1, +Properties = +{ +["string"] = "string", +}, +}, +}, + Description = "string", + Properties = +{ +["string"] = "string", +}, + Tags = +{ +["string"] = "string", +}, + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); + MachineLearningJobResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // CreateOrUpdate Command Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdateCommandJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningJobResource created on azure + // for more information of creating MachineLearningJobResource, please refer to the document of MachineLearningJobResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string id = "string"; + ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); + MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); + + // invoke the operation + MachineLearningJobData data = new MachineLearningJobData(new MachineLearningCommandJob("string", new ResourceIdentifier("string")) + { + CodeId = new ResourceIdentifier("string"), + Distribution = new TensorFlowDistributionConfiguration() + { + ParameterServerCount = 1, + WorkerCount = 1, + }, + EnvironmentVariables = +{ +["string"] = "string", +}, + Inputs = +{ +["string"] = new MachineLearningLiteralJobInput("string") +{ +Description = "string", +}, +}, + Limits = new MachineLearningCommandJobLimits() + { + Timeout = XmlConvert.ToTimeSpan("PT5M"), + }, + Outputs = +{ +["string"] = new MachineLearningUriFileJobOutput() +{ +Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, +Uri = new Uri("string"), +Description = "string", +}, +}, + Resources = new MachineLearningJobResourceConfiguration() + { + InstanceCount = 1, + InstanceType = "string", + Properties = +{ +["string"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +["e6b6493e-7d5e-4db3-be1e-306ec641327e"] = null}), +}, + }, + ComputeId = new ResourceIdentifier("string"), + DisplayName = "string", + ExperimentName = "string", + Identity = new AmlToken(), + Services = +{ +["string"] = new MachineLearningJobService() +{ +Endpoint = "string", +JobServiceType = "string", +Port = 1, +Properties = +{ +["string"] = "string", +}, +}, +}, + Description = "string", + Properties = +{ +["string"] = "string", +}, + Tags = +{ +["string"] = "string", +}, + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); + MachineLearningJobResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // CreateOrUpdate FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdateFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningJobResource created on azure + // for more information of creating MachineLearningJobResource, please refer to the document of MachineLearningJobResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string id = "string"; + ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); + MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); + + // invoke the operation + MachineLearningJobData data = new MachineLearningJobData(new FineTuningJob(new CustomModelFineTuning(FineTuningTaskType.TextCompletion, new MachineLearningUriFileJobInput(new Uri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + { + Mode = MachineLearningInputDeliveryMode.ReadOnlyMount, + Description = null, + }, new MachineLearningFlowModelJobInput(new Uri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + { + Mode = MachineLearningInputDeliveryMode.ReadOnlyMount, + Description = null, + }), new Dictionary() + { + ["string"] = new MachineLearningFlowModelJobOutput() + { + Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, + Uri = new Uri("string"), + Description = "string", + }, + }) + { + ExperimentName = "llm-finetuning", + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); + MachineLearningJobResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // CreateOrUpdate Pipeline Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdatePipelineJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningJobResource created on azure + // for more information of creating MachineLearningJobResource, please refer to the document of MachineLearningJobResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string id = "string"; + ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); + MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); + + // invoke the operation + MachineLearningJobData data = new MachineLearningJobData(new MachineLearningPipelineJob() + { + Inputs = +{ +["string"] = new MachineLearningLiteralJobInput("string") +{ +Description = "string", +}, +}, + Outputs = +{ +["string"] = new MachineLearningUriFileJobOutput() +{ +Mode = MachineLearningOutputDeliveryMode.Upload, +Uri = new Uri("string"), +Description = "string", +}, +}, + Settings = BinaryData.FromObjectAsJson(new Dictionary() + { + }), + ComputeId = new ResourceIdentifier("string"), + DisplayName = "string", + ExperimentName = "string", + Services = +{ +["string"] = new MachineLearningJobService() +{ +Endpoint = "string", +JobServiceType = "string", +Port = 1, +Properties = +{ +["string"] = "string", +}, +}, +}, + Description = "string", + Properties = +{ +["string"] = "string", +}, + Tags = +{ +["string"] = "string", +}, + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); + MachineLearningJobResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // CreateOrUpdate Sweep Job. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_UpdateJob() + public async Task Update_CreateOrUpdateSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/update.json - // this example is just showing the usage of "Jobs_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -194,17 +569,74 @@ public async Task Update_UpdateJob() MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); // invoke the operation - MachineLearningJobPatch patch = new MachineLearningJobPatch() + MachineLearningJobData data = new MachineLearningJobData(new MachineLearningSweepJob(new MachineLearningObjective(MachineLearningGoal.Minimize, "string"), new GridSamplingAlgorithm(), BinaryData.FromObjectAsJson(new Dictionary() + { + ["string"] = new Dictionary() + { + } + }), new MachineLearningTrialComponent("string", new ResourceIdentifier("string")) + { + CodeId = new ResourceIdentifier("string"), + Distribution = new MpiDistributionConfiguration() + { + ProcessCountPerInstance = 1, + }, + EnvironmentVariables = +{ +["string"] = "string", +}, + Resources = new MachineLearningJobResourceConfiguration() + { + InstanceCount = 1, + InstanceType = "string", + Properties = +{ +["string"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +["e6b6493e-7d5e-4db3-be1e-306ec641327e"] = null}), +}, + }, + }) { - NotificationSettingWebhooks = + EarlyTermination = new MedianStoppingPolicy() + { + DelayEvaluation = 1, + EvaluationInterval = 1, + }, + Limits = new MachineLearningSweepJobLimits() + { + MaxConcurrentTrials = 1, + MaxTotalTrials = 1, + TrialTimeout = XmlConvert.ToTimeSpan("PT1S"), + }, + ComputeId = new ResourceIdentifier("string"), + DisplayName = "string", + ExperimentName = "string", + Services = +{ +["string"] = new MachineLearningJobService() { -["string"] = new AzureDevOpsWebhook() +Endpoint = "string", +JobServiceType = "string", +Port = 1, +Properties = { -EventType = "string", +["string"] = "string", +}, +}, }, + Description = "string", + Properties = +{ +["string"] = "string", +}, + Tags = +{ +["string"] = "string", }, - }; - MachineLearningJobResource result = await machineLearningJob.UpdateAsync(patch); + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); + MachineLearningJobResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -218,7 +650,7 @@ public async Task Update_UpdateJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Cancel_CancelJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/cancel.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/cancel.json // this example is just showing the usage of "Jobs_Cancel" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobResource.cs deleted file mode 100644 index 28fcb669725e5..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobResource.cs +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.MachineLearning.Models; - -namespace Azure.ResourceManager.MachineLearning.Samples -{ - public partial class Sample_MachineLearningLabelingJobResource - { - // Delete Labeling Job. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteLabelingJob() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/delete.json - // this example is just showing the usage of "LabelingJobs_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningLabelingJobResource created on azure - // for more information of creating MachineLearningLabelingJobResource, please refer to the document of MachineLearningLabelingJobResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; - string id = "testLabelingJob"; - ResourceIdentifier machineLearningLabelingJobResourceId = MachineLearningLabelingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); - MachineLearningLabelingJobResource machineLearningLabelingJob = client.GetMachineLearningLabelingJobResource(machineLearningLabelingJobResourceId); - - // invoke the operation - await machineLearningLabelingJob.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Get Labeling Job. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetLabelingJob() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/get.json - // this example is just showing the usage of "LabelingJobs_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningLabelingJobResource created on azure - // for more information of creating MachineLearningLabelingJobResource, please refer to the document of MachineLearningLabelingJobResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; - string id = "testLabelingJob"; - ResourceIdentifier machineLearningLabelingJobResourceId = MachineLearningLabelingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); - MachineLearningLabelingJobResource machineLearningLabelingJob = client.GetMachineLearningLabelingJobResource(machineLearningLabelingJobResourceId); - - // invoke the operation - bool? includeJobInstructions = true; - bool? includeLabelCategories = true; - MachineLearningLabelingJobResource result = await machineLearningLabelingJob.GetAsync(includeJobInstructions: includeJobInstructions, includeLabelCategories: includeLabelCategories); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MachineLearningLabelingJobData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CreateOrUpdate Labeling Job. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateOrUpdateLabelingJob() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/createOrUpdate.json - // this example is just showing the usage of "LabelingJobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningLabelingJobResource created on azure - // for more information of creating MachineLearningLabelingJobResource, please refer to the document of MachineLearningLabelingJobResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; - string id = "testLabelingJob"; - ResourceIdentifier machineLearningLabelingJobResourceId = MachineLearningLabelingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); - MachineLearningLabelingJobResource machineLearningLabelingJob = client.GetMachineLearningLabelingJobResource(machineLearningLabelingJobResourceId); - - // invoke the operation - MachineLearningLabelingJobData data = new MachineLearningLabelingJobData(new LabelingJobProperties() - { - JobInstructionsUri = new Uri("link/to/instructions"), - LabelCategories = -{ -["myCategory1"] = new LabelCategory() -{ -Classes = -{ -["myLabelClass1"] = new LabelClass() -{ -DisplayName = "myLabelClass1", -Subclasses = -{ -}, -}, -["myLabelClass2"] = new LabelClass() -{ -DisplayName = "myLabelClass2", -Subclasses = -{ -}, -}, -}, -DisplayName = "myCategory1Title", -MultiSelect = LabelCategoryMultiSelect.Disabled, -}, -["myCategory2"] = new LabelCategory() -{ -Classes = -{ -["myLabelClass1"] = new LabelClass() -{ -DisplayName = "myLabelClass1", -Subclasses = -{ -}, -}, -["myLabelClass2"] = new LabelClass() -{ -DisplayName = "myLabelClass2", -Subclasses = -{ -}, -}, -}, -DisplayName = "myCategory2Title", -MultiSelect = LabelCategoryMultiSelect.Disabled, -}, -}, - LabelingJobMediaProperties = new LabelingJobImageProperties(), - MlAssistConfiguration = new MachineLearningAssistEnabledConfiguration("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/computes/myscoringcompute", "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/computes/mytrainingompute"), - Description = "string", - Properties = -{ -["additionalProp1"] = "string", -["additionalProp2"] = "string", -["additionalProp3"] = "string", -}, - Tags = -{ -["additionalProp1"] = "string", -["additionalProp2"] = "string", -["additionalProp3"] = "string", -}, - }); - ArmOperation lro = await machineLearningLabelingJob.UpdateAsync(WaitUntil.Completed, data); - MachineLearningLabelingJobResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MachineLearningLabelingJobData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // ExportLabels Labeling Job. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task ExportLabels_ExportLabelsLabelingJob() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/exportLabels.json - // this example is just showing the usage of "LabelingJobs_ExportLabels" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningLabelingJobResource created on azure - // for more information of creating MachineLearningLabelingJobResource, please refer to the document of MachineLearningLabelingJobResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; - string id = "testLabelingJob"; - ResourceIdentifier machineLearningLabelingJobResourceId = MachineLearningLabelingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); - MachineLearningLabelingJobResource machineLearningLabelingJob = client.GetMachineLearningLabelingJobResource(machineLearningLabelingJobResourceId); - - // invoke the operation - ExportSummary body = new DatasetExportSummary(); - ArmOperation lro = await machineLearningLabelingJob.ExportLabelsAsync(WaitUntil.Completed, body); - ExportSummary result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // Pause Labeling Job. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Pause_PauseLabelingJob() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/pause.json - // this example is just showing the usage of "LabelingJobs_Pause" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningLabelingJobResource created on azure - // for more information of creating MachineLearningLabelingJobResource, please refer to the document of MachineLearningLabelingJobResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; - string id = "testLabelingJob"; - ResourceIdentifier machineLearningLabelingJobResourceId = MachineLearningLabelingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); - MachineLearningLabelingJobResource machineLearningLabelingJob = client.GetMachineLearningLabelingJobResource(machineLearningLabelingJobResourceId); - - // invoke the operation - await machineLearningLabelingJob.PauseAsync(); - - Console.WriteLine($"Succeeded"); - } - - // Resume Labeling Job. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Resume_ResumeLabelingJob() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/resume.json - // this example is just showing the usage of "LabelingJobs_Resume" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningLabelingJobResource created on azure - // for more information of creating MachineLearningLabelingJobResource, please refer to the document of MachineLearningLabelingJobResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; - string id = "testLabelingJob"; - ResourceIdentifier machineLearningLabelingJobResourceId = MachineLearningLabelingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); - MachineLearningLabelingJobResource machineLearningLabelingJob = client.GetMachineLearningLabelingJobResource(machineLearningLabelingJobResourceId); - - // invoke the operation - await machineLearningLabelingJob.ResumeAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerCollection.cs index 6da1cbff6ef8f..5211c70c4aafb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningModelContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/list.json // this example is just showing the usage of "ModelContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_ListWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/get.json // this example is just showing the usage of "ModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/get.json // this example is just showing the usage of "ModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/get.json // this example is just showing the usage of "ModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/createOrUpdate.json // this example is just showing the usage of "ModelContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerResource.cs index 2a483ce425a40..e1a7547a3caca 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningModelContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/delete.json // this example is just showing the usage of "ModelContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/get.json // this example is just showing the usage of "ModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/createOrUpdate.json // this example is just showing the usage of "ModelContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionCollection.cs index b7c9685636eed..0ca1db3a38611 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningModelVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/list.json // this example is just showing the usage of "ModelVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_ListWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/get.json // this example is just showing the usage of "ModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Get_GetWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/get.json // this example is just showing the usage of "ModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task Exists_GetWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/get.json // this example is just showing the usage of "ModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +171,7 @@ public async Task GetIfExists_GetWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/createOrUpdate.json // this example is just showing the usage of "ModelVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionResource.cs index 49f745854eb38..9211e26060e1c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningModelVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/delete.json // this example is just showing the usage of "ModelVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/get.json // this example is just showing the usage of "ModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/createOrUpdate.json // this example is just showing the usage of "ModelVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,13 +136,13 @@ public async Task Update_CreateOrUpdateWorkspaceModelVersion() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Package Workspace Model Version. + // Publish Workspace Model Version. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Package_PackageWorkspaceModelVersion() + public async Task Publish_PublishWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/package.json - // this example is just showing the usage of "ModelVersions_Package" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/publish.json + // this example is just showing the usage of "ModelVersions_Publish" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -160,44 +160,15 @@ public async Task Package_PackageWorkspaceModelVersion() MachineLearningModelVersionResource machineLearningModelVersion = client.GetMachineLearningModelVersionResource(machineLearningModelVersionResourceId); // invoke the operation - ModelPackageContent content = new ModelPackageContent(new AzureMLBatchInferencingServer() + DestinationAsset body = new DestinationAsset() { - CodeConfiguration = new MachineLearningCodeConfiguration("string") - { - CodeId = new ResourceIdentifier("string"), - }, - }, "string") - { - BaseEnvironmentSource = new BaseEnvironmentType(new ResourceIdentifier("string")), - EnvironmentVariables = -{ -["string"] = "string", -}, - Inputs = -{ -new ModelPackageInput(PackageInputType.UriFile,new PackageInputPathUri() -{ -Uri = new Uri("string"), -}) -{ -Mode = PackageInputDeliveryMode.Download, -MountPath = "string", -} -}, - ModelConfiguration = new ModelConfiguration() - { - Mode = new PackageInputDeliveryMode("ReadOnlyMount"), - MountPath = "string", - }, - Tags = -{ -["string"] = "string", -}, + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", }; - ArmOperation lro = await machineLearningModelVersion.PackageAsync(WaitUntil.Completed, content); - ModelPackageResult result = lro.Value; + await machineLearningModelVersion.PublishAsync(WaitUntil.Completed, body); - Console.WriteLine($"Succeeded: {result}"); + Console.WriteLine($"Succeeded"); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentCollection.cs index 88af0ad0df629..b70d5c39543ca 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_MachineLearningOnlineDeploymentCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListOnlineDeployments() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/list.json // this example is just showing the usage of "OnlineDeployments_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task GetAll_ListOnlineDeployments() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetKubernetesOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task Get_GetKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetKubernetesOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task Exists_GetKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetKubernetesOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task GetIfExists_GetKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +210,7 @@ public async Task Get_GetManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetManagedOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -242,7 +242,7 @@ public async Task Exists_GetManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetManagedOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -286,7 +286,7 @@ public async Task GetIfExists_GetManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateKubernetesOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json // this example is just showing the usage of "OnlineDeployments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -394,7 +394,7 @@ public async Task CreateOrUpdate_CreateOrUpdateKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateManagedOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json // this example is just showing the usage of "OnlineDeployments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentResource.cs index f7e6269331dfb..23dd7bfff8559 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningOnlineDeploymentResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineDeployment/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineDeployment/delete.json // this example is just showing the usage of "OnlineDeployments_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetKubernetesOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task Get_GetManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateKubernetesOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json // this example is just showing the usage of "OnlineDeployments_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task Update_UpdateKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateManagedOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/update.json // this example is just showing the usage of "OnlineDeployments_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -211,7 +211,7 @@ public async Task Update_UpdateManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetLogs_GetOnlineDeploymentLogs() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/getLogs.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/getLogs.json // this example is just showing the usage of "OnlineDeployments_GetLogs" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -245,7 +245,7 @@ public async Task GetLogs_GetOnlineDeploymentLogs() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSkus_ListKubernetesOnlineDeploymentSkus() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json // this example is just showing the usage of "OnlineDeployments_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -278,7 +278,7 @@ public async Task GetSkus_ListKubernetesOnlineDeploymentSkus() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSkus_ListManagedOnlineDeploymentSkus() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json // this example is just showing the usage of "OnlineDeployments_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointCollection.cs index 41c03690cce17..7a891d4721a73 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningOnlineEndpointCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/list.json // this example is just showing the usage of "OnlineEndpoints_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_ListWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/get.json // this example is just showing the usage of "OnlineEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/get.json // this example is just showing the usage of "OnlineEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Exists_GetWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/get.json // this example is just showing the usage of "OnlineEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task GetIfExists_GetWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/createOrUpdate.json // this example is just showing the usage of "OnlineEndpoints_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointResource.cs index 55d647bfb4f1a..715ec18d2608d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningOnlineEndpointResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/delete.json // this example is just showing the usage of "OnlineEndpoints_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/get.json // this example is just showing the usage of "OnlineEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +81,7 @@ public async Task Get_GetWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/update.json // this example is just showing the usage of "OnlineEndpoints_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task Update_UpdateWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListKeysWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/listKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/listKeys.json // this example is just showing the usage of "OnlineEndpoints_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -158,7 +158,7 @@ public async Task GetKeys_ListKeysWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RegenerateKeys_RegenerateKeysWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/regenerateKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/regenerateKeys.json // this example is just showing the usage of "OnlineEndpoints_RegenerateKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -190,7 +190,7 @@ public async Task RegenerateKeys_RegenerateKeysWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetToken_GetTokenWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/getToken.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/getToken.json // this example is just showing the usage of "OnlineEndpoints_GetToken" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicCollection.cs index cd22304e5fbf9..6d8dfac3695ba 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningOutboundRuleBasicCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/listRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/listRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_ListManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/getRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/getRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task Get_GetManagedNetworkSettingsRule() MachineLearningOutboundRuleBasicCollection collection = machineLearningWorkspace.GetMachineLearningOutboundRuleBasics(); // invoke the operation - string ruleName = "some_string"; + string ruleName = "name_of_the_fqdn_rule"; MachineLearningOutboundRuleBasicResource result = await collection.GetAsync(ruleName); // the variable result is a resource, you could call other operations on this instance as well @@ -92,7 +92,7 @@ public async Task Get_GetManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/getRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/getRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -112,7 +112,7 @@ public async Task Exists_GetManagedNetworkSettingsRule() MachineLearningOutboundRuleBasicCollection collection = machineLearningWorkspace.GetMachineLearningOutboundRuleBasics(); // invoke the operation - string ruleName = "some_string"; + string ruleName = "name_of_the_fqdn_rule"; bool result = await collection.ExistsAsync(ruleName); Console.WriteLine($"Succeeded: {result}"); @@ -123,7 +123,7 @@ public async Task Exists_GetManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/getRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/getRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -143,7 +143,7 @@ public async Task GetIfExists_GetManagedNetworkSettingsRule() MachineLearningOutboundRuleBasicCollection collection = machineLearningWorkspace.GetMachineLearningOutboundRuleBasics(); // invoke the operation - string ruleName = "some_string"; + string ruleName = "name_of_the_fqdn_rule"; NullableResponse response = await collection.GetIfExistsAsync(ruleName); MachineLearningOutboundRuleBasicResource result = response.HasValue ? response.Value : null; @@ -166,7 +166,7 @@ public async Task GetIfExists_GetManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/createOrUpdateRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/createOrUpdateRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -186,10 +186,10 @@ public async Task CreateOrUpdate_CreateOrUpdateManagedNetworkSettingsRule() MachineLearningOutboundRuleBasicCollection collection = machineLearningWorkspace.GetMachineLearningOutboundRuleBasics(); // invoke the operation - string ruleName = "some_string"; + string ruleName = "rule_name_1"; MachineLearningOutboundRuleBasicData data = new MachineLearningOutboundRuleBasicData(new FqdnOutboundRule() { - Destination = "some_string", + Destination = "destination_endpoint", Category = OutboundRuleCategory.UserDefined, Status = OutboundRuleStatus.Active, }); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicResource.cs index bbca1b772066e..1f110f29783e9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningOutboundRuleBasicResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/deleteRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/deleteRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -33,7 +33,7 @@ public async Task Delete_DeleteManagedNetworkSettingsRule() string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "test-rg"; string workspaceName = "aml-workspace-name"; - string ruleName = "some_string"; + string ruleName = "rule-name"; ResourceIdentifier machineLearningOutboundRuleBasicResourceId = MachineLearningOutboundRuleBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, ruleName); MachineLearningOutboundRuleBasicResource machineLearningOutboundRuleBasic = client.GetMachineLearningOutboundRuleBasicResource(machineLearningOutboundRuleBasicResourceId); @@ -48,7 +48,7 @@ public async Task Delete_DeleteManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/getRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/getRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task Get_GetManagedNetworkSettingsRule() string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "test-rg"; string workspaceName = "aml-workspace-name"; - string ruleName = "some_string"; + string ruleName = "name_of_the_fqdn_rule"; ResourceIdentifier machineLearningOutboundRuleBasicResourceId = MachineLearningOutboundRuleBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, ruleName); MachineLearningOutboundRuleBasicResource machineLearningOutboundRuleBasic = client.GetMachineLearningOutboundRuleBasicResource(machineLearningOutboundRuleBasicResourceId); @@ -80,7 +80,7 @@ public async Task Get_GetManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/createOrUpdateRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/createOrUpdateRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,14 +93,14 @@ public async Task Update_CreateOrUpdateManagedNetworkSettingsRule() string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "test-rg"; string workspaceName = "aml-workspace-name"; - string ruleName = "some_string"; + string ruleName = "rule_name_1"; ResourceIdentifier machineLearningOutboundRuleBasicResourceId = MachineLearningOutboundRuleBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, ruleName); MachineLearningOutboundRuleBasicResource machineLearningOutboundRuleBasic = client.GetMachineLearningOutboundRuleBasicResource(machineLearningOutboundRuleBasicResourceId); // invoke the operation MachineLearningOutboundRuleBasicData data = new MachineLearningOutboundRuleBasicData(new FqdnOutboundRule() { - Destination = "some_string", + Destination = "destination_endpoint", Category = OutboundRuleCategory.UserDefined, Status = OutboundRuleStatus.Active, }); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionCollection.cs index 38c1a533a69af..11ec149a08014 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningPrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_StorageAccountListPrivateEndpointConnections() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/list.json // this example is just showing the usage of "PrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_StorageAccountListPrivateEndpointConnections() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_WorkspaceGetPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_WorkspaceGetPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_WorkspaceGetPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_WorkspaceGetPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_WorkspaceGetPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_WorkspaceGetPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_WorkspacePutPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionResource.cs index 77866f8276800..947195048b750 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningPrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_WorkspacePutPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/delete.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_WorkspacePutPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_WorkspaceGetPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_WorkspaceGetPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_WorkspacePutPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerCollection.cs index dd4bfcdca63d1..eb071ebcb0084 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryCodeContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/list.json // this example is just showing the usage of "RegistryCodeContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_ListRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/get.json // this example is just showing the usage of "RegistryCodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/get.json // this example is just showing the usage of "RegistryCodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/get.json // this example is just showing the usage of "RegistryCodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/createOrUpdate.json // this example is just showing the usage of "RegistryCodeContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerResource.cs index 7246a78a7c2da..1c255d1b17587 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryCodeContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/delete.json // this example is just showing the usage of "RegistryCodeContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/get.json // this example is just showing the usage of "RegistryCodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/createOrUpdate.json // this example is just showing the usage of "RegistryCodeContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionCollection.cs index f9f11d1d4d2f8..0c00637f99ed9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryCodeVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/list.json // this example is just showing the usage of "RegistryCodeVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_ListRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/get.json // this example is just showing the usage of "RegistryCodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_GetRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/get.json // this example is just showing the usage of "RegistryCodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task Exists_GetRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/get.json // this example is just showing the usage of "RegistryCodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +172,7 @@ public async Task GetIfExists_GetRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/createOrUpdate.json // this example is just showing the usage of "RegistryCodeVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionResource.cs index 34797a31321fa..478f35ea7b9a2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryCodeVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/delete.json // this example is just showing the usage of "RegistryCodeVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/get.json // this example is just showing the usage of "RegistryCodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/createOrUpdate.json // this example is just showing the usage of "RegistryCodeVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task Update_CreateOrUpdateRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/createOrGetStartPendingUpload.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/createOrGetStartPendingUpload.json // this example is just showing the usage of "RegistryCodeVersions_CreateOrGetStartPendingUpload" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -152,7 +152,7 @@ public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadReg PendingUploadRequestDto body = new PendingUploadRequestDto() { PendingUploadId = "string", - PendingUploadType = PendingUploadType.None, + PendingUploadType = PendingUploadType.TemporaryBlobReference, }; PendingUploadResponseDto result = await machineLearningRegistryCodeVersion.CreateOrGetStartPendingUploadAsync(body); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCollection.cs index 4fdb6d2fc1089..601f95a319cd5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCollection.cs @@ -22,7 +22,43 @@ public partial class Sample_MachineLearningRegistryCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistriesWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/list-SystemCreated.json + // this example is just showing the usage of "Registries_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineLearningRegistryResource + MachineLearningRegistryCollection collection = resourceGroupResource.GetMachineLearningRegistries(); + + // invoke the operation and iterate over the result + await foreach (MachineLearningRegistryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningRegistryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // List registries with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRegistriesWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/list-UserCreated.json // this example is just showing the usage of "Registries_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +94,7 @@ public async Task GetAll_ListRegistriesWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-SystemCreated.json // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +128,7 @@ public async Task Get_GetRegistryWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-SystemCreated.json // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +158,113 @@ public async Task Exists_GetRegistryWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-SystemCreated.json + // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineLearningRegistryResource + MachineLearningRegistryCollection collection = resourceGroupResource.GetMachineLearningRegistries(); + + // invoke the operation + string registryName = "string"; + NullableResponse response = await collection.GetIfExistsAsync(registryName); + MachineLearningRegistryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Get Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-UserCreated.json + // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineLearningRegistryResource + MachineLearningRegistryCollection collection = resourceGroupResource.GetMachineLearningRegistries(); + + // invoke the operation + string registryName = "string"; + MachineLearningRegistryResource result = await collection.GetAsync(registryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-UserCreated.json + // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineLearningRegistryResource + MachineLearningRegistryCollection collection = resourceGroupResource.GetMachineLearningRegistries(); + + // invoke the operation + string registryName = "string"; + bool result = await collection.ExistsAsync(registryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-UserCreated.json // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,7 +306,7 @@ public async Task GetIfExists_GetRegistryWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/createOrUpdate-SystemCreated.json // this example is just showing the usage of "Registries_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -205,7 +347,7 @@ public async Task CreateOrUpdate_CreateOrUpdateRegistryWithSystemCreatedAccounts IntellectualPropertyPublisher = "string", ManagedResourceId = new ResourceIdentifier("string"), MlFlowRegistryUri = new Uri("string"), - PrivateEndpointConnections = + RegistryPrivateEndpointConnections = { new RegistryPrivateEndpointConnection() { @@ -219,7 +361,7 @@ public async Task CreateOrUpdate_CreateOrUpdateRegistryWithSystemCreatedAccounts { SubnetArmId = new ResourceIdentifier("string"), }, -PrivateLinkServiceConnectionState = new RegistryPrivateLinkServiceConnectionState() +RegistryPrivateLinkServiceConnectionState = new RegistryPrivateLinkServiceConnectionState() { ActionsRequired = "string", Description = "string", @@ -275,5 +417,110 @@ public async Task CreateOrUpdate_CreateOrUpdateRegistryWithSystemCreatedAccounts // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // CreateOrUpdate Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/createOrUpdate-UserCreated.json + // this example is just showing the usage of "Registries_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineLearningRegistryResource + MachineLearningRegistryCollection collection = resourceGroupResource.GetMachineLearningRegistries(); + + // invoke the operation + string registryName = "string"; + MachineLearningRegistryData data = new MachineLearningRegistryData(new AzureLocation("string")) + { + Identity = new ManagedServiceIdentity("None") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("string")] = new UserAssignedIdentity(), +}, + }, + Kind = "string", + Sku = new MachineLearningSku("string") + { + Tier = MachineLearningSkuTier.Free, + Size = "string", + Family = "string", + Capacity = 1, + }, + DiscoveryUri = new Uri("string"), + IntellectualPropertyPublisher = "string", + ManagedResourceId = new ResourceIdentifier("string"), + MlFlowRegistryUri = new Uri("string"), + RegistryPrivateEndpointConnections = +{ +new RegistryPrivateEndpointConnection() +{ +Id = new ResourceIdentifier("string"), +Location = new AzureLocation("string"), +GroupIds = +{ +"string" +}, +PrivateEndpoint = new RegistryPrivateEndpoint() +{ +SubnetArmId = new ResourceIdentifier("string"), +}, +RegistryPrivateLinkServiceConnectionState = new RegistryPrivateLinkServiceConnectionState() +{ +ActionsRequired = "string", +Description = "string", +Status = MachineLearningPrivateEndpointServiceConnectionStatus.Approved, +}, +ProvisioningState = "string", +} +}, + PublicNetworkAccess = "string", + RegionDetails = +{ +new RegistryRegionArmDetails() +{ +AcrDetails = +{ +new RegistryAcrDetails() +{ +ArmResourceId = new ResourceIdentifier("string"), +} +}, +Location = new AzureLocation("string"), +StorageAccountDetails = +{ +new StorageAccountDetails() +{ +ArmResourceId = new ResourceIdentifier("string"), +} +}, +} +}, + Tags = +{ +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, registryName, data); + MachineLearningRegistryResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerCollection.cs index b38c427953980..d03eaa57501a5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryDataContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_RegistryListRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/registryList.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/registryList.json // this example is just showing the usage of "RegistryDataContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_RegistryListRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/get.json // this example is just showing the usage of "RegistryDataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_GetRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/get.json // this example is just showing the usage of "RegistryDataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Exists_GetRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/get.json // this example is just showing the usage of "RegistryDataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task GetIfExists_GetRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/createOrUpdate.json // this example is just showing the usage of "RegistryDataContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerResource.cs index e64bf4a43a24d..4643b39bdd4e4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryDataContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/delete.json // this example is just showing the usage of "RegistryDataContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/get.json // this example is just showing the usage of "RegistryDataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/createOrUpdate.json // this example is just showing the usage of "RegistryDataContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionCollection.cs index 82e6de696a3ab..504edabb1f9dd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryDataVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_RegistryListRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/registryList.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/registryList.json // this example is just showing the usage of "RegistryDataVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task GetAll_RegistryListRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/get.json // this example is just showing the usage of "RegistryDataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task Get_GetRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/get.json // this example is just showing the usage of "RegistryDataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task Exists_GetRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/get.json // this example is just showing the usage of "RegistryDataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task GetIfExists_GetRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/createOrUpdate.json // this example is just showing the usage of "RegistryDataVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionResource.cs index e5625a757c868..585198b8eb920 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryDataVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/delete.json // this example is just showing the usage of "RegistryDataVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/get.json // this example is just showing the usage of "RegistryDataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/createOrUpdate.json // this example is just showing the usage of "RegistryDataVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task Update_CreateOrUpdateRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/createOrGetStartPendingUpload.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/createOrGetStartPendingUpload.json // this example is just showing the usage of "RegistryDataVersions_CreateOrGetStartPendingUpload" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerCollection.cs index 508f9da305e18..d2c18ad5a5aa3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryEnvironmentContainerCollectio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/list.json // this example is just showing the usage of "RegistryEnvironmentContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_ListRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/get.json // this example is just showing the usage of "RegistryEnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/get.json // this example is just showing the usage of "RegistryEnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/get.json // this example is just showing the usage of "RegistryEnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/createOrUpdate.json // this example is just showing the usage of "RegistryEnvironmentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerResource.cs index 28ca562afb065..909c579c52ab2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryEnvironmentContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/delete.json // this example is just showing the usage of "RegistryEnvironmentContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/get.json // this example is just showing the usage of "RegistryEnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/createOrUpdate.json // this example is just showing the usage of "RegistryEnvironmentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionCollection.cs index 88a56c863cfb2..1a4accc406495 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryEnvironmentVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/list.json // this example is just showing the usage of "RegistryEnvironmentVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_ListRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/get.json // this example is just showing the usage of "RegistryEnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_GetRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/get.json // this example is just showing the usage of "RegistryEnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task Exists_GetRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/get.json // this example is just showing the usage of "RegistryEnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +172,7 @@ public async Task GetIfExists_GetRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/createOrUpdate.json // this example is just showing the usage of "RegistryEnvironmentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionResource.cs index 55a4ffe1f4cc5..4391cd0a14908 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryEnvironmentVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/delete.json // this example is just showing the usage of "RegistryEnvironmentVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/get.json // this example is just showing the usage of "RegistryEnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/createOrUpdate.json // this example is just showing the usage of "RegistryEnvironmentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerCollection.cs index 156a6c6bffc8d..20bab15e0910c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryModelContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/list.json // this example is just showing the usage of "RegistryModelContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_ListRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/get.json // this example is just showing the usage of "RegistryModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/get.json // this example is just showing the usage of "RegistryModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/get.json // this example is just showing the usage of "RegistryModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/createOrUpdate.json // this example is just showing the usage of "RegistryModelContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerResource.cs index 950f3e0f2e219..a0dc575e7a281 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryModelContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/delete.json // this example is just showing the usage of "RegistryModelContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task Delete_DeleteRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/get.json // this example is just showing the usage of "RegistryModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/createOrUpdate.json // this example is just showing the usage of "RegistryModelContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionCollection.cs index a7fe18e774915..92f94d6ac3e38 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryModelVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/list.json // this example is just showing the usage of "RegistryModelVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_ListRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/get.json // this example is just showing the usage of "RegistryModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Get_GetRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/get.json // this example is just showing the usage of "RegistryModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task Exists_GetRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/get.json // this example is just showing the usage of "RegistryModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +171,7 @@ public async Task GetIfExists_GetRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/createOrUpdate.json // this example is just showing the usage of "RegistryModelVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionResource.cs index 280c1c263f3f0..84d7db0765f99 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryModelVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/delete.json // this example is just showing the usage of "RegistryModelVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/get.json // this example is just showing the usage of "RegistryModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/createOrUpdate.json // this example is just showing the usage of "RegistryModelVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,76 +136,12 @@ public async Task Update_CreateOrUpdateRegistryModelVersion() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Package Registry Model Version. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Package_PackageRegistryModelVersion() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/package.json - // this example is just showing the usage of "RegistryModelVersions_Package" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningRegistryModelVersionResource created on azure - // for more information of creating MachineLearningRegistryModelVersionResource, please refer to the document of MachineLearningRegistryModelVersionResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "test-rg"; - string registryName = "my-aml-registry"; - string modelName = "string"; - string version = "string"; - ResourceIdentifier machineLearningRegistryModelVersionResourceId = MachineLearningRegistryModelVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, modelName, version); - MachineLearningRegistryModelVersionResource machineLearningRegistryModelVersion = client.GetMachineLearningRegistryModelVersionResource(machineLearningRegistryModelVersionResourceId); - - // invoke the operation - ModelPackageContent content = new ModelPackageContent(new AzureMLBatchInferencingServer() - { - CodeConfiguration = new MachineLearningCodeConfiguration("string") - { - CodeId = new ResourceIdentifier("string"), - }, - }, "string") - { - BaseEnvironmentSource = new BaseEnvironmentType(new ResourceIdentifier("string")), - EnvironmentVariables = -{ -["string"] = "string", -}, - Inputs = -{ -new ModelPackageInput(PackageInputType.UriFile,new PackageInputPathUri() -{ -Uri = new Uri("string"), -}) -{ -Mode = PackageInputDeliveryMode.Download, -MountPath = "string", -} -}, - ModelConfiguration = new ModelConfiguration() - { - Mode = new PackageInputDeliveryMode("ReadOnlyMount"), - MountPath = "string", - }, - Tags = -{ -["string"] = "string", -}, - }; - ArmOperation lro = await machineLearningRegistryModelVersion.PackageAsync(WaitUntil.Completed, content); - ModelPackageResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - // CreateOrGetStartPendingUpload Registry Model Version. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/createOrGetStartPendingUpload.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/createOrGetStartPendingUpload.json // this example is just showing the usage of "RegistryModelVersions_CreateOrGetStartPendingUpload" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -227,7 +163,7 @@ public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadReg PendingUploadRequestDto body = new PendingUploadRequestDto() { PendingUploadId = "string", - PendingUploadType = PendingUploadType.None, + PendingUploadType = PendingUploadType.TemporaryBlobReference, }; PendingUploadResponseDto result = await machineLearningRegistryModelVersion.CreateOrGetStartPendingUploadAsync(body); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryResource.cs index d8cac5eb21c59..3602d65f8a45d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryResource.cs @@ -17,12 +17,46 @@ namespace Azure.ResourceManager.MachineLearning.Samples { public partial class Sample_MachineLearningRegistryResource { + // GetBlobReferenceSAS Data Reference. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetBlobReferenceSasRegistryDataReference_GetBlobReferenceSASDataReference() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/DataReference/getBlobReferenceSAS.json + // this example is just showing the usage of "RegistryDataReferences_GetBlobReferenceSas" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningRegistryResource created on azure + // for more information of creating MachineLearningRegistryResource, please refer to the document of MachineLearningRegistryResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string registryName = "registryName"; + ResourceIdentifier machineLearningRegistryResourceId = MachineLearningRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + MachineLearningRegistryResource machineLearningRegistry = client.GetMachineLearningRegistryResource(machineLearningRegistryResourceId); + + // invoke the operation + string name = "string"; + string version = "string"; + GetBlobReferenceSasRequestDto body = new GetBlobReferenceSasRequestDto() + { + AssetId = "string", + BlobUri = new Uri("https://www.contoso.com/example"), + }; + GetBlobReferenceSasResponseDto result = await machineLearningRegistry.GetBlobReferenceSasRegistryDataReferenceAsync(name, version, body); + + Console.WriteLine($"Succeeded: {result}"); + } + // List registries by subscription. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningRegistries_ListRegistriesBySubscription() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/listBySubscription.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/listBySubscription.json // this example is just showing the usage of "Registries_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +88,7 @@ public async Task GetMachineLearningRegistries_ListRegistriesBySubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistry() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/delete.json // this example is just showing the usage of "Registries_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +115,38 @@ public async Task Delete_DeleteRegistry() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-SystemCreated.json + // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningRegistryResource created on azure + // for more information of creating MachineLearningRegistryResource, please refer to the document of MachineLearningRegistryResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string registryName = "string"; + ResourceIdentifier machineLearningRegistryResourceId = MachineLearningRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + MachineLearningRegistryResource machineLearningRegistry = client.GetMachineLearningRegistryResource(machineLearningRegistryResourceId); + + // invoke the operation + MachineLearningRegistryResource result = await machineLearningRegistry.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-UserCreated.json // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -112,7 +177,7 @@ public async Task Get_GetRegistryWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateRegistryWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/update-SystemCreated.json // this example is just showing the usage of "Registries_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,12 +224,64 @@ public async Task Update_UpdateRegistryWithSystemCreatedAccounts() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Update Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/update-UserCreated.json + // this example is just showing the usage of "Registries_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningRegistryResource created on azure + // for more information of creating MachineLearningRegistryResource, please refer to the document of MachineLearningRegistryResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string registryName = "string"; + ResourceIdentifier machineLearningRegistryResourceId = MachineLearningRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + MachineLearningRegistryResource machineLearningRegistry = client.GetMachineLearningRegistryResource(machineLearningRegistryResourceId); + + // invoke the operation + MachineLearningRegistryPatch patch = new MachineLearningRegistryPatch() + { + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("string")] = new UserAssignedIdentity(), +}, + }, + Sku = new MachineLearningSkuPatch() + { + Capacity = 1, + Family = "string", + Name = "string", + Size = "string", + Tier = MachineLearningSkuTier.Basic, + }, + Tags = +{ +}, + }; + MachineLearningRegistryResource result = await machineLearningRegistry.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Remove regions from registry [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RemoveRegions_RemoveRegionsFromRegistry() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/removeRegions.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/removeRegions.json // this example is just showing the usage of "Registries_RemoveRegions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -202,7 +319,7 @@ public async Task RemoveRegions_RemoveRegionsFromRegistry() IntellectualPropertyPublisher = "string", ManagedResourceId = new ResourceIdentifier("string"), MlFlowRegistryUri = new Uri("string"), - PrivateEndpointConnections = + RegistryPrivateEndpointConnections = { new RegistryPrivateEndpointConnection() { @@ -216,7 +333,7 @@ public async Task RemoveRegions_RemoveRegionsFromRegistry() { SubnetArmId = new ResourceIdentifier("string"), }, -PrivateLinkServiceConnectionState = new RegistryPrivateLinkServiceConnectionState() +RegistryPrivateLinkServiceConnectionState = new RegistryPrivateLinkServiceConnectionState() { ActionsRequired = "string", Description = "string", @@ -240,6 +357,7 @@ public async Task RemoveRegions_RemoveRegionsFromRegistry() AcrAccountSku = "string", ArmResourceId = new ResourceIdentifier("string"), }, +ArmResourceId = new ResourceIdentifier("string"), } }, Location = new AzureLocation("string"), @@ -255,6 +373,7 @@ public async Task RemoveRegions_RemoveRegionsFromRegistry() StorageAccountName = "string", StorageAccountType = "string", }, +ArmResourceId = new ResourceIdentifier("string"), } }, } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleCollection.cs index 7cd0a3aa6321c..049dcbc1b0915 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningScheduleCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListSchedules() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/list.json // this example is just showing the usage of "Schedules_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_ListSchedules() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/get.json // this example is just showing the usage of "Schedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_GetSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/get.json // this example is just showing the usage of "Schedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Exists_GetSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/get.json // this example is just showing the usage of "Schedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task GetIfExists_GetSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/createOrUpdate.json // this example is just showing the usage of "Schedules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleResource.cs index bfde2eb0c612a..08b92858b18f5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningScheduleResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/delete.json // this example is just showing the usage of "Schedules_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Delete_DeleteSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/get.json // this example is just showing the usage of "Schedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +81,7 @@ public async Task Get_GetSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/createOrUpdate.json // this example is just showing the usage of "Schedules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceCollection.cs index 838412ab6c489..961aa1eddc87f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_MachineLearningWorkspaceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetWorkspacesByResourceGroup() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/listByResourceGroup.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listByResourceGroup.json // this example is just showing the usage of "Workspaces_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_GetWorkspacesByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/get.json // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/get.json // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task Exists_GetWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/get.json // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,7 +164,7 @@ public async Task GetIfExists_GetWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/create.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/create.json // this example is just showing the usage of "Workspaces_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionCollection.cs index 1523c92386bd7..56970054f07e0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningWorkspaceConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceConnections() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/list.json // this example is just showing the usage of "WorkspaceConnections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_ListWorkspaceConnections() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/get.json // this example is just showing the usage of "WorkspaceConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/get.json // this example is just showing the usage of "WorkspaceConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Exists_GetWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/get.json // this example is just showing the usage of "WorkspaceConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task GetIfExists_GetWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/create.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/create.json // this example is just showing the usage of "WorkspaceConnections_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionResource.cs index 4d00d1e1e1941..23da7862194c1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionResource.cs @@ -6,7 +6,6 @@ #nullable disable using System; -using System.Collections.Generic; using System.Threading.Tasks; using Azure.Core; using Azure.Identity; @@ -21,7 +20,7 @@ public partial class Sample_MachineLearningWorkspaceConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/delete.json // this example is just showing the usage of "WorkspaceConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +48,7 @@ public async Task Delete_DeleteWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/get.json // this example is just showing the usage of "WorkspaceConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +80,7 @@ public async Task Get_GetWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/update.json // this example is just showing the usage of "WorkspaceConnections_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,8 +92,8 @@ public async Task Update_UpdateWorkspaceConnection() // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "test-rg"; - string workspaceName = "aml-workspace-name"; - string connectionName = "some_string"; + string workspaceName = "workspace-1"; + string connectionName = "connection-1"; ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); @@ -110,9 +109,9 @@ public async Task Update_UpdateWorkspaceConnection() }, Category = MachineLearningConnectionCategory.AdlsGen2, ExpiryOn = DateTimeOffset.Parse("2020-01-01T00:00:00Z"), - Metadata = BinaryData.FromObjectAsJson(new Dictionary() - { - }), + Metadata = +{ +}, Target = "some_string", }, }; @@ -130,7 +129,7 @@ public async Task Update_UpdateWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSecrets_GetWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/listSecrets.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/listSecrets.json // this example is just showing the usage of "WorkspaceConnections_ListSecrets" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -142,8 +141,8 @@ public async Task GetSecrets_GetWorkspaceConnection() // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "test-rg"; - string workspaceName = "aml-workspace-name"; - string connectionName = "some_string"; + string workspaceName = "workspace-1"; + string connectionName = "connection-1"; ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); @@ -156,5 +155,70 @@ public async Task GetSecrets_GetWorkspaceConnection() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // TestWorkspaceConnection + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task TestConnection_TestWorkspaceConnection() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/testConnection.json + // this example is just showing the usage of "WorkspaceConnections_TestConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "workspace-1"; + string connectionName = "connection-1"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // invoke the operation + MachineLearningWorkspaceConnectionData data = new MachineLearningWorkspaceConnectionData(new MachineLearningNoneAuthTypeWorkspaceConnection() + { + Category = MachineLearningConnectionCategory.ContainerRegistry, + ExpiryOn = DateTimeOffset.Parse("2024-03-15T14:30:00Z"), + Target = "target_url", + }); + await machineLearningWorkspaceConnection.TestConnectionAsync(WaitUntil.Completed, data: data); + + Console.WriteLine($"Succeeded"); + } + + // Get Azure OpenAI Connection Models + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetModelsConnections_GetAzureOpenAIConnectionModels() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getModels.json + // this example is just showing the usage of "Connection_GetModels" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // invoke the operation and iterate over the result + await foreach (EndpointModelProperties item in machineLearningWorkspaceConnection.GetModelsConnectionsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceResource.cs index 82dde3fb93635..f6ec98c17e7f0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningWorkspaceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetWorkspaceFeatures_ListWorkspaceFeatures() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceFeature/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceFeature/list.json // this example is just showing the usage of "WorkspaceFeatures_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task GetWorkspaceFeatures_ListWorkspaceFeatures() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningWorkspaces_GetWorkspacesBySubscription() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/listBySubscription.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listBySubscription.json // this example is just showing the usage of "Workspaces_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task GetMachineLearningWorkspaces_GetWorkspacesBySubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/delete.json // this example is just showing the usage of "Workspaces_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -110,7 +110,7 @@ public async Task Delete_DeleteWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/get.json // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -141,7 +141,7 @@ public async Task Get_GetWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/update.json // this example is just showing the usage of "Workspaces_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -179,7 +179,7 @@ public async Task Update_UpdateWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Diagnose_DiagnoseWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/diagnose.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/diagnose.json // this example is just showing the usage of "Workspaces_Diagnose" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -240,7 +240,7 @@ public async Task Diagnose_DiagnoseWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListWorkspaceKeys() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/listKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listKeys.json // this example is just showing the usage of "Workspaces_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -267,7 +267,7 @@ public async Task GetKeys_ListWorkspaceKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNotebookAccessToken_ListWorkspaceKeys() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/listNotebookAccessToken.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listNotebookAccessToken.json // this example is just showing the usage of "Workspaces_ListNotebookAccessToken" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -294,7 +294,7 @@ public async Task GetNotebookAccessToken_ListWorkspaceKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNotebookKeys_ListWorkspaceKeys() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Notebook/listKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Notebook/listKeys.json // this example is just showing the usage of "Workspaces_ListNotebookKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -321,7 +321,7 @@ public async Task GetNotebookKeys_ListWorkspaceKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetStorageAccountKeys_ListWorkspaceKeys() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/listStorageAccountKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listStorageAccountKeys.json // this example is just showing the usage of "Workspaces_ListStorageAccountKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -348,7 +348,7 @@ public async Task GetStorageAccountKeys_ListWorkspaceKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOutboundNetworkDependenciesEndpoints_ListOutboundNetworkDependenciesEndpoints() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ExternalFQDN/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ExternalFQDN/get.json // this example is just showing the usage of "Workspaces_ListOutboundNetworkDependenciesEndpoints" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -378,7 +378,7 @@ public async Task GetOutboundNetworkDependenciesEndpoints_ListOutboundNetworkDep [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PrepareNotebook_PrepareNotebook() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Notebook/prepare.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Notebook/prepare.json // this example is just showing the usage of "Workspaces_PrepareNotebook" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -406,7 +406,7 @@ public async Task PrepareNotebook_PrepareNotebook() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ResyncKeys_ResyncWorkspaceKeys() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/resyncKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/resyncKeys.json // this example is just showing the usage of "Workspaces_ResyncKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -428,12 +428,76 @@ public async Task ResyncKeys_ResyncWorkspaceKeys() Console.WriteLine($"Succeeded"); } + // Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetModelsConnections_GetModelsUnderTheAzureMLWorkspaceForAllAzureOpenAIConnectionsThatTheUserCanDeploy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/listConnectionModels.json + // this example is just showing the usage of "Connection_ListModels" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // invoke the operation and iterate over the result + await foreach (EndpointModelProperties item in machineLearningWorkspace.GetModelsConnectionsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Endpoint Deployments In Workspace + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetInWorkspaceEndpointDeployments_GetEndpointDeploymentsInWorkspace() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/getInWorkspace.json + // this example is just showing the usage of "EndpointDeployment_GetInWorkspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // invoke the operation and iterate over the result + await foreach (WorkspaceEndpointDeploymentResource item in machineLearningWorkspace.GetInWorkspaceEndpointDeploymentsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + // WorkspaceListPrivateLinkResources [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetPrivateLinkResources_WorkspaceListPrivateLinkResources() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateLinkResource/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateLinkResource/list.json // this example is just showing the usage of "PrivateLinkResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -463,7 +527,7 @@ public async Task GetPrivateLinkResources_WorkspaceListPrivateLinkResources() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ProvisionManagedNetworkManagedNetworkProvision_ProvisionManagedNetwork() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/provision.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/provision.json // this example is just showing the usage of "ManagedNetworkProvisions_ProvisionManagedNetwork" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionCollection.cs new file mode 100644 index 0000000000000..617b53afb3d53 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionCollection.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_MarketplaceSubscriptionCollection + { + // List Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/list.json + // this example is just showing the usage of "MarketplaceSubscriptions_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MarketplaceSubscriptionResource + MarketplaceSubscriptionCollection collection = machineLearningWorkspace.GetMarketplaceSubscriptions(); + + // invoke the operation and iterate over the result + await foreach (MarketplaceSubscriptionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MarketplaceSubscriptionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/get.json + // this example is just showing the usage of "MarketplaceSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MarketplaceSubscriptionResource + MarketplaceSubscriptionCollection collection = machineLearningWorkspace.GetMarketplaceSubscriptions(); + + // invoke the operation + string name = "string"; + MarketplaceSubscriptionResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MarketplaceSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/get.json + // this example is just showing the usage of "MarketplaceSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MarketplaceSubscriptionResource + MarketplaceSubscriptionCollection collection = machineLearningWorkspace.GetMarketplaceSubscriptions(); + + // invoke the operation + string name = "string"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/get.json + // this example is just showing the usage of "MarketplaceSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MarketplaceSubscriptionResource + MarketplaceSubscriptionCollection collection = machineLearningWorkspace.GetMarketplaceSubscriptions(); + + // invoke the operation + string name = "string"; + NullableResponse response = await collection.GetIfExistsAsync(name); + MarketplaceSubscriptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MarketplaceSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // CreateOrUpdate Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/createOrUpdate.json + // this example is just showing the usage of "MarketplaceSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MarketplaceSubscriptionResource + MarketplaceSubscriptionCollection collection = machineLearningWorkspace.GetMarketplaceSubscriptions(); + + // invoke the operation + string name = "string"; + MarketplaceSubscriptionData data = new MarketplaceSubscriptionData(new MarketplaceSubscriptionProperties("string")); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + MarketplaceSubscriptionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MarketplaceSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionResource.cs new file mode 100644 index 0000000000000..1ffbcee59581f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionResource.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_MarketplaceSubscriptionResource + { + // Delete Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/delete.json + // this example is just showing the usage of "MarketplaceSubscriptions_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MarketplaceSubscriptionResource created on azure + // for more information of creating MarketplaceSubscriptionResource, please refer to the document of MarketplaceSubscriptionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier marketplaceSubscriptionResourceId = MarketplaceSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + MarketplaceSubscriptionResource marketplaceSubscription = client.GetMarketplaceSubscriptionResource(marketplaceSubscriptionResourceId); + + // invoke the operation + await marketplaceSubscription.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/get.json + // this example is just showing the usage of "MarketplaceSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MarketplaceSubscriptionResource created on azure + // for more information of creating MarketplaceSubscriptionResource, please refer to the document of MarketplaceSubscriptionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier marketplaceSubscriptionResourceId = MarketplaceSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + MarketplaceSubscriptionResource marketplaceSubscription = client.GetMarketplaceSubscriptionResource(marketplaceSubscriptionResourceId); + + // invoke the operation + MarketplaceSubscriptionResource result = await marketplaceSubscription.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MarketplaceSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // CreateOrUpdate Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdateWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/createOrUpdate.json + // this example is just showing the usage of "MarketplaceSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MarketplaceSubscriptionResource created on azure + // for more information of creating MarketplaceSubscriptionResource, please refer to the document of MarketplaceSubscriptionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier marketplaceSubscriptionResourceId = MarketplaceSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + MarketplaceSubscriptionResource marketplaceSubscription = client.GetMarketplaceSubscriptionResource(marketplaceSubscriptionResourceId); + + // invoke the operation + MarketplaceSubscriptionData data = new MarketplaceSubscriptionData(new MarketplaceSubscriptionProperties("string")); + ArmOperation lro = await marketplaceSubscription.UpdateAsync(WaitUntil.Completed, data); + MarketplaceSubscriptionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MarketplaceSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResource.cs new file mode 100644 index 0000000000000..6ef2b6e228f28 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResource.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_RaiBlocklistItemPropertiesBasicResource + { + // Delete RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/delete.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistItemPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistItemPropertiesBasicResource, please refer to the document of RaiBlocklistItemPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + string raiBlocklistItemName = "raiBlocklistItemName"; + ResourceIdentifier raiBlocklistItemPropertiesBasicResourceId = RaiBlocklistItemPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + RaiBlocklistItemPropertiesBasicResource raiBlocklistItemPropertiesBasicResource = client.GetRaiBlocklistItemPropertiesBasicResource(raiBlocklistItemPropertiesBasicResourceId); + + // invoke the operation + await raiBlocklistItemPropertiesBasicResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Rai RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/get.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistItemPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistItemPropertiesBasicResource, please refer to the document of RaiBlocklistItemPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + string raiBlocklistItemName = "raiBlocklistItemName"; + ResourceIdentifier raiBlocklistItemPropertiesBasicResourceId = RaiBlocklistItemPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + RaiBlocklistItemPropertiesBasicResource raiBlocklistItemPropertiesBasicResource = client.GetRaiBlocklistItemPropertiesBasicResource(raiBlocklistItemPropertiesBasicResourceId); + + // invoke the operation + RaiBlocklistItemPropertiesBasicResource result = await raiBlocklistItemPropertiesBasicResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/create.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistItemPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistItemPropertiesBasicResource, please refer to the document of RaiBlocklistItemPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + string raiBlocklistItemName = "raiBlocklistItemName"; + ResourceIdentifier raiBlocklistItemPropertiesBasicResourceId = RaiBlocklistItemPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + RaiBlocklistItemPropertiesBasicResource raiBlocklistItemPropertiesBasicResource = client.GetRaiBlocklistItemPropertiesBasicResource(raiBlocklistItemPropertiesBasicResourceId); + + // invoke the operation + RaiBlocklistItemPropertiesBasicResourceData data = new RaiBlocklistItemPropertiesBasicResourceData(new RaiBlocklistItemProperties() + { + IsRegex = false, + Pattern = "Pattern To Block", + }); + ArmOperation lro = await raiBlocklistItemPropertiesBasicResource.UpdateAsync(WaitUntil.Completed, data); + RaiBlocklistItemPropertiesBasicResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResourceCollection.cs new file mode 100644 index 0000000000000..09ebde51ea62f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResourceCollection.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_RaiBlocklistItemPropertiesBasicResourceCollection + { + // Get Rai RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/get.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistItemName = "raiBlocklistItemName"; + RaiBlocklistItemPropertiesBasicResource result = await collection.GetAsync(raiBlocklistItemName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Rai RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRaiRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/get.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistItemName = "raiBlocklistItemName"; + bool result = await collection.ExistsAsync(raiBlocklistItemName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Rai RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRaiRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/get.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistItemName = "raiBlocklistItemName"; + NullableResponse response = await collection.GetIfExistsAsync(raiBlocklistItemName); + RaiBlocklistItemPropertiesBasicResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/create.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistItemName = "raiBlocklistItemName"; + RaiBlocklistItemPropertiesBasicResourceData data = new RaiBlocklistItemPropertiesBasicResourceData(new RaiBlocklistItemProperties() + { + IsRegex = false, + Pattern = "Pattern To Block", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, raiBlocklistItemName, data); + RaiBlocklistItemPropertiesBasicResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // List RaiBlocklist Items + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRaiBlocklistItems() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/list.json + // this example is just showing the usage of "ConnectionRaiBlocklistItems_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation and iterate over the result + await foreach (RaiBlocklistItemPropertiesBasicResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistItemPropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResource.cs new file mode 100644 index 0000000000000..aacc0ca4270fd --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResource.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_RaiBlocklistPropertiesBasicResource + { + // Delete Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/delete.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + await raiBlocklistPropertiesBasicResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/get.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + RaiBlocklistPropertiesBasicResource result = await raiBlocklistPropertiesBasicResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/create.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + RaiBlocklistPropertiesBasicResourceData data = new RaiBlocklistPropertiesBasicResourceData(new RaiBlocklistProperties() + { + Description = "Basic blocklist description", + }); + ArmOperation lro = await raiBlocklistPropertiesBasicResource.UpdateAsync(WaitUntil.Completed, data); + RaiBlocklistPropertiesBasicResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Bulk Rai Blocklist Items + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task AddBulkConnectionRaiBlocklistItem_CreateBulkRaiBlocklistItems() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/addBulk.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_AddBulk" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + IEnumerable content = new RaiBlocklistItemBulkRequest[] + { +new RaiBlocklistItemBulkRequest() +{ +Name = "myblocklistitem1", +Properties = new RaiBlocklistItemProperties() +{ +IsRegex = true, +Pattern = "^[a-z0-9_-]{2,16}$", +}, +},new RaiBlocklistItemBulkRequest() +{ +Name = "myblocklistitem2", +Properties = new RaiBlocklistItemProperties() +{ +IsRegex = false, +Pattern = "blockwords", +}, +} + }; + ArmOperation> lro = await raiBlocklistPropertiesBasicResource.AddBulkConnectionRaiBlocklistItemAsync(WaitUntil.Completed, content); + IList result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + // Delete Bulk Rai Blocklist Items + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task DeleteBulkConnectionRaiBlocklistItem_DeleteBulkRaiBlocklistItems() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/deleteBulk.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_DeleteBulk" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + BinaryData body = BinaryData.FromObjectAsJson(new object[] { "myblocklistitem1", "myblocklistitem2" }); + await raiBlocklistPropertiesBasicResource.DeleteBulkConnectionRaiBlocklistItemAsync(WaitUntil.Completed, body); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResourceCollection.cs new file mode 100644 index 0000000000000..847727a96ff37 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResourceCollection.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_RaiBlocklistPropertiesBasicResourceCollection + { + // List Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/list.json + // this example is just showing the usage of "ConnectionRaiBlocklists_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation and iterate over the result + await foreach (RaiBlocklistPropertiesBasicResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistPropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/get.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistName = "raiBlocklistName"; + RaiBlocklistPropertiesBasicResource result = await collection.GetAsync(raiBlocklistName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/get.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistName = "raiBlocklistName"; + bool result = await collection.ExistsAsync(raiBlocklistName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/get.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistName = "raiBlocklistName"; + NullableResponse response = await collection.GetIfExistsAsync(raiBlocklistName); + RaiBlocklistPropertiesBasicResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/create.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistName = "raiBlocklistName"; + RaiBlocklistPropertiesBasicResourceData data = new RaiBlocklistPropertiesBasicResourceData(new RaiBlocklistProperties() + { + Description = "Basic blocklist description", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, raiBlocklistName, data); + RaiBlocklistPropertiesBasicResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointCollection.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobCollection.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointCollection.cs index 4c65a14f55ebf..50687d47e00fd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointCollection.cs @@ -10,18 +10,19 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.MachineLearning.Samples { - public partial class Sample_MachineLearningLabelingJobCollection + public partial class Sample_ServerlessEndpointCollection { - // List Labeling Job. + // List Workspace Serverless Endpoint. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListLabelingJob() + public async Task GetAll_ListWorkspaceServerlessEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/list.json - // this example is just showing the usage of "LabelingJobs_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/list.json + // this example is just showing the usage of "ServerlessEndpoints_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -31,20 +32,20 @@ public async Task GetAll_ListLabelingJob() // this example assumes you already have this MachineLearningWorkspaceResource created on azure // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); - // get the collection of this MachineLearningLabelingJobResource - MachineLearningLabelingJobCollection collection = machineLearningWorkspace.GetMachineLearningLabelingJobs(); + // get the collection of this ServerlessEndpointResource + ServerlessEndpointCollection collection = machineLearningWorkspace.GetServerlessEndpoints(); // invoke the operation and iterate over the result - await foreach (MachineLearningLabelingJobResource item in collection.GetAllAsync()) + await foreach (ServerlessEndpointResource item in collection.GetAllAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - MachineLearningLabelingJobData resourceData = item.Data; + ServerlessEndpointData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -52,13 +53,13 @@ public async Task GetAll_ListLabelingJob() Console.WriteLine($"Succeeded"); } - // Get Labeling Job. + // Get Workspace Serverless Endpoint. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetLabelingJob() + public async Task Get_GetWorkspaceServerlessEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/get.json - // this example is just showing the usage of "LabelingJobs_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/get.json + // this example is just showing the usage of "ServerlessEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -68,34 +69,32 @@ public async Task Get_GetLabelingJob() // this example assumes you already have this MachineLearningWorkspaceResource created on azure // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); - // get the collection of this MachineLearningLabelingJobResource - MachineLearningLabelingJobCollection collection = machineLearningWorkspace.GetMachineLearningLabelingJobs(); + // get the collection of this ServerlessEndpointResource + ServerlessEndpointCollection collection = machineLearningWorkspace.GetServerlessEndpoints(); // invoke the operation - string id = "testLabelingJob"; - bool? includeJobInstructions = true; - bool? includeLabelCategories = true; - MachineLearningLabelingJobResource result = await collection.GetAsync(id, includeJobInstructions: includeJobInstructions, includeLabelCategories: includeLabelCategories); + string name = "string"; + ServerlessEndpointResource result = await collection.GetAsync(name); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - MachineLearningLabelingJobData resourceData = result.Data; + ServerlessEndpointData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Get Labeling Job. + // Get Workspace Serverless Endpoint. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetLabelingJob() + public async Task Exists_GetWorkspaceServerlessEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/get.json - // this example is just showing the usage of "LabelingJobs_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/get.json + // this example is just showing the usage of "ServerlessEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -105,30 +104,28 @@ public async Task Exists_GetLabelingJob() // this example assumes you already have this MachineLearningWorkspaceResource created on azure // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); - // get the collection of this MachineLearningLabelingJobResource - MachineLearningLabelingJobCollection collection = machineLearningWorkspace.GetMachineLearningLabelingJobs(); + // get the collection of this ServerlessEndpointResource + ServerlessEndpointCollection collection = machineLearningWorkspace.GetServerlessEndpoints(); // invoke the operation - string id = "testLabelingJob"; - bool? includeJobInstructions = true; - bool? includeLabelCategories = true; - bool result = await collection.ExistsAsync(id, includeJobInstructions: includeJobInstructions, includeLabelCategories: includeLabelCategories); + string name = "string"; + bool result = await collection.ExistsAsync(name); Console.WriteLine($"Succeeded: {result}"); } - // Get Labeling Job. + // Get Workspace Serverless Endpoint. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetLabelingJob() + public async Task GetIfExists_GetWorkspaceServerlessEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/get.json - // this example is just showing the usage of "LabelingJobs_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/get.json + // this example is just showing the usage of "ServerlessEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -138,20 +135,18 @@ public async Task GetIfExists_GetLabelingJob() // this example assumes you already have this MachineLearningWorkspaceResource created on azure // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); - // get the collection of this MachineLearningLabelingJobResource - MachineLearningLabelingJobCollection collection = machineLearningWorkspace.GetMachineLearningLabelingJobs(); + // get the collection of this ServerlessEndpointResource + ServerlessEndpointCollection collection = machineLearningWorkspace.GetServerlessEndpoints(); // invoke the operation - string id = "testLabelingJob"; - bool? includeJobInstructions = true; - bool? includeLabelCategories = true; - NullableResponse response = await collection.GetIfExistsAsync(id, includeJobInstructions: includeJobInstructions, includeLabelCategories: includeLabelCategories); - MachineLearningLabelingJobResource result = response.HasValue ? response.Value : null; + string name = "string"; + NullableResponse response = await collection.GetIfExistsAsync(name); + ServerlessEndpointResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -161,19 +156,19 @@ public async Task GetIfExists_GetLabelingJob() { // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - MachineLearningLabelingJobData resourceData = result.Data; + ServerlessEndpointData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } } - // CreateOrUpdate Labeling Job. + // CreateOrUpdate Workspace Serverless Endpoint. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateOrUpdateLabelingJob() + public async Task CreateOrUpdate_CreateOrUpdateWorkspaceServerlessEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/createOrUpdate.json - // this example is just showing the usage of "LabelingJobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/createOrUpdate.json + // this example is just showing the usage of "ServerlessEndpoints_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -183,88 +178,47 @@ public async Task CreateOrUpdate_CreateOrUpdateLabelingJob() // this example assumes you already have this MachineLearningWorkspaceResource created on azure // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); - // get the collection of this MachineLearningLabelingJobResource - MachineLearningLabelingJobCollection collection = machineLearningWorkspace.GetMachineLearningLabelingJobs(); + // get the collection of this ServerlessEndpointResource + ServerlessEndpointCollection collection = machineLearningWorkspace.GetServerlessEndpoints(); // invoke the operation - string id = "testLabelingJob"; - MachineLearningLabelingJobData data = new MachineLearningLabelingJobData(new LabelingJobProperties() + string name = "string"; + ServerlessEndpointData data = new ServerlessEndpointData(new AzureLocation("string"), new ServerlessEndpointProperties(ServerlessInferenceEndpointAuthMode.Key) { - JobInstructionsUri = new Uri("link/to/instructions"), - LabelCategories = -{ -["myCategory1"] = new LabelCategory() -{ -Classes = -{ -["myLabelClass1"] = new LabelClass() -{ -DisplayName = "myLabelClass1", -Subclasses = -{ -}, -}, -["myLabelClass2"] = new LabelClass() -{ -DisplayName = "myLabelClass2", -Subclasses = -{ -}, -}, -}, -DisplayName = "myCategory1Title", -MultiSelect = LabelCategoryMultiSelect.Disabled, -}, -["myCategory2"] = new LabelCategory() -{ -Classes = -{ -["myLabelClass1"] = new LabelClass() -{ -DisplayName = "myLabelClass1", -Subclasses = -{ -}, -}, -["myLabelClass2"] = new LabelClass() -{ -DisplayName = "myLabelClass2", -Subclasses = -{ -}, -}, -}, -DisplayName = "myCategory2Title", -MultiSelect = LabelCategoryMultiSelect.Disabled, -}, -}, - LabelingJobMediaProperties = new LabelingJobImageProperties(), - MlAssistConfiguration = new MachineLearningAssistEnabledConfiguration("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/computes/myscoringcompute", "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/computes/mytrainingompute"), - Description = "string", - Properties = + ContentSafetyStatus = ContentSafetyStatus.Enabled, + ModelId = "string", + }) + { + Identity = new ManagedServiceIdentity("SystemAssigned") + { + UserAssignedIdentities = { -["additionalProp1"] = "string", -["additionalProp2"] = "string", -["additionalProp3"] = "string", +[new ResourceIdentifier("string")] = new UserAssignedIdentity(), }, + }, + Kind = "string", + Sku = new MachineLearningSku("string") + { + Tier = MachineLearningSkuTier.Standard, + Size = "string", + Family = "string", + Capacity = 1, + }, Tags = { -["additionalProp1"] = "string", -["additionalProp2"] = "string", -["additionalProp3"] = "string", }, - }); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, id, data); - MachineLearningLabelingJobResource result = lro.Value; + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + ServerlessEndpointResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - MachineLearningLabelingJobData resourceData = result.Data; + ServerlessEndpointData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointResource.cs new file mode 100644 index 0000000000000..da4aa896773a2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointResource.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_ServerlessEndpointResource + { + // Delete Workspace Serverless Endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteWorkspaceServerlessEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/delete.json + // this example is just showing the usage of "ServerlessEndpoints_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerlessEndpointResource created on azure + // for more information of creating ServerlessEndpointResource, please refer to the document of ServerlessEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier serverlessEndpointResourceId = ServerlessEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + ServerlessEndpointResource serverlessEndpoint = client.GetServerlessEndpointResource(serverlessEndpointResourceId); + + // invoke the operation + await serverlessEndpoint.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Workspace Serverless Endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetWorkspaceServerlessEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/get.json + // this example is just showing the usage of "ServerlessEndpoints_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerlessEndpointResource created on azure + // for more information of creating ServerlessEndpointResource, please refer to the document of ServerlessEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier serverlessEndpointResourceId = ServerlessEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + ServerlessEndpointResource serverlessEndpoint = client.GetServerlessEndpointResource(serverlessEndpointResourceId); + + // invoke the operation + ServerlessEndpointResource result = await serverlessEndpoint.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServerlessEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update Workspace Serverless Endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateWorkspaceServerlessEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/update.json + // this example is just showing the usage of "ServerlessEndpoints_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerlessEndpointResource created on azure + // for more information of creating ServerlessEndpointResource, please refer to the document of ServerlessEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier serverlessEndpointResourceId = ServerlessEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + ServerlessEndpointResource serverlessEndpoint = client.GetServerlessEndpointResource(serverlessEndpointResourceId); + + // invoke the operation + ServerlessEndpointPatch patch = new ServerlessEndpointPatch() + { + Identity = new MachineLearningPartialManagedServiceIdentity() + { + ManagedServiceIdentityType = "None", + UserAssignedIdentities = +{ +["string"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +}), +}, + }, + Sku = new MachineLearningSkuPatch() + { + Capacity = 1, + Family = "string", + Name = "string", + Size = "string", + Tier = MachineLearningSkuTier.Premium, + }, + Tags = +{ +}, + }; + ArmOperation lro = await serverlessEndpoint.UpdateAsync(WaitUntil.Completed, patch); + ServerlessEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServerlessEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // ListKeys Workspace Serverless Endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetKeys_ListKeysWorkspaceServerlessEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/listKeys.json + // this example is just showing the usage of "ServerlessEndpoints_ListKeys" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerlessEndpointResource created on azure + // for more information of creating ServerlessEndpointResource, please refer to the document of ServerlessEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier serverlessEndpointResourceId = ServerlessEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + ServerlessEndpointResource serverlessEndpoint = client.GetServerlessEndpointResource(serverlessEndpointResourceId); + + // invoke the operation + MachineLearningEndpointAuthKeys result = await serverlessEndpoint.GetKeysAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // RegenerateKeys Workspace Serverless Endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task RegenerateKeys_RegenerateKeysWorkspaceServerlessEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/regenerateKeys.json + // this example is just showing the usage of "ServerlessEndpoints_RegenerateKeys" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerlessEndpointResource created on azure + // for more information of creating ServerlessEndpointResource, please refer to the document of ServerlessEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier serverlessEndpointResourceId = ServerlessEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + ServerlessEndpointResource serverlessEndpoint = client.GetServerlessEndpointResource(serverlessEndpointResourceId); + + // invoke the operation + MachineLearningEndpointKeyRegenerateContent content = new MachineLearningEndpointKeyRegenerateContent(MachineLearningKeyType.Primary) + { + KeyValue = "string", + }; + ArmOperation lro = await serverlessEndpoint.RegenerateKeysAsync(WaitUntil.Completed, content); + MachineLearningEndpointAuthKeys result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 94b10f612e537..d6919254119fb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningUsages_ListUsages() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Usage/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Usage/list.json // this example is just showing the usage of "Usages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task GetMachineLearningUsages_ListUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningVmSizes_ListVMSizes() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/VirtualMachineSize/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/VirtualMachineSize/list.json // this example is just showing the usage of "VirtualMachineSizes_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,7 +79,7 @@ public async Task GetMachineLearningVmSizes_ListVMSizes() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpdateMachineLearningQuotas_UpdateQuotas() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Quota/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Quota/update.json // this example is just showing the usage of "Quotas_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task UpdateMachineLearningQuotas_UpdateQuotas() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningQuotas_ListWorkspaceQuotasByVMFamily() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Quota/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Quota/list.json // this example is just showing the usage of "Quotas_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentCollection.cs new file mode 100644 index 0000000000000..48708c1f0bdf4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentCollection.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceConnectionDeploymentCollection + { + // List Azure OpenAI Connection Deployments + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListAzureOpenAIConnectionDeployments() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/listDeployments.json + // this example is just showing the usage of "Connection_ListDeployments" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation and iterate over the result + await foreach (WorkspaceConnectionDeploymentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getDeployment.json + // this example is just showing the usage of "Connection_GetDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + WorkspaceConnectionDeploymentResource result = await collection.GetAsync(deploymentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getDeployment.json + // this example is just showing the usage of "Connection_GetDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + bool result = await collection.ExistsAsync(deploymentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getDeployment.json + // this example is just showing the usage of "Connection_GetDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + NullableResponse response = await collection.GetIfExistsAsync(deploymentName); + WorkspaceConnectionDeploymentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/createDeployment.json + // this example is just showing the usage of "Connection_CreateOrUpdateDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + EndpointDeploymentResourcePropertiesBasicResourceData data = new EndpointDeploymentResourcePropertiesBasicResourceData(new OpenAIEndpointDeploymentResourceProperties(new EndpointDeploymentModel() + { + Format = "OpenAI", + Name = "text-davinci-003", + Version = "1", + }) + { + VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentName, data); + WorkspaceConnectionDeploymentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentResource.cs new file mode 100644 index 0000000000000..65151803829b0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentResource.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceConnectionDeploymentResource + { + // Delete Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/deleteDeployment.json + // this example is just showing the usage of "Connection_DeleteDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionDeploymentResource created on azure + // for more information of creating WorkspaceConnectionDeploymentResource, please refer to the document of WorkspaceConnectionDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string deploymentName = "testDeploymentName"; + ResourceIdentifier workspaceConnectionDeploymentResourceId = WorkspaceConnectionDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + WorkspaceConnectionDeploymentResource workspaceConnectionDeployment = client.GetWorkspaceConnectionDeploymentResource(workspaceConnectionDeploymentResourceId); + + // invoke the operation + await workspaceConnectionDeployment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getDeployment.json + // this example is just showing the usage of "Connection_GetDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionDeploymentResource created on azure + // for more information of creating WorkspaceConnectionDeploymentResource, please refer to the document of WorkspaceConnectionDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + string deploymentName = "text-davinci-003"; + ResourceIdentifier workspaceConnectionDeploymentResourceId = WorkspaceConnectionDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + WorkspaceConnectionDeploymentResource workspaceConnectionDeployment = client.GetWorkspaceConnectionDeploymentResource(workspaceConnectionDeploymentResourceId); + + // invoke the operation + WorkspaceConnectionDeploymentResource result = await workspaceConnectionDeployment.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/createDeployment.json + // this example is just showing the usage of "Connection_CreateOrUpdateDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionDeploymentResource created on azure + // for more information of creating WorkspaceConnectionDeploymentResource, please refer to the document of WorkspaceConnectionDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + string deploymentName = "text-davinci-003"; + ResourceIdentifier workspaceConnectionDeploymentResourceId = WorkspaceConnectionDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + WorkspaceConnectionDeploymentResource workspaceConnectionDeployment = client.GetWorkspaceConnectionDeploymentResource(workspaceConnectionDeploymentResourceId); + + // invoke the operation + EndpointDeploymentResourcePropertiesBasicResourceData data = new EndpointDeploymentResourcePropertiesBasicResourceData(new OpenAIEndpointDeploymentResourceProperties(new EndpointDeploymentModel() + { + Format = "OpenAI", + Name = "text-davinci-003", + Version = "1", + }) + { + VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable, + }); + ArmOperation lro = await workspaceConnectionDeployment.UpdateAsync(WaitUntil.Completed, data); + WorkspaceConnectionDeploymentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyCollection.cs new file mode 100644 index 0000000000000..4236bdc5d3e92 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyCollection.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceConnectionRaiPolicyCollection + { + // List Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/list.json + // this example is just showing the usage of "ConnectionRaiPolicies_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation and iterate over the result + await foreach (WorkspaceConnectionRaiPolicyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/get.json + // this example is just showing the usage of "ConnectionRaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + WorkspaceConnectionRaiPolicyResource result = await collection.GetAsync(raiPolicyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/get.json + // this example is just showing the usage of "ConnectionRaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + bool result = await collection.ExistsAsync(raiPolicyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/get.json + // this example is just showing the usage of "ConnectionRaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + NullableResponse response = await collection.GetIfExistsAsync(raiPolicyName); + WorkspaceConnectionRaiPolicyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/create.json + // this example is just showing the usage of "ConnectionRaiPolicy_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + RaiPolicyPropertiesBasicResourceData data = new RaiPolicyPropertiesBasicResourceData(new RaiPolicyProperties() + { + BasePolicyName = "112", + CompletionBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + ContentFilters = +{ +new RaiPolicyContentFilter() +{ +AllowedContentLevel = AllowedContentLevel.Low, +Blocking = false, +Enabled = false, +Name = "policyName", +Source = RaiPolicyContentSource.Prompt, +} +}, + Mode = RaiPolicyMode.Blocking, + PromptBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + PolicyType = RaiPolicyType.SystemManaged, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, raiPolicyName, data); + WorkspaceConnectionRaiPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyResource.cs new file mode 100644 index 0000000000000..3c41b9d3979ac --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyResource.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceConnectionRaiPolicyResource + { + // Delete Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/delete.json + // this example is just showing the usage of "ConnectionRaiPolicy_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionRaiPolicyResource created on azure + // for more information of creating WorkspaceConnectionRaiPolicyResource, please refer to the document of WorkspaceConnectionRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceConnectionRaiPolicyResourceId = WorkspaceConnectionRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + WorkspaceConnectionRaiPolicyResource workspaceConnectionRaiPolicy = client.GetWorkspaceConnectionRaiPolicyResource(workspaceConnectionRaiPolicyResourceId); + + // invoke the operation + await workspaceConnectionRaiPolicy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/get.json + // this example is just showing the usage of "ConnectionRaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionRaiPolicyResource created on azure + // for more information of creating WorkspaceConnectionRaiPolicyResource, please refer to the document of WorkspaceConnectionRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceConnectionRaiPolicyResourceId = WorkspaceConnectionRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + WorkspaceConnectionRaiPolicyResource workspaceConnectionRaiPolicy = client.GetWorkspaceConnectionRaiPolicyResource(workspaceConnectionRaiPolicyResourceId); + + // invoke the operation + WorkspaceConnectionRaiPolicyResource result = await workspaceConnectionRaiPolicy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/create.json + // this example is just showing the usage of "ConnectionRaiPolicy_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionRaiPolicyResource created on azure + // for more information of creating WorkspaceConnectionRaiPolicyResource, please refer to the document of WorkspaceConnectionRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceConnectionRaiPolicyResourceId = WorkspaceConnectionRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + WorkspaceConnectionRaiPolicyResource workspaceConnectionRaiPolicy = client.GetWorkspaceConnectionRaiPolicyResource(workspaceConnectionRaiPolicyResourceId); + + // invoke the operation + RaiPolicyPropertiesBasicResourceData data = new RaiPolicyPropertiesBasicResourceData(new RaiPolicyProperties() + { + BasePolicyName = "112", + CompletionBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + ContentFilters = +{ +new RaiPolicyContentFilter() +{ +AllowedContentLevel = AllowedContentLevel.Low, +Blocking = false, +Enabled = false, +Name = "policyName", +Source = RaiPolicyContentSource.Prompt, +} +}, + Mode = RaiPolicyMode.Blocking, + PromptBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + PolicyType = RaiPolicyType.SystemManaged, + }); + ArmOperation lro = await workspaceConnectionRaiPolicy.UpdateAsync(WaitUntil.Completed, data); + WorkspaceConnectionRaiPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentCollection.cs new file mode 100644 index 0000000000000..680856af5281c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentCollection.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceEndpointDeploymentCollection + { + // Get Endpoint Deployments + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_GetEndpointDeployments() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/getDeployments.json + // this example is just showing the usage of "EndpointDeployment_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation and iterate over the result + await foreach (WorkspaceEndpointDeploymentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/get.json + // this example is just showing the usage of "EndpointDeployment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + WorkspaceEndpointDeploymentResource result = await collection.GetAsync(deploymentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/get.json + // this example is just showing the usage of "EndpointDeployment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + bool result = await collection.ExistsAsync(deploymentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/get.json + // this example is just showing the usage of "EndpointDeployment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + NullableResponse response = await collection.GetIfExistsAsync(deploymentName); + WorkspaceEndpointDeploymentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/create.json + // this example is just showing the usage of "EndpointDeployment_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + EndpointDeploymentResourcePropertiesBasicResourceData data = new EndpointDeploymentResourcePropertiesBasicResourceData(new OpenAIEndpointDeploymentResourceProperties(new EndpointDeploymentModel() + { + Format = "OpenAI", + Name = "text-davinci-003", + Version = "1", + }) + { + VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentName, data); + WorkspaceEndpointDeploymentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentResource.cs new file mode 100644 index 0000000000000..c1101097e97ee --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentResource.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceEndpointDeploymentResource + { + // Delete Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/delete.json + // this example is just showing the usage of "EndpointDeployment_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointDeploymentResource created on azure + // for more information of creating WorkspaceEndpointDeploymentResource, please refer to the document of WorkspaceEndpointDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + string deploymentName = "testDeploymentName"; + ResourceIdentifier workspaceEndpointDeploymentResourceId = WorkspaceEndpointDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + WorkspaceEndpointDeploymentResource workspaceEndpointDeployment = client.GetWorkspaceEndpointDeploymentResource(workspaceEndpointDeploymentResourceId); + + // invoke the operation + await workspaceEndpointDeployment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/get.json + // this example is just showing the usage of "EndpointDeployment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointDeploymentResource created on azure + // for more information of creating WorkspaceEndpointDeploymentResource, please refer to the document of WorkspaceEndpointDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + string deploymentName = "text-davinci-003"; + ResourceIdentifier workspaceEndpointDeploymentResourceId = WorkspaceEndpointDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + WorkspaceEndpointDeploymentResource workspaceEndpointDeployment = client.GetWorkspaceEndpointDeploymentResource(workspaceEndpointDeploymentResourceId); + + // invoke the operation + WorkspaceEndpointDeploymentResource result = await workspaceEndpointDeployment.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/create.json + // this example is just showing the usage of "EndpointDeployment_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointDeploymentResource created on azure + // for more information of creating WorkspaceEndpointDeploymentResource, please refer to the document of WorkspaceEndpointDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + string deploymentName = "text-davinci-003"; + ResourceIdentifier workspaceEndpointDeploymentResourceId = WorkspaceEndpointDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + WorkspaceEndpointDeploymentResource workspaceEndpointDeployment = client.GetWorkspaceEndpointDeploymentResource(workspaceEndpointDeploymentResourceId); + + // invoke the operation + EndpointDeploymentResourcePropertiesBasicResourceData data = new EndpointDeploymentResourcePropertiesBasicResourceData(new OpenAIEndpointDeploymentResourceProperties(new EndpointDeploymentModel() + { + Format = "OpenAI", + Name = "text-davinci-003", + Version = "1", + }) + { + VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable, + }); + ArmOperation lro = await workspaceEndpointDeployment.UpdateAsync(WaitUntil.Completed, data); + WorkspaceEndpointDeploymentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyCollection.cs new file mode 100644 index 0000000000000..105749e74d20c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyCollection.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceEndpointRaiPolicyCollection + { + // List Rai policies + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRaiPolicies() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/list.json + // this example is just showing the usage of "RaiPolicies_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation and iterate over the result + await foreach (WorkspaceEndpointRaiPolicyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/get.json + // this example is just showing the usage of "RaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + WorkspaceEndpointRaiPolicyResource result = await collection.GetAsync(raiPolicyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/get.json + // this example is just showing the usage of "RaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + bool result = await collection.ExistsAsync(raiPolicyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/get.json + // this example is just showing the usage of "RaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + NullableResponse response = await collection.GetIfExistsAsync(raiPolicyName); + WorkspaceEndpointRaiPolicyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/create.json + // this example is just showing the usage of "RaiPolicy_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + RaiPolicyPropertiesBasicResourceData data = new RaiPolicyPropertiesBasicResourceData(new RaiPolicyProperties() + { + BasePolicyName = "112", + CompletionBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + ContentFilters = +{ +new RaiPolicyContentFilter() +{ +AllowedContentLevel = AllowedContentLevel.Low, +Blocking = false, +Enabled = false, +Name = "policyName", +Source = RaiPolicyContentSource.Prompt, +} +}, + Mode = RaiPolicyMode.Blocking, + PromptBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + PolicyType = RaiPolicyType.SystemManaged, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, raiPolicyName, data); + WorkspaceEndpointRaiPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyResource.cs new file mode 100644 index 0000000000000..fc3d2ae838bc8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyResource.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceEndpointRaiPolicyResource + { + // Delete Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/delete.json + // this example is just showing the usage of "RaiPolicy_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointRaiPolicyResource created on azure + // for more information of creating WorkspaceEndpointRaiPolicyResource, please refer to the document of WorkspaceEndpointRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceEndpointRaiPolicyResourceId = WorkspaceEndpointRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + WorkspaceEndpointRaiPolicyResource workspaceEndpointRaiPolicy = client.GetWorkspaceEndpointRaiPolicyResource(workspaceEndpointRaiPolicyResourceId); + + // invoke the operation + await workspaceEndpointRaiPolicy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/get.json + // this example is just showing the usage of "RaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointRaiPolicyResource created on azure + // for more information of creating WorkspaceEndpointRaiPolicyResource, please refer to the document of WorkspaceEndpointRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceEndpointRaiPolicyResourceId = WorkspaceEndpointRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + WorkspaceEndpointRaiPolicyResource workspaceEndpointRaiPolicy = client.GetWorkspaceEndpointRaiPolicyResource(workspaceEndpointRaiPolicyResourceId); + + // invoke the operation + WorkspaceEndpointRaiPolicyResource result = await workspaceEndpointRaiPolicy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/create.json + // this example is just showing the usage of "RaiPolicy_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointRaiPolicyResource created on azure + // for more information of creating WorkspaceEndpointRaiPolicyResource, please refer to the document of WorkspaceEndpointRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceEndpointRaiPolicyResourceId = WorkspaceEndpointRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + WorkspaceEndpointRaiPolicyResource workspaceEndpointRaiPolicy = client.GetWorkspaceEndpointRaiPolicyResource(workspaceEndpointRaiPolicyResourceId); + + // invoke the operation + RaiPolicyPropertiesBasicResourceData data = new RaiPolicyPropertiesBasicResourceData(new RaiPolicyProperties() + { + BasePolicyName = "112", + CompletionBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + ContentFilters = +{ +new RaiPolicyContentFilter() +{ +AllowedContentLevel = AllowedContentLevel.Low, +Blocking = false, +Enabled = false, +Name = "policyName", +Source = RaiPolicyContentSource.Prompt, +} +}, + Mode = RaiPolicyMode.Blocking, + PromptBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + PolicyType = RaiPolicyType.SystemManaged, + }); + ArmOperation lro = await workspaceEndpointRaiPolicy.UpdateAsync(WaitUntil.Completed, data); + WorkspaceEndpointRaiPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Azure.ResourceManager.MachineLearning.csproj b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Azure.ResourceManager.MachineLearning.csproj index c41f7bd4e8564..716d663beba06 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Azure.ResourceManager.MachineLearning.csproj +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Azure.ResourceManager.MachineLearning.csproj @@ -1,6 +1,6 @@ - 1.2.0-beta.4 + 1.2.0 1.1.1 Microsoft Azure management client SDK for Azure resource provider Microsoft.MachineLearningServices. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Extensions/MockableMachineLearningSubscriptionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Extensions/MockableMachineLearningSubscriptionResource.cs index c8baf637ee513..d999830dd8f12 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Extensions/MockableMachineLearningSubscriptionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Extensions/MockableMachineLearningSubscriptionResource.cs @@ -30,7 +30,7 @@ public partial class MockableMachineLearningSubscriptionResource : ArmResource [EditorBrowsable(EditorBrowsableState.Never)] public virtual AsyncPageable GetMachineLearningWorkspacesAsync(string skip = null, CancellationToken cancellationToken = default) { - return GetMachineLearningWorkspacesAsync(skip, null, cancellationToken); + return GetMachineLearningWorkspacesAsync(null, skip, null, cancellationToken); } /// @@ -52,7 +52,7 @@ public virtual AsyncPageable GetMachineLearnin [EditorBrowsable(EditorBrowsableState.Never)] public virtual Pageable GetMachineLearningWorkspaces(string skip = null, CancellationToken cancellationToken = default) { - return GetMachineLearningWorkspaces(skip, null, cancellationToken); + return GetMachineLearningWorkspaces(null, skip, null, cancellationToken); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningComponentVersionCollection.cs index 9566800156b02..8d699c4d417f1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningComponentVersionCollection.cs @@ -31,14 +31,13 @@ public partial class MachineLearningComponentVersionCollection : ArmCollection, /// /// /// Ordering of list. - /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. [EditorBrowsable(EditorBrowsableState.Never)] - public virtual AsyncPageable GetAllAsync(string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) - => GetAllAsync(orderBy, top, skip, listViewType, null, cancellationToken); + public virtual AsyncPageable GetAllAsync(string orderBy, string skip, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) + => GetAllAsync(orderBy, null, skip, listViewType, cancellationToken); /// /// List component versions. @@ -54,13 +53,12 @@ public virtual AsyncPageable GetAllAsyn /// /// /// Ordering of list. - /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. [EditorBrowsable(EditorBrowsableState.Never)] - public virtual Pageable GetAll(string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) - => GetAll(orderBy, top, skip, listViewType, null, cancellationToken); + public virtual Pageable GetAll(string orderBy, string skip, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) + => GetAll(orderBy, null, skip, listViewType, cancellationToken); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDataVersionCollection.cs index 5eb65646106d7..fbce7d951da81 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDataVersionCollection.cs @@ -31,18 +31,18 @@ public partial class MachineLearningDataVersionCollection : ArmCollection, IEnum /// /// /// Please choose OrderBy value from ['createdtime', 'modifiedtime']. + /// Continuation token for pagination. /// /// Top count of results, top count cannot be greater than the page size. /// If topCount > page size, results with be default page size count will be returned /// - /// Continuation token for pagination. /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. [EditorBrowsable(EditorBrowsableState.Never)] - public virtual AsyncPageable GetAllAsync(string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) - => GetAllAsync(new MachineLearningDataVersionCollectionGetAllOptions() { OrderBy = orderBy, Top = top, Skip = skip, Tags = tags, ListViewType = listViewType, Stage = null}, cancellationToken); + public virtual AsyncPageable GetAllAsync(string orderBy, string skip, int? top, string tags, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) + => GetAllAsync(orderBy, top, skip, tags, listViewType, cancellationToken); /// /// List data versions in the data container @@ -58,17 +58,17 @@ public virtual AsyncPageable GetAllAsync(str /// /// /// Please choose OrderBy value from ['createdtime', 'modifiedtime']. + /// Continuation token for pagination. /// /// Top count of results, top count cannot be greater than the page size. /// If topCount > page size, results with be default page size count will be returned /// - /// Continuation token for pagination. /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. [EditorBrowsable(EditorBrowsableState.Never)] - public virtual Pageable GetAll(string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) - => GetAll(new MachineLearningDataVersionCollectionGetAllOptions() { OrderBy = orderBy, Top = top, Skip = skip, Tags = tags, ListViewType = listViewType, Stage = null}, cancellationToken); + public virtual Pageable GetAll(string orderBy, string skip, int? top, string tags, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) + => GetAll(orderBy, top, skip, tags, listViewType, cancellationToken); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDatastoreCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDatastoreCollection.cs index 637372a916a21..ec2a715f351b4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDatastoreCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDatastoreCollection.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; using System.Collections.Generic; -using System.Text; using System.Threading; using Azure.ResourceManager.MachineLearning.Models; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDatastoreResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDatastoreResource.cs new file mode 100644 index 0000000000000..4dc0f3e4beb1b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDatastoreResource.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a MachineLearningDatastore along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMachineLearningDatastoreResource method. + /// Otherwise you can get one from its parent resource using the GetMachineLearningDatastore method. + /// + public partial class MachineLearningDatastoreResource : ArmResource + { + /// + /// Get datastore secrets. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets + /// + /// + /// Operation Id + /// Datastores_ListSecrets + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetSecretsAsync(CancellationToken cancellationToken = default) + { + var response = await GetSecretsAsync(null, cancellationToken).ConfigureAwait(false); + return response; + } + + /// + /// Get datastore secrets. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets + /// + /// + /// Operation Id + /// Datastores_ListSecrets + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetSecrets(CancellationToken cancellationToken = default) => GetSecrets(null, cancellationToken); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningEnvironmentVersionCollection.cs index 6894a0327a225..0fa0af889aa19 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningEnvironmentVersionCollection.cs @@ -31,14 +31,14 @@ public partial class MachineLearningEnvironmentVersionCollection : ArmCollection /// /// /// Ordering of list. - /// Maximum number of records to return. /// Continuation token for pagination. + /// Maximum number of records to return. /// View type for including/excluding (for example) archived entities. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. [EditorBrowsable(EditorBrowsableState.Never)] - public virtual AsyncPageable GetAllAsync(string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) - => GetAllAsync(orderBy, top, skip, listViewType, null, cancellationToken); + public virtual AsyncPageable GetAllAsync(string orderBy, string skip, int? top, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) + => GetAllAsync(orderBy, top, skip, listViewType, cancellationToken); /// /// List versions. @@ -54,13 +54,13 @@ public virtual AsyncPageable GetAllAs /// /// /// Ordering of list. - /// Maximum number of records to return. /// Continuation token for pagination. + /// Maximum number of records to return. /// View type for including/excluding (for example) archived entities. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. [EditorBrowsable(EditorBrowsableState.Never)] - public virtual Pageable GetAll(string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) - => GetAll(orderBy, top, skip, listViewType, null, cancellationToken); + public virtual Pageable GetAll(string orderBy, string skip, int? top, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) + => GetAll(orderBy, top, skip, listViewType, cancellationToken); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningJobCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningJobCollection.cs index a18ddf043e660..f8b240ba2943f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningJobCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningJobCollection.cs @@ -38,7 +38,7 @@ public partial class MachineLearningJobCollection : ArmCollection, IEnumerable An async collection of that may take multiple service requests to iterate over. [EditorBrowsable(EditorBrowsableState.Never)] public virtual AsyncPageable GetAllAsync(string skip, string jobType, string tag, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) - => GetAllAsync(new MachineLearningJobCollectionGetAllOptions() { Skip = skip, JobType = jobType, Tag = tag, ListViewType = listViewType, AssetName = null, Scheduled = null, ScheduleId = null }, cancellationToken); + => GetAllAsync(skip, jobType, tag, listViewType, null, cancellationToken); /// /// Lists Jobs in the workspace. @@ -61,6 +61,6 @@ public virtual AsyncPageable GetAllAsync(string skip /// A collection of that may take multiple service requests to iterate over. [EditorBrowsable(EditorBrowsableState.Never)] public virtual Pageable GetAll(string skip, string jobType, string tag, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) - => GetAll(new MachineLearningJobCollectionGetAllOptions() { Skip = skip, JobType = jobType, Tag = tag, ListViewType = listViewType, AssetName = null, Scheduled = null, ScheduleId = null }, cancellationToken); + => GetAll(skip, jobType, tag, listViewType, null, cancellationToken); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningModelVersionCollection.cs index f30c5f1ecedd6..7ea1ac32722d1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningModelVersionCollection.cs @@ -42,7 +42,7 @@ public partial class MachineLearningModelVersionCollection : ArmCollection, IEnu /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) - => GetAllAsync(new MachineLearningModelVersionCollectionGetAllOptions() { Skip = skip, OrderBy = orderBy, Top = top, Version = version, Description = description, Offset = offset, Tags = tags, Properties = properties, Feed = feed, ListViewType = listViewType, Stage = null }, cancellationToken); + => GetAllAsync(new MachineLearningModelVersionCollectionGetAllOptions() { Skip = skip, OrderBy = orderBy, Top = top, Version = version, Description = description, Offset = offset, Tags = tags, Properties = properties, Feed = feed, ListViewType = listViewType }, cancellationToken); /// /// List model versions. @@ -70,6 +70,6 @@ public virtual AsyncPageable GetAllAsync(st /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType, CancellationToken cancellationToken) - => GetAll(new MachineLearningModelVersionCollectionGetAllOptions() { Skip = skip, OrderBy = orderBy, Top = top, Version = version, Description = description, Offset = offset, Tags = tags, Properties = properties, Feed = feed, ListViewType = listViewType, Stage = null }, cancellationToken); + => GetAll(new MachineLearningModelVersionCollectionGetAllOptions() { Skip = skip, OrderBy = orderBy, Top = top, Version = version, Description = description, Offset = offset, Tags = tags, Properties = properties, Feed = feed, ListViewType = listViewType }, cancellationToken); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceCollection.cs index b5d2e0221cadd..ba37c00b13346 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceCollection.cs @@ -35,7 +35,7 @@ public partial class MachineLearningWorkspaceCollection : ArmCollection, IEnumer /// An async collection of that may take multiple service requests to iterate over. [EditorBrowsable(EditorBrowsableState.Never)] public virtual AsyncPageable GetAllAsync(string skip, CancellationToken cancellationToken) - => GetAllAsync(skip, null, cancellationToken); + => GetAllAsync(skip, null,null, cancellationToken); /// /// Lists all the available machine learning workspaces under the specified resource group. @@ -55,6 +55,6 @@ public virtual AsyncPageable GetAllAsync(strin /// A collection of that may take multiple service requests to iterate over. [EditorBrowsable(EditorBrowsableState.Never)] public virtual Pageable GetAll(string skip, CancellationToken cancellationToken) - => GetAll(skip, null, cancellationToken); + => GetAll(skip, null, null, cancellationToken); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceConnectionCollection.cs new file mode 100644 index 0000000000000..2b5bed9e20215 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceConnectionCollection.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMachineLearningWorkspaceConnections method from an instance of . + /// + public partial class MachineLearningWorkspaceConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + /// + /// Lists all the available machine learning workspaces connections under the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections + /// + /// + /// Operation Id + /// WorkspaceConnections_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Target of the workspace connection. + /// Category of the workspace connection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string target, string category, CancellationToken cancellationToken = default) => GetAllAsync(target, category, null, cancellationToken); + + /// + /// Lists all the available machine learning workspaces connections under the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections + /// + /// + /// Operation Id + /// WorkspaceConnections_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Target of the workspace connection. + /// Category of the workspace connection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string target, string category, CancellationToken cancellationToken = default) => GetAll(target, category, null, cancellationToken); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningComputeStartStopSchedule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningComputeStartStopSchedule.cs index a72b3c014dfd0..9545ef7fa38ed 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningComputeStartStopSchedule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningComputeStartStopSchedule.cs @@ -16,9 +16,10 @@ public MachineLearningRecurrenceTrigger Recurrence { get { - return new MachineLearningRecurrenceTrigger(RecurrenceSchedule.Frequency.Value, RecurrenceSchedule.Interval.Value); + return new MachineLearningRecurrenceTrigger(new MachineLearningRecurrenceFrequency(RecurrenceSchedule.Frequency.Value.ToString()), RecurrenceSchedule.Interval.Value); } } + /// Required if triggerType is Cron. [EditorBrowsable(EditorBrowsableState.Never)] public CronTrigger Cron diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs index 3b76d382ae248..b976946781310 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs @@ -327,13 +327,12 @@ public static MachineLearningCodeVersionData MachineLearningCodeVersionData(Reso /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Uri where code is located. /// Provisioning state for the code version. /// A new instance for mocking. - public static MachineLearningCodeVersionProperties MachineLearningCodeVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = null, bool? isArchived = null, Uri codeUri = null, RegistryAssetProvisioningState? provisioningState = null) + public static MachineLearningCodeVersionProperties MachineLearningCodeVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, Uri codeUri = null, RegistryAssetProvisioningState? provisioningState = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -343,7 +342,6 @@ public static MachineLearningCodeVersionProperties MachineLearningCodeVersionPro properties, tags, serializedAdditionalRawData: null, - autoDeleteSetting, isAnonymous, isArchived, codeUri, @@ -442,17 +440,15 @@ public static MachineLearningComponentVersionData MachineLearningComponentVersio /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// /// Defines Component definition details. /// <see href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" /> /// /// Provisioning state for the component version. - /// Stage in the component lifecycle. /// A new instance for mocking. - public static MachineLearningComponentVersionProperties MachineLearningComponentVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = null, bool? isArchived = null, BinaryData componentSpec = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) + public static MachineLearningComponentVersionProperties MachineLearningComponentVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, BinaryData componentSpec = null, RegistryAssetProvisioningState? provisioningState = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -462,12 +458,10 @@ public static MachineLearningComponentVersionProperties MachineLearningComponent properties, tags, serializedAdditionalRawData: null, - autoDeleteSetting, isAnonymous, isArchived, componentSpec, - provisioningState, - stage); + provisioningState); } /// Initializes a new instance of . @@ -535,6 +529,28 @@ public static MachineLearningDataVersionData MachineLearningDataVersionData(Reso serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Blob reference for consumption details. + /// A new instance for mocking. + public static GetBlobReferenceSasResponseDto GetBlobReferenceSasResponseDto(GetBlobReferenceForConsumptionDto blobReferenceForConsumption = null) + { + return new GetBlobReferenceSasResponseDto(blobReferenceForConsumption, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Blob uri, example: https://blob.windows.core.net/Container/Path. + /// + /// Credential info to access storage account + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// The ARM id of the storage account. + /// A new instance for mocking. + public static GetBlobReferenceForConsumptionDto GetBlobReferenceForConsumptionDto(Uri blobUri = null, DataReferenceCredential credential = null, string storageAccountArmId = null) + { + return new GetBlobReferenceForConsumptionDto(blobUri, credential, storageAccountArmId, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -600,9 +616,8 @@ public static MachineLearningEnvironmentVersionData MachineLearningEnvironmentVe /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Defines if image needs to be rebuilt based on base image changes. /// Configuration settings for Docker build context. /// @@ -618,12 +633,11 @@ public static MachineLearningEnvironmentVersionData MachineLearningEnvironmentVe /// <seealso href="https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-custom-docker-image#use-a-custom-base-image" /> /// /// Defines configuration specific to inference. - /// Intellectual Property details. Used if environment is an Intellectual Property. /// The OS type of the environment. /// Provisioning state for the environment version. /// Stage in the environment lifecycle assigned to this environment. /// A new instance for mocking. - public static MachineLearningEnvironmentVersionProperties MachineLearningEnvironmentVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = null, bool? isArchived = null, AutoRebuildSetting? autoRebuild = null, MachineLearningBuildContext build = null, string condaFile = null, MachineLearningEnvironmentType? environmentType = null, string image = null, MachineLearningInferenceContainerProperties inferenceConfig = null, IntellectualProperty intellectualProperty = null, MachineLearningOperatingSystemType? osType = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) + public static MachineLearningEnvironmentVersionProperties MachineLearningEnvironmentVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, AutoRebuildSetting? autoRebuild = null, MachineLearningBuildContext build = null, string condaFile = null, MachineLearningEnvironmentType? environmentType = null, string image = null, MachineLearningInferenceContainerProperties inferenceConfig = null, MachineLearningOperatingSystemType? osType = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -633,7 +647,6 @@ public static MachineLearningEnvironmentVersionProperties MachineLearningEnviron properties, tags, serializedAdditionalRawData: null, - autoDeleteSetting, isAnonymous, isArchived, autoRebuild, @@ -642,12 +655,50 @@ public static MachineLearningEnvironmentVersionProperties MachineLearningEnviron environmentType, image, inferenceConfig, - intellectualProperty, osType, provisioningState, stage); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MarketplaceSubscriptionData MarketplaceSubscriptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MarketplaceSubscriptionProperties properties = null) + { + return new MarketplaceSubscriptionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Marketplace Plan associated with the Marketplace Subscription. + /// Current status of the Marketplace Subscription. + /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + /// Provisioning State of the Marketplace Subscription. + /// A new instance for mocking. + public static MarketplaceSubscriptionProperties MarketplaceSubscriptionProperties(MarketplacePlan marketplacePlan = null, MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = null, string modelId = null, MarketplaceSubscriptionProvisioningState? provisioningState = null) + { + return new MarketplaceSubscriptionProperties(marketplacePlan, marketplaceSubscriptionStatus, modelId, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The identifying name of the Offer of the Marketplace Plan. + /// The identifying name of the Plan of the Marketplace Plan. + /// The identifying name of the Publisher of the Marketplace Plan. + /// A new instance for mocking. + public static MarketplacePlan MarketplacePlan(string offerId = null, string planId = null, string publisherId = null) + { + return new MarketplacePlan(offerId, planId, publisherId, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -713,18 +764,16 @@ public static MachineLearningModelVersionData MachineLearningModelVersionData(Re /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Mapping of model flavors to their properties. - /// Intellectual Property details. Used if model is an Intellectual Property. /// Name of the training job which produced this model. /// The storage format for this entity. Used for NCD. /// The URI path to the model contents. /// Provisioning state for the model version. /// Stage in the model lifecycle assigned to this model. /// A new instance for mocking. - public static MachineLearningModelVersionProperties MachineLearningModelVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = null, bool? isArchived = null, IDictionary flavors = null, IntellectualProperty intellectualProperty = null, string jobName = null, string modelType = null, Uri modelUri = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) + public static MachineLearningModelVersionProperties MachineLearningModelVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, IDictionary flavors = null, string jobName = null, string modelType = null, Uri modelUri = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -735,11 +784,9 @@ public static MachineLearningModelVersionProperties MachineLearningModelVersionP properties, tags, serializedAdditionalRawData: null, - autoDeleteSetting, isAnonymous, isArchived, flavors, - intellectualProperty, jobName, modelType, modelUri, @@ -747,80 +794,6 @@ public static MachineLearningModelVersionProperties MachineLearningModelVersionP stage); } - /// Initializes a new instance of . - /// - /// Base environment to start with. - /// 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 . - /// - /// Collection of environment variables. - /// - /// [Required] Inferencing server configurations. - /// 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 . - /// - /// Collection of inputs. - /// Model configuration including the mount mode. - /// Tag dictionary. Tags can be added, removed, and updated. - /// [Required] Arm ID of the target environment to be created by package operation. - /// A new instance for mocking. - public static ModelPackageContent ModelPackageContent(BaseEnvironmentSource baseEnvironmentSource = null, IDictionary environmentVariables = null, InferencingServer inferencingServer = null, IEnumerable inputs = null, ModelConfiguration modelConfiguration = null, IDictionary tags = null, string targetEnvironmentId = null) - { - environmentVariables ??= new Dictionary(); - inputs ??= new List(); - tags ??= new Dictionary(); - - return new ModelPackageContent( - baseEnvironmentSource, - environmentVariables, - inferencingServer, - inputs?.ToList(), - modelConfiguration, - tags, - targetEnvironmentId, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// - /// Base environment to start with. - /// 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 . - /// - /// Build id of the image build operation. - /// Build state of the image build operation. - /// Collection of environment variables. - /// - /// Inferencing server configurations. - /// 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 . - /// - /// Collection of inputs. - /// Log url of the image build operation. - /// Model configuration including the mount mode. - /// Tag dictionary. Tags can be added, removed, and updated. - /// Asset ID of the target environment created by package operation. - /// A new instance for mocking. - public static ModelPackageResult ModelPackageResult(BaseEnvironmentSource baseEnvironmentSource = null, string buildId = null, PackageBuildState? buildState = null, IReadOnlyDictionary environmentVariables = null, InferencingServer inferencingServer = null, IEnumerable inputs = null, Uri logUri = null, ModelConfiguration modelConfiguration = null, IReadOnlyDictionary tags = null, string targetEnvironmentId = null) - { - environmentVariables ??= new Dictionary(); - inputs ??= new List(); - tags ??= new Dictionary(); - - return new ModelPackageResult( - baseEnvironmentSource, - buildId, - buildState, - environmentVariables, - inferencingServer, - inputs?.ToList(), - logUri, - modelConfiguration, - tags, - targetEnvironmentId, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -938,7 +911,7 @@ public static MachineLearningBatchDeploymentData MachineLearningBatchDeploymentD /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Compute target for batch inference operation. @@ -1012,7 +985,7 @@ public static MachineLearningBatchDeploymentProperties MachineLearningBatchDeplo /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , and . /// /// A new instance for mocking. public static MachineLearningDatastoreData MachineLearningDatastoreData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningDatastoreProperties properties = null) @@ -1033,13 +1006,12 @@ public static MachineLearningDatastoreData MachineLearningDatastoreData(Resource /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// A new instance for mocking. - public static MachineLearningDatastoreProperties MachineLearningDatastoreProperties(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, string datastoreType = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null) + public static MachineLearningDatastoreProperties MachineLearningDatastoreProperties(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, string datastoreType = null, bool? isDefault = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -1051,7 +1023,6 @@ public static MachineLearningDatastoreProperties MachineLearningDatastorePropert serializedAdditionalRawData: null, credentials, datastoreType == null ? default : new DatastoreType(datastoreType), - intellectualProperty, isDefault); } @@ -1138,16 +1109,15 @@ public static MachineLearningFeatureSetVersionData MachineLearningFeatureSetVers /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Specifies list of entities. /// Specifies the materialization settings. /// Provisioning state for the featureset version container. /// Specifies the feature spec details. /// Specifies the asset stage. /// A new instance for mocking. - public static MachineLearningFeatureSetVersionProperties MachineLearningFeatureSetVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = null, bool? isArchived = null, IEnumerable entities = null, MaterializationSettings materializationSettings = null, RegistryAssetProvisioningState? provisioningState = null, string specificationPath = null, string stage = null) + public static MachineLearningFeatureSetVersionProperties MachineLearningFeatureSetVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, IEnumerable entities = null, MaterializationSettings materializationSettings = null, RegistryAssetProvisioningState? provisioningState = null, string specificationPath = null, string stage = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -1158,7 +1128,6 @@ public static MachineLearningFeatureSetVersionProperties MachineLearningFeatureS properties, tags, serializedAdditionalRawData: null, - autoDeleteSetting, isAnonymous, isArchived, entities?.ToList(), @@ -1168,32 +1137,14 @@ public static MachineLearningFeatureSetVersionProperties MachineLearningFeatureS stage); } - /// Initializes a new instance of . - /// Specifies the created date. - /// Specifies the display name. - /// Specifies the duration. - /// Specifies the experiment id. - /// Specifies the backfill feature window to be materialized. - /// Specifies the job id. - /// Specifies the job status. - /// Specifies the tags if any. - /// Specifies the feature store job type. - /// A new instance for mocking. - public static MachineLearningFeatureSetJob MachineLearningFeatureSetJob(DateTimeOffset? createdOn = null, string displayName = null, TimeSpan? duration = null, string experimentId = null, FeatureWindow featureWindow = null, string jobId = null, MachineLearningJobStatus? status = null, IReadOnlyDictionary tags = null, FeatureStoreJobType? featureStoreJobType = null) + /// Initializes a new instance of . + /// List of jobs submitted as part of the backfill request. + /// A new instance for mocking. + public static FeaturesetVersionBackfillResponse FeaturesetVersionBackfillResponse(IEnumerable jobIds = null) { - tags ??= new Dictionary(); + jobIds ??= new List(); - return new MachineLearningFeatureSetJob( - createdOn, - displayName, - duration, - experimentId, - featureWindow, - jobId, - status, - tags, - featureStoreJobType, - serializedAdditionalRawData: null); + return new FeaturesetVersionBackfillResponse(jobIds?.ToList(), serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -1261,14 +1212,13 @@ public static MachineLearningFeaturestoreEntityVersionData MachineLearningFeatur /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Specifies index columns. /// Provisioning state for the featurestore entity version. /// Specifies the asset stage. /// A new instance for mocking. - public static MachineLearningFeatureStoreEntityVersionProperties MachineLearningFeatureStoreEntityVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = null, bool? isArchived = null, IEnumerable indexColumns = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) + public static MachineLearningFeatureStoreEntityVersionProperties MachineLearningFeatureStoreEntityVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, IEnumerable indexColumns = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -1279,7 +1229,6 @@ public static MachineLearningFeatureStoreEntityVersionProperties MachineLearning properties, tags, serializedAdditionalRawData: null, - autoDeleteSetting, isAnonymous, isArchived, indexColumns?.ToList(), @@ -1295,7 +1244,7 @@ public static MachineLearningFeatureStoreEntityVersionProperties MachineLearning /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// /// A new instance for mocking. public static MachineLearningJobData MachineLearningJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningJobProperties properties = null) @@ -1326,18 +1275,16 @@ public static MachineLearningJobData MachineLearningJobData(ResourceIdentifier i /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. /// /// Status of the job. /// A new instance for mocking. - public static MachineLearningJobProperties MachineLearningJobProperties(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, string jobType = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null) + public static MachineLearningJobProperties MachineLearningJobProperties(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, string jobType = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); services ??= new Dictionary(); return new MachineLearningJobProperties( @@ -1353,7 +1300,6 @@ public static MachineLearningJobProperties MachineLearningJobProperties(string d isArchived, jobType == null ? default : new JobType(jobType), notificationSetting, - secretsConfiguration, services, status); } @@ -1368,7 +1314,7 @@ public static MachineLearningJobProperties MachineLearningJobProperties(string d /// 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 . /// - /// Port for endpoint set by user. + /// Port for endpoint. /// Additional properties to set on the endpoint. /// Status of endpoint. /// A new instance for mocking. @@ -1387,142 +1333,6 @@ public static MachineLearningJobService MachineLearningJobService(string endpoin serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// [Required] Additional attributes of the entity. - /// A new instance for mocking. - public static MachineLearningLabelingJobData MachineLearningLabelingJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, LabelingJobProperties properties = null) - { - return new MachineLearningLabelingJobData( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The asset description text. - /// The asset property dictionary. - /// Tag dictionary. Tags can be added, removed, and updated. - /// ARM resource ID of the component resource. - /// ARM resource ID of the compute resource. - /// Display name of job. - /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. - /// - /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. - /// Defaults to AmlToken if null. - /// 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 . - /// - /// Is the asset archived?. - /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. - /// - /// List of JobEndpoints. - /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - /// - /// Status of the job. - /// Created time of the job in UTC timezone. - /// Configuration of data used in the job. - /// Labeling instructions of the job. - /// Label categories of the job. - /// - /// Media type specific properties in the job. - /// 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 . - /// - /// - /// Configuration of MLAssist feature in the job. - /// 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 . - /// - /// Progress metrics of the job. - /// Internal id of the job(Previously called project). - /// Specifies the labeling job provisioning state. - /// Status messages of the job. - /// A new instance for mocking. - public static LabelingJobProperties LabelingJobProperties(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null, DateTimeOffset? createdOn = null, LabelingDataConfiguration dataConfiguration = null, Uri jobInstructionsUri = null, IDictionary labelCategories = null, LabelingJobMediaProperties labelingJobMediaProperties = null, MachineLearningAssistConfiguration mlAssistConfiguration = null, ProgressMetrics progressMetrics = null, Guid? projectId = null, JobProvisioningState? provisioningState = null, IEnumerable statusMessages = null) - { - properties ??= new Dictionary(); - tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); - services ??= new Dictionary(); - labelCategories ??= new Dictionary(); - statusMessages ??= new List(); - - return new LabelingJobProperties( - description, - properties, - tags, - serializedAdditionalRawData: null, - componentId, - computeId, - displayName, - experimentName, - identity, - isArchived, - JobType.Labeling, - notificationSetting, - secretsConfiguration, - services, - status, - createdOn, - dataConfiguration, - jobInstructionsUri != null ? new LabelingJobInstructions(jobInstructionsUri, serializedAdditionalRawData: null) : null, - labelCategories, - labelingJobMediaProperties, - mlAssistConfiguration, - progressMetrics, - projectId, - provisioningState, - statusMessages?.ToList()); - } - - /// Initializes a new instance of . - /// The completed datapoint count. - /// The time of last successful incremental data refresh in UTC. - /// The skipped datapoint count. - /// The total datapoint count. - /// A new instance for mocking. - public static ProgressMetrics ProgressMetrics(long? completedDatapointCount = null, DateTimeOffset? incrementalDataLastRefreshOn = null, long? skippedDatapointCount = null, long? totalDatapointCount = null) - { - return new ProgressMetrics(completedDatapointCount, incrementalDataLastRefreshOn, skippedDatapointCount, totalDatapointCount, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Service-defined message code. - /// Time in UTC at which the message was created. - /// Severity level of message. - /// A human-readable representation of the message code. - /// A new instance for mocking. - public static JobStatusMessage JobStatusMessage(string code = null, DateTimeOffset? createdOn = null, JobStatusMessageLevel? level = null, string message = null) - { - return new JobStatusMessage(code, createdOn, level, message, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// [Required] The format of exported labels, also as the discriminator. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// A new instance for mocking. - public static ExportSummary ExportSummary(DateTimeOffset? endOn = null, long? exportedRowCount = null, string format = null, string labelingJobId = null, DateTimeOffset? startOn = null) - { - return new UnknownExportSummary( - endOn, - exportedRowCount, - format == null ? default : new ExportFormatType(format), - labelingJobId, - startOn, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -1630,7 +1440,7 @@ public static MachineLearningOnlineDeploymentData MachineLearningOnlineDeploymen /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// If true, enables Application Insights logging. @@ -1762,7 +1572,7 @@ public static MachineLearningScheduleData MachineLearningScheduleData(ResourceId /// /// [Required] Specifies the action of the schedule /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// /// Display name of schedule. /// Is the schedule enabled?. @@ -1790,6 +1600,69 @@ public static MachineLearningScheduleProperties MachineLearningSchedulePropertie trigger); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Managed service identity (system assigned and/or user assigned identities). + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// [Required] Additional attributes of the entity. + /// Sku details required for ARM contract for Autoscaling. + /// A new instance for mocking. + public static ServerlessEndpointData ServerlessEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, ServerlessEndpointProperties properties = null, MachineLearningSku sku = null) + { + tags ??= new Dictionary(); + + return new ServerlessEndpointData( + id, + name, + resourceType, + systemData, + tags, + location, + identity, + kind, + properties, + sku, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// [Required] Specifies the authentication mode for the Serverless endpoint. + /// Specifies the content safety options. If omitted, the default content safety settings will be configured. + /// The current state of the ServerlessEndpoint. + /// The inference uri to target when making requests against the serverless endpoint. + /// The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint. + /// The model settings (model id) for the model being serviced on the ServerlessEndpoint. + /// Provisioning state for the endpoint. + /// A new instance for mocking. + public static ServerlessEndpointProperties ServerlessEndpointProperties(ServerlessInferenceEndpointAuthMode authMode = default, ContentSafetyStatus? contentSafetyStatus = null, ServerlessEndpointState? endpointState = null, ServerlessInferenceEndpoint inferenceEndpoint = null, string marketplaceSubscriptionId = null, string modelId = null, MachineLearningEndpointProvisioningState? provisioningState = null) + { + return new ServerlessEndpointProperties( + authMode, + contentSafetyStatus.HasValue ? new ContentSafety(contentSafetyStatus.Value, serializedAdditionalRawData: null) : null, + endpointState, + inferenceEndpoint, + marketplaceSubscriptionId, + modelId != null ? new ModelSettings(modelId, serializedAdditionalRawData: null) : null, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Specifies any required headers to target this serverless endpoint. + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + /// A new instance for mocking. + public static ServerlessInferenceEndpoint ServerlessInferenceEndpoint(IReadOnlyDictionary headers = null, Uri uri = null) + { + headers ??= new Dictionary(); + + return new ServerlessInferenceEndpoint(headers, uri, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -1803,18 +1676,20 @@ public static MachineLearningScheduleProperties MachineLearningSchedulePropertie /// Discovery URL for the Registry. /// IntellectualPropertyPublisher for the registry. /// ResourceId of the managed RG if the registry has system created resources. + /// Managed resource group specific settings. /// MLFlow Registry URI for the Registry. - /// Private endpoint connections info used for pending connections in private link portal. + /// Private endpoint connections info used for pending connections in private link portal. /// /// Is the Registry accessible from the internet? /// Possible values: "Enabled" or "Disabled" /// /// Details of each region the registry is in. /// A new instance for mocking. - public static MachineLearningRegistryData MachineLearningRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningSku sku = null, Uri discoveryUri = null, string intellectualPropertyPublisher = null, ResourceIdentifier managedResourceId = null, Uri mlFlowRegistryUri = null, IEnumerable privateEndpointConnections = null, string publicNetworkAccess = null, IEnumerable regionDetails = null) + public static MachineLearningRegistryData MachineLearningRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningSku sku = null, Uri discoveryUri = null, string intellectualPropertyPublisher = null, ResourceIdentifier managedResourceId = null, IEnumerable managedResourceGroupAssignedIdentities = null, Uri mlFlowRegistryUri = null, IEnumerable registryPrivateEndpointConnections = null, string publicNetworkAccess = null, IEnumerable regionDetails = null) { tags ??= new Dictionary(); - privateEndpointConnections ??= new List(); + managedResourceGroupAssignedIdentities ??= new List(); + registryPrivateEndpointConnections ??= new List(); regionDetails ??= new List(); return new MachineLearningRegistryData( @@ -1830,13 +1705,22 @@ public static MachineLearningRegistryData MachineLearningRegistryData(ResourceId discoveryUri, intellectualPropertyPublisher, managedResourceId != null ? new ArmResourceId(managedResourceId, serializedAdditionalRawData: null) : null, + managedResourceGroupAssignedIdentities != null ? new ManagedResourceGroupSettings(managedResourceGroupAssignedIdentities?.ToList(), serializedAdditionalRawData: null) : null, mlFlowRegistryUri, - privateEndpointConnections?.ToList(), + registryPrivateEndpointConnections?.ToList(), publicNetworkAccess, regionDetails?.ToList(), serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Identity principal Id. + /// A new instance for mocking. + public static ManagedResourceGroupAssignedIdentities ManagedResourceGroupAssignedIdentities(Guid? principalId = null) + { + return new ManagedResourceGroupAssignedIdentities(principalId, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The ARM identifier for Private Endpoint. /// The subnetId that the private endpoint is connected to. @@ -1875,6 +1759,7 @@ public static MachineLearningUserFeature MachineLearningUserFeature(string id = /// /// Optional. This field is required to be implemented by the RP because AML is supporting more than one tier. /// The flag to indicate whether to allow public access when behind VNet. + /// The flag to indicate whether we will do role assignment for the workspace MSI on resource group level. /// ARM id of the application insights associated with this workspace. /// /// @@ -1882,6 +1767,9 @@ public static MachineLearningUserFeature MachineLearningUserFeature(string id = /// The description of this workspace. /// Url for the discovery service to identify regional endpoints for machine learning experimentation services. /// + /// + /// Flag to tell if simplified CMK should be enabled for this workspace. + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. /// /// /// Settings for feature store type workspace. @@ -1889,6 +1777,7 @@ public static MachineLearningUserFeature MachineLearningUserFeature(string id = /// The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service. /// /// The compute name for image build. + /// The list of IPv4 addresses that are allowed to access the workspace. /// ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created. /// /// Managed Network settings for a machine learning workspace. @@ -1899,6 +1788,7 @@ public static MachineLearningUserFeature MachineLearningUserFeature(string id = /// Count of private connections in the workspace. /// The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. /// Whether requests from Public Network are allowed. + /// Settings for serverless compute in a workspace. /// The service managed resource settings. /// The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace. /// The list of shared private link resources in this workspace. @@ -1912,12 +1802,13 @@ public static MachineLearningUserFeature MachineLearningUserFeature(string id = /// WorkspaceHub's configuration object. /// The immutable id associated with this workspace. /// A new instance for mocking. - public static MachineLearningWorkspaceData MachineLearningWorkspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningSku sku = null, bool? allowPublicAccessWhenBehindVnet = null, string applicationInsights = null, IEnumerable associatedWorkspaces = null, IEnumerable containerRegistries = null, string containerRegistry = null, string description = null, Uri discoveryUri = null, bool? enableDataIsolation = null, MachineLearningEncryptionSetting encryption = null, IEnumerable existingWorkspaces = null, FeatureStoreSettings featureStoreSettings = null, string friendlyName = null, bool? isHbiWorkspace = null, ResourceIdentifier hubResourceId = null, string imageBuildCompute = null, string keyVault = null, IEnumerable keyVaults = null, ManagedNetworkSettings managedNetwork = null, Uri mlFlowTrackingUri = null, MachineLearningNotebookResourceInfo notebookInfo = null, string primaryUserAssignedIdentity = null, IEnumerable privateEndpointConnections = null, int? privateLinkCount = null, MachineLearningProvisioningState? provisioningState = null, MachineLearningPublicNetworkAccessType? publicNetworkAccessType = null, int? cosmosDbCollectionsThroughput = null, string serviceProvisionedResourceGroup = null, IEnumerable sharedPrivateLinkResources = null, int? softDeleteRetentionInDays = null, string storageAccount = null, IEnumerable storageAccounts = null, bool? isStorageHnsEnabled = null, string systemDatastoresAuthMode = null, Guid? tenantId = null, bool? isV1LegacyMode = null, WorkspaceHubConfig workspaceHubConfig = null, string workspaceId = null) + public static MachineLearningWorkspaceData MachineLearningWorkspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningSku sku = null, bool? allowPublicAccessWhenBehindVnet = null, bool? allowRoleAssignmentOnRG = null, string applicationInsights = null, IEnumerable associatedWorkspaces = null, IEnumerable containerRegistries = null, string containerRegistry = null, string description = null, Uri discoveryUri = null, bool? enableDataIsolation = null, bool? enableServiceSideCMKEncryption = null, bool? enableSimplifiedCmk = null, bool? enableSoftwareBillOfMaterials = null, MachineLearningEncryptionSetting encryption = null, IEnumerable existingWorkspaces = null, FeatureStoreSettings featureStoreSettings = null, string friendlyName = null, bool? isHbiWorkspace = null, ResourceIdentifier hubResourceId = null, string imageBuildCompute = null, IEnumerable ipAllowlist = null, string keyVault = null, IEnumerable keyVaults = null, ManagedNetworkSettings managedNetwork = null, Uri mlFlowTrackingUri = null, MachineLearningNotebookResourceInfo notebookInfo = null, string primaryUserAssignedIdentity = null, IEnumerable privateEndpointConnections = null, int? privateLinkCount = null, MachineLearningProvisioningState? provisioningState = null, MachineLearningPublicNetworkAccessType? publicNetworkAccessType = null, ServerlessComputeSettings serverlessComputeSettings = null, int? cosmosDbCollectionsThroughput = null, string serviceProvisionedResourceGroup = null, IEnumerable sharedPrivateLinkResources = null, int? softDeleteRetentionInDays = null, string storageAccount = null, IEnumerable storageAccounts = null, bool? isStorageHnsEnabled = null, string systemDatastoresAuthMode = null, Guid? tenantId = null, bool? isV1LegacyMode = null, WorkspaceHubConfig workspaceHubConfig = null, string workspaceId = null) { tags ??= new Dictionary(); associatedWorkspaces ??= new List(); containerRegistries ??= new List(); existingWorkspaces ??= new List(); + ipAllowlist ??= new List(); keyVaults ??= new List(); privateEndpointConnections ??= new List(); sharedPrivateLinkResources ??= new List(); @@ -1934,6 +1825,7 @@ public static MachineLearningWorkspaceData MachineLearningWorkspaceData(Resource kind, sku, allowPublicAccessWhenBehindVnet, + allowRoleAssignmentOnRG, applicationInsights, associatedWorkspaces?.ToList(), containerRegistries?.ToList(), @@ -1941,6 +1833,9 @@ public static MachineLearningWorkspaceData MachineLearningWorkspaceData(Resource description, discoveryUri, enableDataIsolation, + enableServiceSideCMKEncryption, + enableSimplifiedCmk, + enableSoftwareBillOfMaterials, encryption, existingWorkspaces?.ToList(), featureStoreSettings, @@ -1948,6 +1843,7 @@ public static MachineLearningWorkspaceData MachineLearningWorkspaceData(Resource isHbiWorkspace, hubResourceId, imageBuildCompute, + ipAllowlist?.ToList(), keyVault, keyVaults?.ToList(), managedNetwork, @@ -1958,6 +1854,7 @@ public static MachineLearningWorkspaceData MachineLearningWorkspaceData(Resource privateLinkCount, provisioningState, publicNetworkAccessType, + serverlessComputeSettings, cosmosDbCollectionsThroughput != null ? new ServiceManagedResourcesSettings(new CosmosDbSettings(cosmosDbCollectionsThroughput, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, serviceProvisionedResourceGroup, sharedPrivateLinkResources?.ToList(), @@ -1978,16 +1875,37 @@ public static MachineLearningWorkspaceData MachineLearningWorkspaceData(Resource /// /// /// Dictionary of <OutboundRule> - /// 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 . + /// 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 . /// /// Status of the Provisioning for the managed network of a machine learning workspace. + /// /// A new instance for mocking. - public static ManagedNetworkSettings ManagedNetworkSettings(IsolationMode? isolationMode = null, string networkId = null, IDictionary outboundRules = null, ManagedNetworkProvisionStatus status = null) + public static ManagedNetworkSettings ManagedNetworkSettings(IsolationMode? isolationMode = null, string networkId = null, IDictionary outboundRules = null, ManagedNetworkProvisionStatus status = null, IEnumerable changeableIsolationModes = null) { outboundRules ??= new Dictionary(); + changeableIsolationModes ??= new List(); - return new ManagedNetworkSettings(isolationMode, networkId, outboundRules, status, serializedAdditionalRawData: null); + return new ManagedNetworkSettings( + isolationMode, + networkId, + outboundRules, + status, + changeableIsolationModes?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of a managed network Outbound Rule of a machine learning workspace. + /// + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// A new instance for mocking. + public static MachineLearningOutboundRule MachineLearningOutboundRule(OutboundRuleCategory? category = null, IEnumerable parentRuleNames = null, OutboundRuleStatus? status = null, string outboundRuleType = null) + { + parentRuleNames ??= new List(); + + return new UnknownOutboundRule(category, parentRuleNames?.ToList(), status, outboundRuleType == null ? default : new OutboundRuleType(outboundRuleType), serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -2057,8 +1975,8 @@ public static MachineLearningPrivateEndpoint MachineLearningPrivateEndpoint(Reso /// The resourceType. /// The systemData. /// - /// 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 . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , and . /// /// A new instance for mocking. public static MachineLearningWorkspaceConnectionData MachineLearningWorkspaceConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningWorkspaceConnectionProperties properties = null) @@ -2072,6 +1990,246 @@ public static MachineLearningWorkspaceConnectionData MachineLearningWorkspaceCon serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningWorkspaceConnectionProperties MachineLearningWorkspaceConnectionProperties(string authType = null, MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new UnknownWorkspaceConnectionPropertiesV2( + authType == null ? default : new MachineLearningConnectionAuthType(authType), + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// A new instance for mocking. + public static EndpointDeploymentResourcePropertiesBasicResourceData EndpointDeploymentResourcePropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EndpointDeploymentResourceProperties properties = null) + { + return new EndpointDeploymentResourcePropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// A new instance for mocking. + public static EndpointDeploymentResourceProperties EndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, string endpointDeploymentResourcePropertiesType = null) + { + return new UnknownEndpointDeploymentResourceProperties(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The capabilities. + /// + /// The capabilities for finetune models. + /// Deployment model format. + /// If the model is default version. + /// Model lifecycle status. + /// The max capacity. + /// Deployment model name. + /// The list of Model Sku. + /// Metadata pertaining to creation and last modification of the resource. + /// Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version is different for different models and might change when there is new version available for a model. Default version for a model could be found from list models API. + /// A new instance for mocking. + public static EndpointModelProperties EndpointModelProperties(IReadOnlyDictionary capabilities = null, EndpointModelDeprecationProperties deprecation = null, IReadOnlyDictionary finetuneCapabilities = null, string format = null, bool? isDefaultVersion = null, ModelLifecycleStatus? lifecycleStatus = null, int? maxCapacity = null, string name = null, IEnumerable skus = null, SystemData systemData = null, string version = null) + { + capabilities ??= new Dictionary(); + finetuneCapabilities ??= new Dictionary(); + skus ??= new List(); + + return new EndpointModelProperties( + capabilities, + deprecation, + finetuneCapabilities, + format, + isDefaultVersion, + lifecycleStatus, + maxCapacity, + name, + skus?.ToList(), + systemData, + version, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The datetime of deprecation of the fineTune Model. + /// The datetime of deprecation of the inference Model. + /// A new instance for mocking. + public static EndpointModelDeprecationProperties EndpointModelDeprecationProperties(DateTimeOffset? fineTune = null, DateTimeOffset? inference = null) + { + return new EndpointModelDeprecationProperties(fineTune, inference, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// The list of ARM id for the connection support this SKU. + /// The datetime of deprecation of the model SKU. + /// The name of the model SKU. + /// + /// The usage name of the model SKU. + /// A new instance for mocking. + public static EndpointModelSkuProperties EndpointModelSkuProperties(EndpointModelSkuCapacityProperties capacity = null, IEnumerable connectionIds = null, DateTimeOffset? deprecationOn = null, string name = null, IEnumerable rateLimits = null, string usageName = null) + { + connectionIds ??= new List(); + rateLimits ??= new List(); + + return new EndpointModelSkuProperties( + capacity, + connectionIds?.ToList(), + deprecationOn, + name, + rateLimits?.ToList(), + usageName, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The default capacity. + /// The maximum capacity. + /// A new instance for mocking. + public static EndpointModelSkuCapacityProperties EndpointModelSkuCapacityProperties(int? @default = null, int? maximum = null) + { + return new EndpointModelSkuCapacityProperties(@default, maximum, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The count value of Call Rate Limit. + /// The renewal period in seconds of Call Rate Limit. + /// The call rate limit for the model. + /// A new instance for mocking. + public static EndpointModelSkuRateLimitProperties EndpointModelSkuRateLimitProperties(float? count = null, float? renewalPeriod = null, IEnumerable rules = null) + { + rules ??= new List(); + + return new EndpointModelSkuRateLimitProperties(count, renewalPeriod, rules?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// If the dynamic throttling is enabled. + /// + /// + /// + /// + /// A new instance for mocking. + public static EndpointModelSkuRateLimitRuleProperties EndpointModelSkuRateLimitRuleProperties(float? count = null, bool? dynamicThrottlingEnabled = null, string key = null, IEnumerable matchPatterns = null, float? minCount = null, float? renewalPeriod = null) + { + matchPatterns ??= new List(); + + return new EndpointModelSkuRateLimitRuleProperties( + count, + dynamicThrottlingEnabled, + key, + matchPatterns?.ToList(), + minCount, + renewalPeriod, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static EndpointModelSkuRateLimitRulePatternProperties EndpointModelSkuRateLimitRulePatternProperties(string method = null, string path = null) + { + return new EndpointModelSkuRateLimitRulePatternProperties(method, path, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// RAI Custom Blocklist properties. + /// A new instance for mocking. + public static RaiBlocklistPropertiesBasicResourceData RaiBlocklistPropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string raiBlocklistDescription = null) + { + return new RaiBlocklistPropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + raiBlocklistDescription != null ? new RaiBlocklistProperties(raiBlocklistDescription, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// RAI Custom Blocklist Item properties. + /// A new instance for mocking. + public static RaiBlocklistItemPropertiesBasicResourceData RaiBlocklistItemPropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RaiBlocklistItemProperties properties = null) + { + return new RaiBlocklistItemPropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Azure OpenAI Content Filters properties. + /// A new instance for mocking. + public static RaiPolicyPropertiesBasicResourceData RaiPolicyPropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RaiPolicyProperties properties = null) + { + return new RaiPolicyPropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// /// A new instance for mocking. @@ -2126,6 +2284,77 @@ public static MachineLearningDiagnoseResult MachineLearningDiagnoseResult(string return new MachineLearningDiagnoseResult(code, level, message, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// A new instance for mocking. + public static EndpointResourcePropertiesBasicResourceData EndpointResourcePropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EndpointResourceProperties properties = null) + { + return new EndpointResourcePropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// A new instance for mocking. + public static EndpointResourceProperties EndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, string endpointType = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null) + { + deployments ??= new List(); + + return new UnknownEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + endpointType == null ? default : new EndpointType(endpointType), + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Dictionary of Keys for the endpoint. + /// A new instance for mocking. + public static EndpointKeys EndpointKeys(AccountApiKeys keys = null) + { + return new EndpointKeys(keys, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static AccountApiKeys AccountApiKeys(string key1 = null, string key2 = null) + { + return new AccountApiKeys(key1, key2, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The access key of the workspace app insights. /// @@ -2251,8 +2480,8 @@ public static MachineLearningFqdnEndpointDetail MachineLearningFqdnEndpointDetai /// The systemData. /// /// Outbound Rule for the managed network of a machine learning workspace. - /// 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 . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . /// /// A new instance for mocking. public static MachineLearningOutboundRuleBasicData MachineLearningOutboundRuleBasicData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningOutboundRule properties = null) @@ -2510,10 +2739,31 @@ public static MachineLearningComputeInstanceSshSettings MachineLearningComputeIn /// Specifies the current operating system image version this compute instance is running on. /// Specifies the latest available operating system image version. /// Specifies whether this compute instance is running on the latest operating system image. + /// Metadata about the os patching. /// A new instance for mocking. - public static ImageMetadata ImageMetadata(string currentImageVersion = null, string latestImageVersion = null, bool? isLatestOSImageVersion = null) + public static ImageMetadata ImageMetadata(string currentImageVersion = null, string latestImageVersion = null, bool? isLatestOSImageVersion = null, OSPatchingStatus osPatchingStatus = null) { - return new ImageMetadata(currentImageVersion, latestImageVersion, isLatestOSImageVersion, serializedAdditionalRawData: null); + return new ImageMetadata(currentImageVersion, latestImageVersion, isLatestOSImageVersion, osPatchingStatus, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The os patching status. + /// Time of the latest os patching. + /// Specifies whether this compute instance is pending for reboot to finish os patching. + /// Time of scheduled reboot. + /// Collection of errors encountered when doing os patching. + /// A new instance for mocking. + public static OSPatchingStatus OSPatchingStatus(PatchStatus? patchStatus = null, DateTimeOffset? latestPatchOn = null, bool? rebootPending = null, DateTimeOffset? scheduledRebootOn = null, IEnumerable osPatchingErrors = null) + { + osPatchingErrors ??= new List(); + + return new OSPatchingStatus( + patchStatus, + latestPatchOn, + rebootPending, + scheduledRebootOn, + osPatchingErrors?.ToList(), + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -2621,32 +2871,6 @@ public static MachineLearningComputeInstanceDataDisk MachineLearningComputeInsta return new MachineLearningComputeInstanceDataDisk(caching, diskSizeGB, lun, storageAccountType, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Source of the ComputeInstance data mount. - /// Data source type. - /// name of the ComputeInstance data mount. - /// Mount Action. - /// who this data mount created by. - /// Path of this data mount. - /// Mount state. - /// The time when the disk mounted. - /// Error of this data mount. - /// A new instance for mocking. - public static MachineLearningComputeInstanceDataMount MachineLearningComputeInstanceDataMount(string source = null, MachineLearningSourceType? sourceType = null, string mountName = null, MachineLearningMountAction? mountAction = null, string createdBy = null, string mountPath = null, MachineLearningMountState? mountState = null, DateTimeOffset? mountedOn = null, string error = null) - { - return new MachineLearningComputeInstanceDataMount( - source, - sourceType, - mountName, - mountAction, - createdBy, - mountPath, - mountState, - mountedOn, - error, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// Location for the underlying compute. /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. @@ -2904,7 +3128,6 @@ public static MachineLearningDatabricksComputeSecrets MachineLearningDatabricksC /// /// Is the asset archived?. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -2920,7 +3143,7 @@ public static MachineLearningDatabricksComputeSecrets MachineLearningDatabricksC /// 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 . /// - /// Queue settings for the job. + /// Queue settings for the job. /// Compute Resource configuration for the job. /// /// [Required] This represents scenario which can be one of Tables/NLP/Image @@ -2928,11 +3151,10 @@ public static MachineLearningDatabricksComputeSecrets MachineLearningDatabricksC /// The available derived classes include , , , , , , , , and . /// /// A new instance for mocking. - public static AutoMLJob AutoMLJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null, string environmentId = null, IDictionary environmentVariables = null, IDictionary outputs = null, JobQueueSettings queueSettings = null, MachineLearningJobResourceConfiguration resources = null, AutoMLVertical taskDetails = null) + public static AutoMLJob AutoMLJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, string environmentId = null, IDictionary environmentVariables = null, IDictionary outputs = null, JobTier? queueJobTier = null, MachineLearningJobResourceConfiguration resources = null, AutoMLVertical taskDetails = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); services ??= new Dictionary(); environmentVariables ??= new Dictionary(); outputs ??= new Dictionary(); @@ -2950,13 +3172,12 @@ public static AutoMLJob AutoMLJob(string description = null, IDictionary /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// Storage account name. /// Storage account container name. @@ -2980,7 +3200,7 @@ public static AutoMLJob AutoMLJob(string description = null, IDictionary Azure Resource Group name. /// Azure Subscription Id. /// A new instance for mocking. - public static MachineLearningAzureBlobDatastore MachineLearningAzureBlobDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null, string accountName = null, string containerName = null, string endpoint = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) + public static MachineLearningAzureBlobDatastore MachineLearningAzureBlobDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, string accountName = null, string containerName = null, string endpoint = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -2992,7 +3212,6 @@ public static MachineLearningAzureBlobDatastore MachineLearningAzureBlobDatastor serializedAdditionalRawData: null, credentials, DatastoreType.AzureBlob, - intellectualProperty, isDefault, accountName, containerName, @@ -3010,16 +3229,15 @@ public static MachineLearningAzureBlobDatastore MachineLearningAzureBlobDatastor /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// Indicates which identity to use to authenticate service data access to customer's storage. /// [Required] Azure Data Lake store name. /// Azure Resource Group name. /// Azure Subscription Id. /// A new instance for mocking. - public static MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureDataLakeGen1Datastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string storeName = null, string resourceGroup = null, string subscriptionId = null) + public static MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureDataLakeGen1Datastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string storeName = null, string resourceGroup = null, string subscriptionId = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -3031,7 +3249,6 @@ public static MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureData serializedAdditionalRawData: null, credentials, DatastoreType.AzureDataLakeGen1, - intellectualProperty, isDefault, serviceDataAccessAuthIdentity, storeName, @@ -3046,9 +3263,8 @@ public static MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureData /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// [Required] Storage account name. /// Azure cloud endpoint for the storage account. @@ -3058,7 +3274,7 @@ public static MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureData /// Azure Resource Group name. /// Azure Subscription Id. /// A new instance for mocking. - public static MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureDataLakeGen2Datastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null, string accountName = null, string endpoint = null, string filesystem = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) + public static MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureDataLakeGen2Datastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, string accountName = null, string endpoint = null, string filesystem = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -3070,7 +3286,6 @@ public static MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureData serializedAdditionalRawData: null, credentials, DatastoreType.AzureDataLakeGen2, - intellectualProperty, isDefault, accountName, endpoint, @@ -3088,9 +3303,8 @@ public static MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureData /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// [Required] Storage account name. /// Azure cloud endpoint for the storage account. @@ -3100,7 +3314,7 @@ public static MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureData /// Azure Resource Group name. /// Azure Subscription Id. /// A new instance for mocking. - public static MachineLearningAzureFileDatastore MachineLearningAzureFileDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null, string accountName = null, string endpoint = null, string fileShareName = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) + public static MachineLearningAzureFileDatastore MachineLearningAzureFileDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, string accountName = null, string endpoint = null, string fileShareName = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -3112,7 +3326,6 @@ public static MachineLearningAzureFileDatastore MachineLearningAzureFileDatastor serializedAdditionalRawData: null, credentials, DatastoreType.AzureFile, - intellectualProperty, isDefault, accountName, endpoint, @@ -3123,27 +3336,6 @@ public static MachineLearningAzureFileDatastore MachineLearningAzureFileDatastor subscriptionId); } - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// The container name to which the labels will be exported. - /// The output path where the labels will be exported. - /// A new instance for mocking. - public static CocoExportSummary CocoExportSummary(DateTimeOffset? endOn = null, long? exportedRowCount = null, string labelingJobId = null, DateTimeOffset? startOn = null, string containerName = null, string snapshotPath = null) - { - return new CocoExportSummary( - endOn, - exportedRowCount, - ExportFormatType.Coco, - labelingJobId, - startOn, - serializedAdditionalRawData: null, - containerName, - snapshotPath); - } - /// Initializes a new instance of . /// The asset description text. /// The asset property dictionary. @@ -3160,19 +3352,17 @@ public static CocoExportSummary CocoExportSummary(DateTimeOffset? endOn = null, /// /// Is the asset archived?. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. /// /// Status of the job. - /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// ARM resource ID of the code asset. /// [Required] The command to execute on startup of the job. eg. "python train.py". /// - /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, Ray, or null. + /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// /// [Required] The ARM resource ID of the Environment specification for the job. /// Environment variables included in the job. @@ -3188,14 +3378,13 @@ public static CocoExportSummary CocoExportSummary(DateTimeOffset? endOn = null, /// The available derived classes include , , , , and . /// /// Input parameters. - /// Queue settings for the job. + /// Queue settings for the job. /// Compute Resource configuration for the job. /// A new instance for mocking. - public static MachineLearningCommandJob MachineLearningCommandJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null, MachineLearningFlowAutoLoggerState? mlflowAutologger = null, ResourceIdentifier codeId = null, string command = null, MachineLearningDistributionConfiguration distribution = null, ResourceIdentifier environmentId = null, IDictionary environmentVariables = null, IDictionary inputs = null, MachineLearningCommandJobLimits limits = null, IDictionary outputs = null, BinaryData parameters = null, JobQueueSettings queueSettings = null, MachineLearningJobResourceConfiguration resources = null) + public static MachineLearningCommandJob MachineLearningCommandJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, ResourceIdentifier codeId = null, string command = null, MachineLearningDistributionConfiguration distribution = null, ResourceIdentifier environmentId = null, IDictionary environmentVariables = null, IDictionary inputs = null, MachineLearningCommandJobLimits limits = null, IDictionary outputs = null, BinaryData parameters = null, JobTier? queueJobTier = null, MachineLearningJobResourceConfiguration resources = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); services ??= new Dictionary(); environmentVariables ??= new Dictionary(); inputs ??= new Dictionary(); @@ -3214,10 +3403,8 @@ public static MachineLearningCommandJob MachineLearningCommandJob(string descrip isArchived, JobType.Command, notificationSetting, - secretsConfiguration, services, status, - mlflowAutologger.HasValue ? new AutologgerSettings(mlflowAutologger.Value, serializedAdditionalRawData: null) : null, codeId, command, distribution, @@ -3227,88 +3414,86 @@ public static MachineLearningCommandJob MachineLearningCommandJob(string descrip limits, outputs, parameters, - queueSettings, + queueJobTier != null ? new JobQueueSettings(queueJobTier, serializedAdditionalRawData: null) : null, resources); } - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// The container name to which the labels will be exported. - /// The output path where the labels will be exported. - /// A new instance for mocking. - public static CsvExportSummary CsvExportSummary(DateTimeOffset? endOn = null, long? exportedRowCount = null, string labelingJobId = null, DateTimeOffset? startOn = null, string containerName = null, string snapshotPath = null) + /// Initializes a new instance of . + /// DockerCredential user password. + /// DockerCredential user name. + /// A new instance for mocking. + public static DockerCredential DockerCredential(string password = null, string userName = null) { - return new CsvExportSummary( - endOn, - exportedRowCount, - ExportFormatType.CSV, - labelingJobId, - startOn, - serializedAdditionalRawData: null, - containerName, - snapshotPath); + return new DockerCredential(DataReferenceCredentialType.DockerCredentials, serializedAdditionalRawData: null, password, userName); } - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// The unique name of the labeled data asset. - /// A new instance for mocking. - public static DatasetExportSummary DatasetExportSummary(DateTimeOffset? endOn = null, long? exportedRowCount = null, string labelingJobId = null, DateTimeOffset? startOn = null, string labeledAssetName = null) - { - return new DatasetExportSummary( - endOn, - exportedRowCount, - ExportFormatType.Dataset, - labelingJobId, - startOn, - serializedAdditionalRawData: null, - labeledAssetName); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// - /// [Required] Account credentials. - /// 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 . + /// ARM resource ID of the component resource. + /// ARM resource ID of the compute resource. + /// Display name of job. + /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + /// + /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. + /// Defaults to AmlToken if null. + /// 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 . /// - /// Intellectual Property details. - /// Readonly property to indicate if datastore is the workspace default datastore. - /// The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if "Https" protocol is selected. - /// [Required] IP Address or DNS HostName. - /// Protocol used to communicate with the storage account (Https/Http). - /// A new instance for mocking. - public static HdfsDatastore HdfsDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null, string hdfsServerCertificate = null, string nameNodeAddress = null, string protocol = null) + /// Is the asset archived?. + /// Notification setting for the job. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// + /// [Required] + /// 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 . + /// + /// Instance types and other resources for the job. + /// Queue settings for the job. + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// A new instance for mocking. + public static FineTuningJob FineTuningJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, FineTuningVertical fineTuningDetails = null, IEnumerable resourcesInstanceTypes = null, JobTier? queueJobTier = null, IDictionary outputs = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); + services ??= new Dictionary(); + resourcesInstanceTypes ??= new List(); + outputs ??= new Dictionary(); - return new HdfsDatastore( + return new FineTuningJob( description, properties, tags, serializedAdditionalRawData: null, - credentials, - DatastoreType.Hdfs, - intellectualProperty, - isDefault, - hdfsServerCertificate, - nameNodeAddress, - protocol); + componentId, + computeId, + displayName, + experimentName, + identity, + isArchived, + JobType.FineTuning, + notificationSetting, + services, + status, + fineTuningDetails, + resourcesInstanceTypes != null ? new JobResources(resourcesInstanceTypes?.ToList(), serializedAdditionalRawData: null) : null, + queueJobTier != null ? new JobQueueSettings(queueJobTier, serializedAdditionalRawData: null) : null, + outputs); } /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// If true, enables Application Insights logging. @@ -3358,10 +3543,29 @@ public static MachineLearningKubernetesOnlineDeployment MachineLearningKubernete containerResourceRequirements); } + /// Initializes a new instance of . + /// ManagedIdentityCredential identity type. + /// ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. + /// TenantId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// A new instance for mocking. + public static ManagedIdentityCredential ManagedIdentityCredential(string managedIdentityType = null, string userManagedIdentityClientId = null, string userManagedIdentityPrincipalId = null, string userManagedIdentityResourceId = null, string userManagedIdentityTenantId = null) + { + return new ManagedIdentityCredential( + DataReferenceCredentialType.ManagedIdentity, + serializedAdditionalRawData: null, + managedIdentityType, + userManagedIdentityClientId, + userManagedIdentityPrincipalId, + userManagedIdentityResourceId, + userManagedIdentityTenantId); + } + /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// If true, enables Application Insights logging. @@ -3416,9 +3620,8 @@ public static MachineLearningManagedOnlineDeployment MachineLearningManagedOnlin /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// /// [Required] OneLake artifact backing the datastore. @@ -3429,7 +3632,7 @@ public static MachineLearningManagedOnlineDeployment MachineLearningManagedOnlin /// [Required] OneLake workspace name. /// Indicates which identity to use to authenticate service data access to customer's storage. /// A new instance for mocking. - public static OneLakeDatastore OneLakeDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null, OneLakeArtifact artifact = null, string endpoint = null, string oneLakeWorkspaceName = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null) + public static OneLakeDatastore OneLakeDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, OneLakeArtifact artifact = null, string endpoint = null, string oneLakeWorkspaceName = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -3441,7 +3644,6 @@ public static OneLakeDatastore OneLakeDatastore(string description = null, IDict serializedAdditionalRawData: null, credentials, DatastoreType.OneLake, - intellectualProperty, isDefault, artifact, endpoint, @@ -3465,7 +3667,6 @@ public static OneLakeDatastore OneLakeDatastore(string description = null, IDict /// /// Is the asset archived?. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -3485,11 +3686,10 @@ public static OneLakeDatastore OneLakeDatastore(string description = null, IDict /// Pipeline settings, for things like ContinueRunOnStepFailure etc. /// ARM resource ID of source job. /// A new instance for mocking. - public static MachineLearningPipelineJob MachineLearningPipelineJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null, IDictionary inputs = null, IDictionary jobs = null, IDictionary outputs = null, BinaryData settings = null, ResourceIdentifier sourceJobId = null) + public static MachineLearningPipelineJob MachineLearningPipelineJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, IDictionary inputs = null, IDictionary jobs = null, IDictionary outputs = null, BinaryData settings = null, ResourceIdentifier sourceJobId = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); services ??= new Dictionary(); inputs ??= new Dictionary(); jobs ??= new Dictionary(); @@ -3508,7 +3708,6 @@ public static MachineLearningPipelineJob MachineLearningPipelineJob(string descr isArchived, JobType.Pipeline, notificationSetting, - secretsConfiguration, services, status, inputs, @@ -3518,6 +3717,14 @@ public static MachineLearningPipelineJob MachineLearningPipelineJob(string descr sourceJobId); } + /// Initializes a new instance of . + /// Full SAS Uri, including the storage, container/blob path and SAS token. + /// A new instance for mocking. + public static SasCredential SasCredential(Uri sasUri = null) + { + return new SasCredential(DataReferenceCredentialType.Sas, serializedAdditionalRawData: null, sasUri); + } + /// Initializes a new instance of . /// Full SAS Uri, including the storage, container/blob path and SAS token. /// A new instance for mocking. @@ -3542,7 +3749,6 @@ public static SasCredentialDto SasCredentialDto(Uri sasUri = null) /// /// Is the asset archived?. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -3550,7 +3756,7 @@ public static SasCredentialDto SasCredentialDto(Uri sasUri = null) /// Status of the job. /// Archive files used in the job. /// Arguments for the job. - /// [Required] ARM resource ID of the code asset. + /// [Required] arm-id of the code asset. /// Spark configured properties. /// /// [Required] The entry to execute on startup of the job. @@ -3558,6 +3764,7 @@ public static SasCredentialDto SasCredentialDto(Uri sasUri = null) /// The available derived classes include and . /// /// The ARM resource ID of the Environment specification for the job. + /// Environment variables included in the job. /// Files used in the job. /// /// Mapping of input data bindings used in the job. @@ -3571,17 +3778,17 @@ public static SasCredentialDto SasCredentialDto(Uri sasUri = null) /// The available derived classes include , , , , and . /// /// Python files used in the job. - /// Queue settings for the job. + /// Queue settings for the job. /// Compute Resource configuration for the job. /// A new instance for mocking. - public static SparkJob SparkJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null, IEnumerable archives = null, string args = null, string codeId = null, IDictionary conf = null, SparkJobEntry entry = null, string environmentId = null, IEnumerable files = null, IDictionary inputs = null, IEnumerable jars = null, IDictionary outputs = null, IEnumerable pyFiles = null, JobQueueSettings queueSettings = null, SparkResourceConfiguration resources = null) + public static SparkJob SparkJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, IEnumerable archives = null, string args = null, ResourceIdentifier codeId = null, IDictionary conf = null, SparkJobEntry entry = null, ResourceIdentifier environmentId = null, IDictionary environmentVariables = null, IEnumerable files = null, IDictionary inputs = null, IEnumerable jars = null, IDictionary outputs = null, IEnumerable pyFiles = null, JobTier? queueJobTier = null, SparkResourceConfiguration resources = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); services ??= new Dictionary(); archives ??= new List(); conf ??= new Dictionary(); + environmentVariables ??= new Dictionary(); files ??= new List(); inputs ??= new Dictionary(); jars ??= new List(); @@ -3601,7 +3808,6 @@ public static SparkJob SparkJob(string description = null, IDictionary /// Is the asset archived?. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -3658,7 +3864,7 @@ public static SparkJob SparkJob(string description = null, IDictionary 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 . /// - /// Queue settings for the job. + /// Queue settings for the job. /// /// [Required] The hyperparameter sampling algorithm /// 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. @@ -3667,11 +3873,10 @@ public static SparkJob SparkJob(string description = null, IDictionary [Required] A dictionary containing each parameter and its distribution. The dictionary key is the name of the parameter. /// [Required] Trial component definition. /// A new instance for mocking. - public static MachineLearningSweepJob MachineLearningSweepJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null, MachineLearningEarlyTerminationPolicy earlyTermination = null, IDictionary inputs = null, MachineLearningSweepJobLimits limits = null, MachineLearningObjective objective = null, IDictionary outputs = null, JobQueueSettings queueSettings = null, SamplingAlgorithm samplingAlgorithm = null, BinaryData searchSpace = null, MachineLearningTrialComponent trial = null) + public static MachineLearningSweepJob MachineLearningSweepJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, MachineLearningEarlyTerminationPolicy earlyTermination = null, IDictionary inputs = null, MachineLearningSweepJobLimits limits = null, MachineLearningObjective objective = null, IDictionary outputs = null, JobTier? queueJobTier = null, SamplingAlgorithm samplingAlgorithm = null, BinaryData searchSpace = null, MachineLearningTrialComponent trial = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); services ??= new Dictionary(); inputs ??= new Dictionary(); outputs ??= new Dictionary(); @@ -3689,7 +3894,6 @@ public static MachineLearningSweepJob MachineLearningSweepJob(string description isArchived, JobType.Sweep, notificationSetting, - secretsConfiguration, services, status, earlyTermination, @@ -3697,7 +3901,7 @@ public static MachineLearningSweepJob MachineLearningSweepJob(string description limits, objective, outputs, - queueSettings, + queueJobTier != null ? new JobQueueSettings(queueJobTier, serializedAdditionalRawData: null) : null, samplingAlgorithm, searchSpace, trial); @@ -3715,16 +3919,11 @@ public static MachineLearningSweepJob MachineLearningSweepJob(string description /// Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. /// /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Validation data inputs. /// A new instance for mocking. - public static TextClassificationMultilabel TextClassificationMultilabel(MachineLearningLogVerbosity? logVerbosity = null, string targetColumnName = null, MachineLearningTableJobInput trainingData = null, ClassificationMultilabelPrimaryMetric? primaryMetric = null, string featurizationDatasetLanguage = null, NlpFixedParameters fixedParameters = null, NlpVerticalLimitSettings limitSettings = null, IEnumerable searchSpace = null, NlpSweepSettings sweepSettings = null, MachineLearningTableJobInput validationData = null) + public static TextClassificationMultilabel TextClassificationMultilabel(MachineLearningLogVerbosity? logVerbosity = null, string targetColumnName = null, MachineLearningTableJobInput trainingData = null, ClassificationMultilabelPrimaryMetric? primaryMetric = null, string featurizationDatasetLanguage = null, NlpVerticalLimitSettings limitSettings = null, MachineLearningTableJobInput validationData = null) { - searchSpace ??= new List(); - return new TextClassificationMultilabel( logVerbosity, targetColumnName, @@ -3733,10 +3932,7 @@ public static TextClassificationMultilabel TextClassificationMultilabel(MachineL serializedAdditionalRawData: null, primaryMetric, featurizationDatasetLanguage != null ? new NlpVerticalFeaturizationSettings(featurizationDatasetLanguage, serializedAdditionalRawData: null) : null, - fixedParameters, limitSettings, - searchSpace?.ToList(), - sweepSettings, validationData); } @@ -3752,16 +3948,11 @@ public static TextClassificationMultilabel TextClassificationMultilabel(MachineL /// Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. /// /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Validation data inputs. /// A new instance for mocking. - public static TextNer TextNer(MachineLearningLogVerbosity? logVerbosity = null, string targetColumnName = null, MachineLearningTableJobInput trainingData = null, ClassificationPrimaryMetric? primaryMetric = null, string featurizationDatasetLanguage = null, NlpFixedParameters fixedParameters = null, NlpVerticalLimitSettings limitSettings = null, IEnumerable searchSpace = null, NlpSweepSettings sweepSettings = null, MachineLearningTableJobInput validationData = null) + public static TextNer TextNer(MachineLearningLogVerbosity? logVerbosity = null, string targetColumnName = null, MachineLearningTableJobInput trainingData = null, ClassificationPrimaryMetric? primaryMetric = null, string featurizationDatasetLanguage = null, NlpVerticalLimitSettings limitSettings = null, MachineLearningTableJobInput validationData = null) { - searchSpace ??= new List(); - return new TextNer( logVerbosity, targetColumnName, @@ -3770,13 +3961,695 @@ public static TextNer TextNer(MachineLearningLogVerbosity? logVerbosity = null, serializedAdditionalRawData: null, primaryMetric, featurizationDatasetLanguage != null ? new NlpVerticalFeaturizationSettings(featurizationDatasetLanguage, serializedAdditionalRawData: null) : null, - fixedParameters, limitSettings, - searchSpace?.ToList(), - sweepSettings, validationData); } + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static AadAuthTypeWorkspaceConnectionProperties AadAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new AadAuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.Aad, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static AccessKeyAuthTypeWorkspaceConnectionProperties AccessKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, WorkspaceConnectionAccessKey credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new AccessKeyAuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.AccessKey, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Account key object for workspace connection credential. + /// A new instance for mocking. + public static AccountKeyAuthTypeWorkspaceConnectionProperties AccountKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsKey = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new AccountKeyAuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.AccountKey, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsKey != null ? new WorkspaceConnectionAccountKey(credentialsKey, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Api key object for workspace connection credential. + /// A new instance for mocking. + public static ApiKeyAuthWorkspaceConnectionProperties ApiKeyAuthWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsKey = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new ApiKeyAuthWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.ApiKey, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsKey != null ? new WorkspaceConnectionApiKey(credentialsKey, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + /// A new instance for mocking. + public static ContentSafetyEndpointDeploymentResourceProperties ContentSafetyEndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, EndpointDeploymentModel model = null, string raiPolicyName = null, DeploymentModelVersionUpgradeOption? versionUpgradeOption = null) + { + return new ContentSafetyEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + "Azure.ContentSafety", + serializedAdditionalRawData: null, + model, + raiPolicyName, + versionUpgradeOption); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// A new instance for mocking. + public static ContentSafetyEndpointResourceProperties ContentSafetyEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null) + { + deployments ??= new List(); + + return new ContentSafetyEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.AzureContentSafety, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Custom Keys credential object. + /// A new instance for mocking. + public static CustomKeysWorkspaceConnectionProperties CustomKeysWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, IDictionary credentialsKeys = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + credentialsKeys ??= new Dictionary(); + + return new CustomKeysWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.CustomKeys, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsKeys != null ? new CustomKeys(credentialsKeys, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Category of a managed network Outbound Rule of a machine learning workspace. + /// + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// + /// A new instance for mocking. + public static FqdnOutboundRule FqdnOutboundRule(OutboundRuleCategory? category = null, IEnumerable parentRuleNames = null, OutboundRuleStatus? status = null, string destination = null) + { + parentRuleNames ??= new List(); + + return new FqdnOutboundRule( + category, + parentRuleNames?.ToList(), + status, + OutboundRuleType.Fqdn, + serializedAdditionalRawData: null, + destination); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningManagedIdentityAuthTypeWorkspaceConnection MachineLearningManagedIdentityAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, MachineLearningWorkspaceConnectionManagedIdentity credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new MachineLearningManagedIdentityAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.ManagedIdentity, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Enum to determine endpoint compute type. + /// + /// A new instance for mocking. + public static ManagedOnlineEndpointDeploymentResourceProperties ManagedOnlineEndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, MachineLearningEndpointComputeType? endpointComputeType = null, string model = null) + { + return new ManagedOnlineEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + "managedOnlineEndpoint", + serializedAdditionalRawData: null, + endpointComputeType, + model); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Enum to determine endpoint authentication mode. + /// + /// + /// Dictionary of <integer>. + /// + /// Dictionary of <integer>. + /// A new instance for mocking. + public static ManagedOnlineEndpointResourceProperties ManagedOnlineEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null, MachineLearningEndpointAuthMode? authMode = null, string compute = null, string description = null, IDictionary mirrorTraffic = null, Uri scoringUri = null, IDictionary traffic = null) + { + deployments ??= new List(); + mirrorTraffic ??= new Dictionary(); + traffic ??= new Dictionary(); + + return new ManagedOnlineEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.ManagedOnlineEndpoint, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null, + authMode, + compute, + description, + mirrorTraffic, + scoringUri, + traffic); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningNoneAuthTypeWorkspaceConnection MachineLearningNoneAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new MachineLearningNoneAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.None, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + /// A new instance for mocking. + public static OAuth2AuthTypeWorkspaceConnectionProperties OAuth2AuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, WorkspaceConnectionOAuth2 credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new OAuth2AuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.OAuth2, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + /// A new instance for mocking. + public static OpenAIEndpointDeploymentResourceProperties OpenAIEndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, EndpointDeploymentModel model = null, string raiPolicyName = null, DeploymentModelVersionUpgradeOption? versionUpgradeOption = null) + { + return new OpenAIEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + "Azure.OpenAI", + serializedAdditionalRawData: null, + model, + raiPolicyName, + versionUpgradeOption); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// A new instance for mocking. + public static OpenAIEndpointResourceProperties OpenAIEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null) + { + deployments ??= new List(); + + return new OpenAIEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.AzureOpenAI, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningPatAuthTypeWorkspaceConnection MachineLearningPatAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsPat = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new MachineLearningPatAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.Pat, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsPat != null ? new WorkspaceConnectionPersonalAccessToken(credentialsPat, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Category of a managed network Outbound Rule of a machine learning workspace. + /// + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. + /// + /// A new instance for mocking. + public static PrivateEndpointOutboundRule PrivateEndpointOutboundRule(OutboundRuleCategory? category = null, IEnumerable parentRuleNames = null, OutboundRuleStatus? status = null, PrivateEndpointDestination destination = null, IEnumerable fqdns = null) + { + parentRuleNames ??= new List(); + fqdns ??= new List(); + + return new PrivateEndpointOutboundRule( + category, + parentRuleNames?.ToList(), + status, + OutboundRuleType.PrivateEndpoint, + serializedAdditionalRawData: null, + destination, + fqdns?.ToList()); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningSasAuthTypeWorkspaceConnection MachineLearningSasAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsSas = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new MachineLearningSasAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.Sas, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsSas != null ? new WorkspaceConnectionSharedAccessSignature(credentialsSas, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// + /// + /// + /// State of the Serverless Endpoint. + /// + /// + /// Anything. + /// + /// + /// A new instance for mocking. + public static ServerlessEndpointResourceProperties ServerlessEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null, ServerlessInferenceEndpointAuthMode? authMode = null, ServerlessEndpointCapacityReservation capacityReservation = null, ContentSafetyStatus? contentSafetyStatus = null, ServerlessEndpointState? endpointState = null, ServerlessEndpointInferenceEndpoint inferenceEndpoint = null, string marketplaceSubscriptionId = null, BinaryData metadata = null, string modelId = null, ServerlessOffer offer = null) + { + deployments ??= new List(); + + return new ServerlessEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.ServerlessEndpoint, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null, + authMode, + capacityReservation, + contentSafetyStatus.HasValue ? new ServerlessEndpointContentSafety(contentSafetyStatus.Value, serializedAdditionalRawData: null) : null, + endpointState, + inferenceEndpoint, + marketplaceSubscriptionId, + metadata, + modelId != null ? new ServerlessEndpointModelSettings(modelId, serializedAdditionalRawData: null) : null, + offer); + } + + /// Initializes a new instance of . + /// Dictionary of <string>. + /// + /// A new instance for mocking. + public static ServerlessEndpointInferenceEndpoint ServerlessEndpointInferenceEndpoint(IReadOnlyDictionary headers = null, Uri uri = null) + { + headers ??= new Dictionary(); + + return new ServerlessEndpointInferenceEndpoint(headers, uri, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ServicePrincipalAuthTypeWorkspaceConnectionProperties ServicePrincipalAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, WorkspaceConnectionServicePrincipal credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new ServicePrincipalAuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.ServicePrincipal, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + /// Initializes a new instance of . /// The action enum for networking rule. /// Optional, if provided, the ServiceTag property will be ignored. @@ -3796,5 +4669,113 @@ public static ServiceTagDestination ServiceTagDestination(NetworkingRuleAction? serviceTag, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// Category of a managed network Outbound Rule of a machine learning workspace. + /// + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. + /// A new instance for mocking. + public static ServiceTagOutboundRule ServiceTagOutboundRule(OutboundRuleCategory? category = null, IEnumerable parentRuleNames = null, OutboundRuleStatus? status = null, ServiceTagDestination destination = null) + { + parentRuleNames ??= new List(); + + return new ServiceTagOutboundRule( + category, + parentRuleNames?.ToList(), + status, + OutboundRuleType.ServiceTag, + serializedAdditionalRawData: null, + destination); + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + /// A new instance for mocking. + public static SpeechEndpointDeploymentResourceProperties SpeechEndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, EndpointDeploymentModel model = null, string raiPolicyName = null, DeploymentModelVersionUpgradeOption? versionUpgradeOption = null) + { + return new SpeechEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + "Azure.Speech", + serializedAdditionalRawData: null, + model, + raiPolicyName, + versionUpgradeOption); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// A new instance for mocking. + public static SpeechEndpointResourceProperties SpeechEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null) + { + deployments ??= new List(); + + return new SpeechEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.AzureSpeech, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, MachineLearningWorkspaceConnectionUsernamePassword credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new MachineLearningUsernamePasswordAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.UsernamePassword, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.Serialization.cs new file mode 100644 index 0000000000000..ad099275825de --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.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.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class EndpointDeploymentResourcePropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentResourcePropertiesBasicResourceData 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(EndpointDeploymentResourcePropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement, options); + } + + internal static EndpointDeploymentResourcePropertiesBasicResourceData DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointDeploymentResourceProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = EndpointDeploymentResourceProperties.DeserializeEndpointDeploymentResourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointDeploymentResourcePropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.cs new file mode 100644 index 0000000000000..1860ef8e1a60a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the EndpointDeploymentResourcePropertiesBasicResource data model. + public partial class EndpointDeploymentResourcePropertiesBasicResourceData : ResourceData + { + /// + /// 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 . + /// + /// 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 . + /// + /// is null. + public EndpointDeploymentResourcePropertiesBasicResourceData(EndpointDeploymentResourceProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal EndpointDeploymentResourcePropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EndpointDeploymentResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EndpointDeploymentResourcePropertiesBasicResourceData() + { + } + + /// + /// Gets or sets the properties + /// 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 EndpointDeploymentResourceProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.Serialization.cs new file mode 100644 index 0000000000000..5b6d657920015 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class EndpointResourcePropertiesBasicResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EndpointResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EndpointResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.cs new file mode 100644 index 0000000000000..8fb6c0371ce27 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.cs @@ -0,0 +1,623 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing an EndpointResourcePropertiesBasicResource along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetEndpointResourcePropertiesBasicResource method. + /// Otherwise you can get one from its parent resource using the GetEndpointResourcePropertiesBasicResource method. + /// + public partial class EndpointResourcePropertiesBasicResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The endpointName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics; + private readonly EndpointRestOperations _endpointResourcePropertiesBasicResourceEndpointRestClient; + private readonly EndpointResourcePropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/endpoints"; + + /// Initializes a new instance of the class for mocking. + protected EndpointResourcePropertiesBasicResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal EndpointResourcePropertiesBasicResource(ArmClient client, EndpointResourcePropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal EndpointResourcePropertiesBasicResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string endpointResourcePropertiesBasicResourceEndpointApiVersion); + _endpointResourcePropertiesBasicResourceEndpointRestClient = new EndpointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, endpointResourcePropertiesBasicResourceEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual EndpointResourcePropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of WorkspaceEndpointDeploymentResources in the EndpointResourcePropertiesBasicResource. + /// An object representing collection of WorkspaceEndpointDeploymentResources and their operations over a WorkspaceEndpointDeploymentResource. + public virtual WorkspaceEndpointDeploymentCollection GetWorkspaceEndpointDeployments() + { + return GetCachedClient(client => new WorkspaceEndpointDeploymentCollection(client, Id)); + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkspaceEndpointDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) + { + return await GetWorkspaceEndpointDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkspaceEndpointDeployment(string deploymentName, CancellationToken cancellationToken = default) + { + return GetWorkspaceEndpointDeployments().Get(deploymentName, cancellationToken); + } + + /// Gets a collection of WorkspaceEndpointRaiPolicyResources in the EndpointResourcePropertiesBasicResource. + /// An object representing collection of WorkspaceEndpointRaiPolicyResources and their operations over a WorkspaceEndpointRaiPolicyResource. + public virtual WorkspaceEndpointRaiPolicyCollection GetWorkspaceEndpointRaiPolicies() + { + return GetCachedClient(client => new WorkspaceEndpointRaiPolicyCollection(client, Id)); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkspaceEndpointRaiPolicyAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + return await GetWorkspaceEndpointRaiPolicies().GetAsync(raiPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkspaceEndpointRaiPolicy(string raiPolicyName, CancellationToken cancellationToken = default) + { + return GetWorkspaceEndpointRaiPolicies().Get(raiPolicyName, cancellationToken); + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Endpoint resource object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new EndpointResourcePropertiesBasicResourceOperationSource(Client), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Endpoint resource object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new EndpointResourcePropertiesBasicResourceOperationSource(Client), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List keys for the endpoint resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys + /// + /// + /// Operation Id + /// Endpoint_ListKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetKeysAsync(CancellationToken cancellationToken = default) + { + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.GetKeys"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.ListKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List keys for the endpoint resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys + /// + /// + /// Operation Id + /// Endpoint_ListKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetKeys(CancellationToken cancellationToken = default) + { + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.GetKeys"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.ListKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get available models under the endpoint resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models + /// + /// + /// Operation Id + /// Endpoint_GetModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetModelsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateGetModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateGetModelsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, "EndpointResourcePropertiesBasicResource.GetModels", "value", "nextLink", cancellationToken); + } + + /// + /// Get available models under the endpoint resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models + /// + /// + /// Operation Id + /// Endpoint_GetModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetModels(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateGetModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateGetModelsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, "EndpointResourcePropertiesBasicResource.GetModels", "value", "nextLink", cancellationToken); + } + + /// + /// Regenerate account keys + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey + /// + /// + /// Operation Id + /// Endpoint_RegenerateKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> RegenerateKeysAsync(RegenerateServiceAccountKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.RegenerateKeys"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.RegenerateKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Regenerate account keys + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey + /// + /// + /// Operation Id + /// Endpoint_RegenerateKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual Response RegenerateKeys(RegenerateServiceAccountKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.RegenerateKeys"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.RegenerateKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceCollection.cs new file mode 100644 index 0000000000000..246888d98fcad --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceCollection.cs @@ -0,0 +1,502 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetEndpointResourcePropertiesBasicResources method from an instance of . + /// + public partial class EndpointResourcePropertiesBasicResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics; + private readonly EndpointRestOperations _endpointResourcePropertiesBasicResourceEndpointRestClient; + + /// Initializes a new instance of the class for mocking. + protected EndpointResourcePropertiesBasicResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal EndpointResourcePropertiesBasicResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", EndpointResourcePropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EndpointResourcePropertiesBasicResource.ResourceType, out string endpointResourcePropertiesBasicResourceEndpointApiVersion); + _endpointResourcePropertiesBasicResourceEndpointRestClient = new EndpointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, endpointResourcePropertiesBasicResourceEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceResource.ResourceType), nameof(id)); + } + + /// + /// Create or update endpoint resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the endpoint resource. + /// Endpoint resource object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string endpointName, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new EndpointResourcePropertiesBasicResourceOperationSource(Client), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the endpoint resource. + /// Endpoint resource object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string endpointName, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new EndpointResourcePropertiesBasicResourceOperationSource(Client), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List All the endpoints under this workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints + /// + /// + /// Operation Id + /// Endpoint_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, includeInferenceEndpoints, skip, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, includeInferenceEndpoints, skip, expand); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EndpointResourcePropertiesBasicResource(Client, EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(e)), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, "EndpointResourcePropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List All the endpoints under this workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints + /// + /// + /// Operation Id + /// Endpoint_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, includeInferenceEndpoints, skip, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, includeInferenceEndpoints, skip, expand); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EndpointResourcePropertiesBasicResource(Client, EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(e)), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, "EndpointResourcePropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.Serialization.cs new file mode 100644 index 0000000000000..37c675081d5d8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.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.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class EndpointResourcePropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointResourcePropertiesBasicResourceData 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(EndpointResourcePropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement, options); + } + + internal static EndpointResourcePropertiesBasicResourceData DeserializeEndpointResourcePropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointResourceProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = EndpointResourceProperties.DeserializeEndpointResourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointResourcePropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + EndpointResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.cs new file mode 100644 index 0000000000000..1a2f0a42b734f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the EndpointResourcePropertiesBasicResource data model. + public partial class EndpointResourcePropertiesBasicResourceData : ResourceData + { + /// + /// 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 . + /// + /// 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 . + /// + /// is null. + public EndpointResourcePropertiesBasicResourceData(EndpointResourceProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal EndpointResourcePropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EndpointResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EndpointResourcePropertiesBasicResourceData() + { + } + + /// + /// Gets or sets the properties + /// 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 EndpointResourceProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs index d076491ca587d..b3282d0cd39be 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs @@ -356,6 +356,25 @@ public static MachineLearningEnvironmentVersionResource GetMachineLearningEnviro return GetMockableMachineLearningArmClient(client).GetMachineLearningEnvironmentVersionResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MarketplaceSubscriptionResource GetMarketplaceSubscriptionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetMarketplaceSubscriptionResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -603,25 +622,6 @@ public static MachineLearningJobResource GetMachineLearningJobResource(this ArmC return GetMockableMachineLearningArmClient(client).GetMachineLearningJobResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static MachineLearningLabelingJobResource GetMachineLearningLabelingJobResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableMachineLearningArmClient(client).GetMachineLearningLabelingJobResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -679,6 +679,25 @@ public static MachineLearningScheduleResource GetMachineLearningScheduleResource return GetMockableMachineLearningArmClient(client).GetMachineLearningScheduleResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ServerlessEndpointResource GetServerlessEndpointResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetServerlessEndpointResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -736,6 +755,139 @@ public static MachineLearningWorkspaceConnectionResource GetMachineLearningWorks return GetMockableMachineLearningArmClient(client).GetMachineLearningWorkspaceConnectionResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkspaceConnectionDeploymentResource GetWorkspaceConnectionDeploymentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetWorkspaceConnectionDeploymentResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkspaceEndpointDeploymentResource GetWorkspaceEndpointDeploymentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetWorkspaceEndpointDeploymentResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static RaiBlocklistPropertiesBasicResource GetRaiBlocklistPropertiesBasicResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetRaiBlocklistPropertiesBasicResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static RaiBlocklistItemPropertiesBasicResource GetRaiBlocklistItemPropertiesBasicResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetRaiBlocklistItemPropertiesBasicResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkspaceConnectionRaiPolicyResource GetWorkspaceConnectionRaiPolicyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetWorkspaceConnectionRaiPolicyResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkspaceEndpointRaiPolicyResource GetWorkspaceEndpointRaiPolicyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetWorkspaceEndpointRaiPolicyResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static EndpointResourcePropertiesBasicResource GetEndpointResourcePropertiesBasicResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetEndpointResourcePropertiesBasicResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -804,7 +956,7 @@ public static MachineLearningRegistryCollection GetMachineLearningRegistries(thi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -842,7 +994,7 @@ public static async Task> GetMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -897,7 +1049,7 @@ public static MachineLearningWorkspaceCollection GetMachineLearningWorkspaces(th /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -910,7 +1062,7 @@ public static MachineLearningWorkspaceCollection GetMachineLearningWorkspaces(th /// /// /// The instance the method will execute against. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -935,7 +1087,7 @@ public static async Task> GetMachineL /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -948,7 +1100,7 @@ public static async Task> GetMachineL /// /// /// The instance the method will execute against. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -973,7 +1125,7 @@ public static Response GetMachineLearningWorks /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1006,7 +1158,7 @@ public static AsyncPageable GetMachineLearningUsagesAsync( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1039,7 +1191,7 @@ public static Pageable GetMachineLearningUsages(this Subsc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1072,7 +1224,7 @@ public static AsyncPageable GetMachineLearningVmSizesAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1105,7 +1257,7 @@ public static Pageable GetMachineLearningVmSizes(this Sub /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1139,7 +1291,7 @@ public static AsyncPageable UpdateMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1173,7 +1325,7 @@ public static Pageable UpdateMachineLearnin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1206,7 +1358,7 @@ public static AsyncPageable GetMachineLearningQuot /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1239,7 +1391,7 @@ public static Pageable GetMachineLearningQuotas(th /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1275,7 +1427,7 @@ public static AsyncPageable GetMachineLearningR /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1311,7 +1463,7 @@ public static Pageable GetMachineLearningRegist /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1320,20 +1472,21 @@ public static Pageable GetMachineLearningRegist /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// is null. /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetMachineLearningWorkspacesAsync(this SubscriptionResource subscriptionResource, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public static AsyncPageable GetMachineLearningWorkspacesAsync(this SubscriptionResource subscriptionResource, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableMachineLearningSubscriptionResource(subscriptionResource).GetMachineLearningWorkspacesAsync(skip, kind, cancellationToken); + return GetMockableMachineLearningSubscriptionResource(subscriptionResource).GetMachineLearningWorkspacesAsync(kind, skip, aiCapabilities, cancellationToken); } /// @@ -1349,7 +1502,7 @@ public static AsyncPageable GetMachineLearning /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1358,20 +1511,21 @@ public static AsyncPageable GetMachineLearning /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// is null. /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetMachineLearningWorkspaces(this SubscriptionResource subscriptionResource, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public static Pageable GetMachineLearningWorkspaces(this SubscriptionResource subscriptionResource, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableMachineLearningSubscriptionResource(subscriptionResource).GetMachineLearningWorkspaces(skip, kind, cancellationToken); + return GetMockableMachineLearningSubscriptionResource(subscriptionResource).GetMachineLearningWorkspaces(kind, skip, aiCapabilities, cancellationToken); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningArmClient.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningArmClient.cs index 114937ffbe80a..71fe5700b4906 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningArmClient.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningArmClient.cs @@ -238,6 +238,18 @@ public virtual MachineLearningEnvironmentVersionResource GetMachineLearningEnvir return new MachineLearningEnvironmentVersionResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MarketplaceSubscriptionResource GetMarketplaceSubscriptionResource(ResourceIdentifier id) + { + MarketplaceSubscriptionResource.ValidateResourceId(id); + return new MarketplaceSubscriptionResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -394,18 +406,6 @@ public virtual MachineLearningJobResource GetMachineLearningJobResource(Resource return new MachineLearningJobResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual MachineLearningLabelingJobResource GetMachineLearningLabelingJobResource(ResourceIdentifier id) - { - MachineLearningLabelingJobResource.ValidateResourceId(id); - return new MachineLearningLabelingJobResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -442,6 +442,18 @@ public virtual MachineLearningScheduleResource GetMachineLearningScheduleResourc return new MachineLearningScheduleResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ServerlessEndpointResource GetServerlessEndpointResource(ResourceIdentifier id) + { + ServerlessEndpointResource.ValidateResourceId(id); + return new ServerlessEndpointResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -478,6 +490,90 @@ public virtual MachineLearningWorkspaceConnectionResource GetMachineLearningWork return new MachineLearningWorkspaceConnectionResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkspaceConnectionDeploymentResource GetWorkspaceConnectionDeploymentResource(ResourceIdentifier id) + { + WorkspaceConnectionDeploymentResource.ValidateResourceId(id); + return new WorkspaceConnectionDeploymentResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkspaceEndpointDeploymentResource GetWorkspaceEndpointDeploymentResource(ResourceIdentifier id) + { + WorkspaceEndpointDeploymentResource.ValidateResourceId(id); + return new WorkspaceEndpointDeploymentResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual RaiBlocklistPropertiesBasicResource GetRaiBlocklistPropertiesBasicResource(ResourceIdentifier id) + { + RaiBlocklistPropertiesBasicResource.ValidateResourceId(id); + return new RaiBlocklistPropertiesBasicResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual RaiBlocklistItemPropertiesBasicResource GetRaiBlocklistItemPropertiesBasicResource(ResourceIdentifier id) + { + RaiBlocklistItemPropertiesBasicResource.ValidateResourceId(id); + return new RaiBlocklistItemPropertiesBasicResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkspaceConnectionRaiPolicyResource GetWorkspaceConnectionRaiPolicyResource(ResourceIdentifier id) + { + WorkspaceConnectionRaiPolicyResource.ValidateResourceId(id); + return new WorkspaceConnectionRaiPolicyResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkspaceEndpointRaiPolicyResource GetWorkspaceEndpointRaiPolicyResource(ResourceIdentifier id) + { + WorkspaceEndpointRaiPolicyResource.ValidateResourceId(id); + return new WorkspaceEndpointRaiPolicyResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EndpointResourcePropertiesBasicResource GetEndpointResourcePropertiesBasicResource(ResourceIdentifier id) + { + EndpointResourcePropertiesBasicResource.ValidateResourceId(id); + return new EndpointResourcePropertiesBasicResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningResourceGroupResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningResourceGroupResource.cs index a2098b03a7d79..4a363a48d0d67 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningResourceGroupResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual MachineLearningRegistryCollection GetMachineLearningRegistries() /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetMachineL /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -122,7 +122,7 @@ public virtual MachineLearningWorkspaceCollection GetMachineLearningWorkspaces() /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -130,7 +130,7 @@ public virtual MachineLearningWorkspaceCollection GetMachineLearningWorkspaces() /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -153,7 +153,7 @@ public virtual async Task> GetMachine /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -161,7 +161,7 @@ public virtual async Task> GetMachine /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningSubscriptionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningSubscriptionResource.cs index ad959c840d956..99b0ad2b86bab 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningSubscriptionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningSubscriptionResource.cs @@ -70,7 +70,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -97,7 +97,7 @@ public virtual AsyncPageable GetMachineLearningUsagesAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -124,7 +124,7 @@ public virtual Pageable GetMachineLearningUsages(AzureLoca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -150,7 +150,7 @@ public virtual AsyncPageable GetMachineLearningVmSizesAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -176,7 +176,7 @@ public virtual Pageable GetMachineLearningVmSizes(AzureLo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -206,7 +206,7 @@ public virtual AsyncPageable UpdateMachineL /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -236,7 +236,7 @@ public virtual Pageable UpdateMachineLearni ///
/// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -263,7 +263,7 @@ public virtual AsyncPageable GetMachineLearningQuo ///
/// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -290,7 +290,7 @@ public virtual Pageable GetMachineLearningQuotas(A ///
/// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -320,7 +320,7 @@ public virtual AsyncPageable GetMachineLearning /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -350,7 +350,7 @@ public virtual Pageable GetMachineLearningRegis /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -358,14 +358,15 @@ public virtual Pageable GetMachineLearningRegis /// /// /// - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMachineLearningWorkspacesAsync(string skip = null, string kind = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetMachineLearningWorkspacesAsync(string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skip, kind); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skip, kind); + HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, kind, skip, aiCapabilities); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, kind, skip, aiCapabilities); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), MachineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MockableMachineLearningSubscriptionResource.GetMachineLearningWorkspaces", "value", "nextLink", cancellationToken); } @@ -382,7 +383,7 @@ public virtual AsyncPageable GetMachineLearnin ///
/// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -390,14 +391,15 @@ public virtual AsyncPageable GetMachineLearnin /// /// /// - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMachineLearningWorkspaces(string skip = null, string kind = null, CancellationToken cancellationToken = default) + public virtual Pageable GetMachineLearningWorkspaces(string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skip, kind); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skip, kind); + HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, kind, skip, aiCapabilities); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, kind, skip, aiCapabilities); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), MachineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MockableMachineLearningSubscriptionResource.GetMachineLearningWorkspaces", "value", "nextLink", cancellationToken); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/EndpointResourcePropertiesBasicResourceOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/EndpointResourcePropertiesBasicResourceOperationSource.cs new file mode 100644 index 0000000000000..4f554006d1f07 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/EndpointResourcePropertiesBasicResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class EndpointResourcePropertiesBasicResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal EndpointResourcePropertiesBasicResourceOperationSource(ArmClient client) + { + _client = client; + } + + EndpointResourcePropertiesBasicResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement); + return new EndpointResourcePropertiesBasicResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement); + return new EndpointResourcePropertiesBasicResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ExportSummaryOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ExportSummaryOperationSource.cs deleted file mode 100644 index d72f96b8e6b8b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ExportSummaryOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.MachineLearning.Models; - -namespace Azure.ResourceManager.MachineLearning -{ - internal class ExportSummaryOperationSource : IOperationSource - { - ExportSummary IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return ExportSummary.DeserializeExportSummary(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return ExportSummary.DeserializeExportSummary(document.RootElement); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/FeaturesetVersionBackfillResponseOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/FeaturesetVersionBackfillResponseOperationSource.cs new file mode 100644 index 0000000000000..b89089eedcf4c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/FeaturesetVersionBackfillResponseOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class FeaturesetVersionBackfillResponseOperationSource : IOperationSource + { + FeaturesetVersionBackfillResponse IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return FeaturesetVersionBackfillResponse.DeserializeFeaturesetVersionBackfillResponse(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return FeaturesetVersionBackfillResponse.DeserializeFeaturesetVersionBackfillResponse(document.RootElement); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/IListOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/IListOperationSource.cs new file mode 100644 index 0000000000000..431b3ba29f5c1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/IListOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class IListOperationSource : IOperationSource> + { + IList IOperationSource>.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(item)); + } + return array; + } + + async ValueTask> IOperationSource>.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(item)); + } + return array; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningEndpointAuthKeysOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningEndpointAuthKeysOperationSource.cs new file mode 100644 index 0000000000000..bec67d9a74cbc --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningEndpointAuthKeysOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class MachineLearningEndpointAuthKeysOperationSource : IOperationSource + { + MachineLearningEndpointAuthKeys IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return MachineLearningEndpointAuthKeys.DeserializeMachineLearningEndpointAuthKeys(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return MachineLearningEndpointAuthKeys.DeserializeMachineLearningEndpointAuthKeys(document.RootElement); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningFeatureSetJobOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningFeatureSetJobOperationSource.cs deleted file mode 100644 index c5389978789fd..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningFeatureSetJobOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.MachineLearning.Models; - -namespace Azure.ResourceManager.MachineLearning -{ - internal class MachineLearningFeatureSetJobOperationSource : IOperationSource - { - MachineLearningFeatureSetJob IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return MachineLearningFeatureSetJob.DeserializeMachineLearningFeatureSetJob(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return MachineLearningFeatureSetJob.DeserializeMachineLearningFeatureSetJob(document.RootElement); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningLabelingJobOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningLabelingJobOperationSource.cs deleted file mode 100644 index 0892ac9baf40f..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningLabelingJobOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning -{ - internal class MachineLearningLabelingJobOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal MachineLearningLabelingJobOperationSource(ArmClient client) - { - _client = client; - } - - MachineLearningLabelingJobResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(document.RootElement); - return new MachineLearningLabelingJobResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(document.RootElement); - return new MachineLearningLabelingJobResource(_client, data); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MarketplaceSubscriptionOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MarketplaceSubscriptionOperationSource.cs new file mode 100644 index 0000000000000..2d4b53b0ae783 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MarketplaceSubscriptionOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class MarketplaceSubscriptionOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MarketplaceSubscriptionOperationSource(ArmClient client) + { + _client = client; + } + + MarketplaceSubscriptionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(document.RootElement); + return new MarketplaceSubscriptionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(document.RootElement); + return new MarketplaceSubscriptionResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ModelPackageResultOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ModelPackageResultOperationSource.cs deleted file mode 100644 index be8461b45ac6c..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ModelPackageResultOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.MachineLearning.Models; - -namespace Azure.ResourceManager.MachineLearning -{ - internal class ModelPackageResultOperationSource : IOperationSource - { - ModelPackageResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return ModelPackageResult.DeserializeModelPackageResult(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return ModelPackageResult.DeserializeModelPackageResult(document.RootElement); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistItemPropertiesBasicResourceOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistItemPropertiesBasicResourceOperationSource.cs new file mode 100644 index 0000000000000..426c54311b8af --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistItemPropertiesBasicResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class RaiBlocklistItemPropertiesBasicResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal RaiBlocklistItemPropertiesBasicResourceOperationSource(ArmClient client) + { + _client = client; + } + + RaiBlocklistItemPropertiesBasicResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement); + return new RaiBlocklistItemPropertiesBasicResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement); + return new RaiBlocklistItemPropertiesBasicResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistPropertiesBasicResourceOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistPropertiesBasicResourceOperationSource.cs new file mode 100644 index 0000000000000..793b43a3cc613 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistPropertiesBasicResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class RaiBlocklistPropertiesBasicResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal RaiBlocklistPropertiesBasicResourceOperationSource(ArmClient client) + { + _client = client; + } + + RaiBlocklistPropertiesBasicResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement); + return new RaiBlocklistPropertiesBasicResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement); + return new RaiBlocklistPropertiesBasicResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ServerlessEndpointOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ServerlessEndpointOperationSource.cs new file mode 100644 index 0000000000000..d6c4425cdf401 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ServerlessEndpointOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class ServerlessEndpointOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ServerlessEndpointOperationSource(ArmClient client) + { + _client = client; + } + + ServerlessEndpointResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ServerlessEndpointData.DeserializeServerlessEndpointData(document.RootElement); + return new ServerlessEndpointResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ServerlessEndpointData.DeserializeServerlessEndpointData(document.RootElement); + return new ServerlessEndpointResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionDeploymentOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionDeploymentOperationSource.cs new file mode 100644 index 0000000000000..c5b5ab80b58b8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionDeploymentOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class WorkspaceConnectionDeploymentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkspaceConnectionDeploymentOperationSource(ArmClient client) + { + _client = client; + } + + WorkspaceConnectionDeploymentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return new WorkspaceConnectionDeploymentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return new WorkspaceConnectionDeploymentResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionRaiPolicyOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionRaiPolicyOperationSource.cs new file mode 100644 index 0000000000000..73fa1799c27a0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionRaiPolicyOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class WorkspaceConnectionRaiPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkspaceConnectionRaiPolicyOperationSource(ArmClient client) + { + _client = client; + } + + WorkspaceConnectionRaiPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return new WorkspaceConnectionRaiPolicyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return new WorkspaceConnectionRaiPolicyResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointDeploymentOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointDeploymentOperationSource.cs new file mode 100644 index 0000000000000..e6ea7c9ca04c0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointDeploymentOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class WorkspaceEndpointDeploymentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkspaceEndpointDeploymentOperationSource(ArmClient client) + { + _client = client; + } + + WorkspaceEndpointDeploymentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return new WorkspaceEndpointDeploymentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return new WorkspaceEndpointDeploymentResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointRaiPolicyOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointRaiPolicyOperationSource.cs new file mode 100644 index 0000000000000..5a67333ed125c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointRaiPolicyOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class WorkspaceEndpointRaiPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkspaceEndpointRaiPolicyOperationSource(ArmClient client) + { + _client = client; + } + + WorkspaceEndpointRaiPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return new WorkspaceEndpointRaiPolicyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return new WorkspaceEndpointRaiPolicyResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerCollection.cs index 8c90d386bc8e0..6b40365c0ec9c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Cr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(st /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string componentName, Canc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string componentName, CancellationToken can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs index 7e1a17779aa74..f71d80ff38bb6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearninRegistryComponentVersionCollection GetMachineLearni /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionCollection.cs index e4ee308edbc8a..40aa367365569 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Crea /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(stri /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -263,13 +263,12 @@ public virtual Response Get(stri /// Ordering of list. /// Maximum number of records to return. /// Continuation token for pagination. - /// Component stage. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, string stage = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearninRegistryComponentVersionResource(Client, MachineLearningComponentVersionData.DeserializeMachineLearningComponentVersionData(e)), _machineLearninRegistryComponentVersionRegistryComponentVersionsClientDiagnostics, Pipeline, "MachineLearninRegistryComponentVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -286,7 +285,7 @@ public virtual AsyncPageable Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -297,13 +296,12 @@ public virtual AsyncPageable Get /// Ordering of list. /// Maximum number of records to return. /// Continuation token for pagination. - /// Component stage. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, string stage = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearninRegistryComponentVersionResource(Client, MachineLearningComponentVersionData.DeserializeMachineLearningComponentVersionData(e)), _machineLearninRegistryComponentVersionRegistryComponentVersionsClientDiagnostics, Pipeline, "MachineLearninRegistryComponentVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -320,7 +318,7 @@ public virtual Pageable GetAll(s /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -363,7 +361,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -406,7 +404,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -451,7 +449,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionResource.cs index ccc343d5d7124..0e3bda58db399 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Canc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentCollection.cs index 40995fa39d1b1..5de565eef67f1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string deplo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(string or /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string deploymentName, Can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string deploymentName, CancellationToken ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentResource.cs index a94f8aff04d52..2c55ed63da6e4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Update(WaitU /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -422,7 +422,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -484,7 +484,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -541,7 +541,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -598,7 +598,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -658,7 +658,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointCollection.cs index 350ba06f01e1e..e37da0546f354 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string endpoin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAsync(i /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(int? count /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string endpointName, Cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string endpointName, CancellationToken canc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs index ad6d26f61b99f..02f75053591b4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs @@ -110,7 +110,7 @@ public virtual MachineLearningBatchDeploymentCollection GetMachineLearningBatchD /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetM /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -172,7 +172,7 @@ public virtual Response GetMachineLearni /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -336,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -382,7 +382,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -428,7 +428,7 @@ public virtual ArmOperation Update(WaitUnt /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -466,7 +466,7 @@ public virtual async Task> GetKeysAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -504,7 +504,7 @@ public virtual Response GetKeys(CancellationTok /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -566,7 +566,7 @@ public virtual async Task> AddTag /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -628,7 +628,7 @@ public virtual Response AddTag(string key, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -685,7 +685,7 @@ public virtual async Task> SetTag /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -742,7 +742,7 @@ public virtual Response SetTags(IDictionar /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -802,7 +802,7 @@ public virtual async Task> Remove /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerCollection.cs index c8089986cd123..4e782372c840d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string name, C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(s /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(string skip /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs index 4fe2f6cca6cc8..b5b35c7508b37 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningCodeVersionCollection GetMachineLearningCodeVersio /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> GetMachi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLearningCo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -338,7 +338,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionCollection.cs index b20711932e265..4ea9de896e868 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string version, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -291,7 +291,7 @@ public virtual AsyncPageable GetAllAsync(str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -326,7 +326,7 @@ public virtual Pageable GetAll(string orderB /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -369,7 +369,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -412,7 +412,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -457,7 +457,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionResource.cs index b1943562d4b74..c26a3067234c4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -354,6 +354,98 @@ public virtual ArmOperation Update(WaitUntil } } + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// CodeVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual async Task PublishAsync(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningCodeVersionCodeVersionsClientDiagnostics.CreateScope("MachineLearningCodeVersionResource.Publish"); + scope.Start(); + try + { + var response = await _machineLearningCodeVersionCodeVersionsRestClient.PublishAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningCodeVersionCodeVersionsClientDiagnostics, Pipeline, _machineLearningCodeVersionCodeVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// CodeVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Publish(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningCodeVersionCodeVersionsClientDiagnostics.CreateScope("MachineLearningCodeVersionResource.Publish"); + scope.Start(); + try + { + var response = _machineLearningCodeVersionCodeVersionsRestClient.Publish(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningCodeVersionCodeVersionsClientDiagnostics, Pipeline, _machineLearningCodeVersionCodeVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Generate a storage location and credential for the client to upload a code asset to. /// @@ -367,7 +459,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -409,7 +501,7 @@ public virtual async Task> CreateOrGetStartPe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerCollection.cs index 5ff1450f251b9..5db3f9a41f8a5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string na /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -321,7 +321,7 @@ public virtual Pageable GetAll(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -407,7 +407,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -452,7 +452,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs index 2e99ce4265737..e10f2fd500024 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningComponentVersionCollection GetMachineLearningCompo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLearn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -338,7 +338,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionCollection.cs index 717d39ccd3670..41970373e5072 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string vers /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -269,13 +269,12 @@ public virtual Response Get(string vers /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Component stage. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningComponentVersionComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningComponentVersionComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningComponentVersionComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningComponentVersionComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningComponentVersionResource(Client, MachineLearningComponentVersionData.DeserializeMachineLearningComponentVersionData(e)), _machineLearningComponentVersionComponentVersionsClientDiagnostics, Pipeline, "MachineLearningComponentVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -292,7 +291,7 @@ public virtual AsyncPageable GetAllAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -304,13 +303,12 @@ public virtual AsyncPageable GetAllAsyn /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Component stage. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningComponentVersionComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningComponentVersionComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningComponentVersionComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningComponentVersionComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningComponentVersionResource(Client, MachineLearningComponentVersionData.DeserializeMachineLearningComponentVersionData(e)), _machineLearningComponentVersionComponentVersionsClientDiagnostics, Pipeline, "MachineLearningComponentVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -327,7 +325,7 @@ public virtual Pageable GetAll(string o /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -370,7 +368,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -413,7 +411,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -458,7 +456,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionResource.cs index e3d77cb42909c..c8a74caf3fa5e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; namespace Azure.ResourceManager.MachineLearning { @@ -102,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +143,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +183,7 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -270,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +319,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -352,5 +353,97 @@ public virtual ArmOperation Update(Wait throw; } } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// ComponentVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual async Task PublishAsync(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningComponentVersionComponentVersionsClientDiagnostics.CreateScope("MachineLearningComponentVersionResource.Publish"); + scope.Start(); + try + { + var response = await _machineLearningComponentVersionComponentVersionsRestClient.PublishAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningComponentVersionComponentVersionsClientDiagnostics, Pipeline, _machineLearningComponentVersionComponentVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// ComponentVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Publish(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningComponentVersionComponentVersionsClientDiagnostics.CreateScope("MachineLearningComponentVersionResource.Publish"); + scope.Start(); + try + { + var response = _machineLearningComponentVersionComponentVersionsRestClient.Publish(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningComponentVersionComponentVersionsClientDiagnostics, Pipeline, _machineLearningComponentVersionComponentVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeCollection.cs index 6be0a15c0e532..4139dcaf29063 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string computeName, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(string skip = nul /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string computeName, Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string computeName, CancellationToken cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeResource.cs index 30b54713e54b7..6599b766d73c8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToken ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Machine /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, MachineLearningUnderlyin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual ArmOperation Update(WaitUntil wai /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual async Task UpdateCustomServicesAsync(IEnumerable /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -446,7 +446,7 @@ public virtual Response UpdateCustomServices(IEnumerable customSe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -476,7 +476,7 @@ public virtual AsyncPageable GetNodesAsync(Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -506,7 +506,7 @@ public virtual Pageable GetNodes(CancellationToken ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -544,7 +544,7 @@ public virtual async Task> GetKeysAsync( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -569,6 +569,90 @@ public virtual Response GetKeys(CancellationToken } } + /// + /// Update Data Mounts of a Machine Learning compute. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts + /// + /// + /// Operation Id + /// Compute_UpdateDataMounts + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// The cancellation token to use. + /// is null. + public virtual async Task UpdateDataMountsAsync(IEnumerable dataMounts, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(dataMounts, nameof(dataMounts)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.UpdateDataMounts"); + scope.Start(); + try + { + var response = await _machineLearningComputeComputeRestClient.UpdateDataMountsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataMounts, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Data Mounts of a Machine Learning compute. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts + /// + /// + /// Operation Id + /// Compute_UpdateDataMounts + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// The cancellation token to use. + /// is null. + public virtual Response UpdateDataMounts(IEnumerable dataMounts, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(dataMounts, nameof(dataMounts)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.UpdateDataMounts"); + scope.Start(); + try + { + var response = _machineLearningComputeComputeRestClient.UpdateDataMounts(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataMounts, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Posts a start action to a compute instance /// @@ -582,7 +666,7 @@ public virtual Response GetKeys(CancellationToken /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -624,7 +708,7 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -666,7 +750,7 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -708,7 +792,7 @@ public virtual async Task StopAsync(WaitUntil waitUntil, Cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -750,7 +834,7 @@ public virtual ArmOperation Stop(WaitUntil waitUntil, CancellationToken cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -792,7 +876,7 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -834,7 +918,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -876,7 +960,7 @@ public virtual async Task UpdateIdleShutdownSettingAsync(IdleShutdownS /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -904,5 +988,155 @@ public virtual Response UpdateIdleShutdownSetting(IdleShutdownSetting idleShutdo throw; } } + + /// + /// Returns supported virtual machine sizes for resize + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize + /// + /// + /// Operation Id + /// Compute_GetAllowedResizeSizes + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllowedResizeSizesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningComputeComputeRestClient.CreateGetAllowedResizeSizesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => MachineLearningVmSize.DeserializeMachineLearningVmSize(e), _machineLearningComputeComputeClientDiagnostics, Pipeline, "MachineLearningComputeResource.GetAllowedResizeSizes", "value", null, cancellationToken); + } + + /// + /// Returns supported virtual machine sizes for resize + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize + /// + /// + /// Operation Id + /// Compute_GetAllowedResizeSizes + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAllowedResizeSizes(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningComputeComputeRestClient.CreateGetAllowedResizeSizesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => MachineLearningVmSize.DeserializeMachineLearningVmSize(e), _machineLearningComputeComputeClientDiagnostics, Pipeline, "MachineLearningComputeResource.GetAllowedResizeSizes", "value", null, cancellationToken); + } + + /// + /// Updates the size of a Compute Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize + /// + /// + /// Operation Id + /// Compute_Resize + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 object for updating VM size setting of specified Compute Instance. + /// The cancellation token to use. + /// is null. + public virtual async Task ResizeAsync(WaitUntil waitUntil, ResizeSchema resizeSchema, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resizeSchema, nameof(resizeSchema)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.Resize"); + scope.Start(); + try + { + var response = await _machineLearningComputeComputeRestClient.ResizeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, resizeSchema, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningComputeComputeClientDiagnostics, Pipeline, _machineLearningComputeComputeRestClient.CreateResizeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, resizeSchema).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the size of a Compute Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize + /// + /// + /// Operation Id + /// Compute_Resize + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 object for updating VM size setting of specified Compute Instance. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Resize(WaitUntil waitUntil, ResizeSchema resizeSchema, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resizeSchema, nameof(resizeSchema)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.Resize"); + scope.Start(); + try + { + var response = _machineLearningComputeComputeRestClient.Resize(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, resizeSchema, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningComputeComputeClientDiagnostics, Pipeline, _machineLearningComputeComputeRestClient.CreateResizeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, resizeSchema).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerCollection.cs index 16ebb0464898a..63341f92237ee 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string name, C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAsync(s /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -321,7 +321,7 @@ public virtual Pageable GetAll(string skip /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -407,7 +407,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -452,7 +452,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs index be0a588046f64..0e7865f5322b9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningDataVersionCollection GetMachineLearningDataVersio /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> GetMachi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLearningDa /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -338,7 +338,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionCollection.cs index d053c6e05fd07..daa944305d6eb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string version, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -265,15 +265,20 @@ public virtual Response Get(string version, /// /// /// - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// Please choose OrderBy value from ['createdtime', 'modifiedtime']. + /// + /// Top count of results, top count cannot be greater than the page size. + /// If topCount > page size, results with be default page size count will be returned + /// + /// Continuation token for pagination. + /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(MachineLearningDataVersionCollectionGetAllOptions options, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { - options ??= new MachineLearningDataVersionCollectionGetAllOptions(); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningDataVersionDataVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.OrderBy, options.Top, options.Skip, options.Tags, options.ListViewType, options.Stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningDataVersionDataVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.OrderBy, options.Top, options.Skip, options.Tags, options.ListViewType, options.Stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningDataVersionDataVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, tags, listViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningDataVersionDataVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, tags, listViewType); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningDataVersionResource(Client, MachineLearningDataVersionData.DeserializeMachineLearningDataVersionData(e)), _machineLearningDataVersionDataVersionsClientDiagnostics, Pipeline, "MachineLearningDataVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -290,7 +295,7 @@ public virtual AsyncPageable GetAllAsync(Mac /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -298,15 +303,20 @@ public virtual AsyncPageable GetAllAsync(Mac /// /// /// - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// Please choose OrderBy value from ['createdtime', 'modifiedtime']. + /// + /// Top count of results, top count cannot be greater than the page size. + /// If topCount > page size, results with be default page size count will be returned + /// + /// Continuation token for pagination. + /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(MachineLearningDataVersionCollectionGetAllOptions options, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { - options ??= new MachineLearningDataVersionCollectionGetAllOptions(); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningDataVersionDataVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.OrderBy, options.Top, options.Skip, options.Tags, options.ListViewType, options.Stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningDataVersionDataVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.OrderBy, options.Top, options.Skip, options.Tags, options.ListViewType, options.Stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningDataVersionDataVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, tags, listViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningDataVersionDataVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, tags, listViewType); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningDataVersionResource(Client, MachineLearningDataVersionData.DeserializeMachineLearningDataVersionData(e)), _machineLearningDataVersionDataVersionsClientDiagnostics, Pipeline, "MachineLearningDataVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -323,7 +333,7 @@ public virtual Pageable GetAll(MachineLearni /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -366,7 +376,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -409,7 +419,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -454,7 +464,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -488,17 +498,17 @@ public virtual NullableResponse GetIfExists( IEnumerator IEnumerable.GetEnumerator() { - return GetAll(options: null).GetEnumerator(); + return GetAll().GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return GetAll(options: null).GetEnumerator(); + return GetAll().GetEnumerator(); } IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { - return GetAllAsync(options: null, cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionResource.cs index 66a29076b6b44..dcbd193c7e6d4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; namespace Azure.ResourceManager.MachineLearning { @@ -102,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +143,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +183,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -270,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +319,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -352,5 +353,97 @@ public virtual ArmOperation Update(WaitUntil throw; } } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// DataVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual async Task PublishAsync(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningDataVersionDataVersionsClientDiagnostics.CreateScope("MachineLearningDataVersionResource.Publish"); + scope.Start(); + try + { + var response = await _machineLearningDataVersionDataVersionsRestClient.PublishAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningDataVersionDataVersionsClientDiagnostics, Pipeline, _machineLearningDataVersionDataVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// DataVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Publish(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningDataVersionDataVersionsClientDiagnostics.CreateScope("MachineLearningDataVersionResource.Publish"); + scope.Start(); + try + { + var response = _machineLearningDataVersionDataVersionsRestClient.Publish(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningDataVersionDataVersionsClientDiagnostics, Pipeline, _machineLearningDataVersionDataVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreCollection.cs index 9e062753196db..d7101b4dbb5d7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -169,7 +169,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(string name, Cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual AsyncPageable GetAllAsync(Machi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -325,7 +325,7 @@ public virtual Pageable GetAll(MachineLearning /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -368,7 +368,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -411,7 +411,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -456,7 +456,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreData.cs index 07e6fa766f44f..a9fda6a1e3aa3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreData.cs @@ -55,7 +55,7 @@ public partial class MachineLearningDatastoreData : ResourceData /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , and . /// /// is null. public MachineLearningDatastoreData(MachineLearningDatastoreProperties properties) @@ -73,7 +73,7 @@ public MachineLearningDatastoreData(MachineLearningDatastoreProperties propertie /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , and . /// /// Keeps track of any properties unknown to the library. internal MachineLearningDatastoreData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MachineLearningDatastoreProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) @@ -90,7 +90,7 @@ internal MachineLearningDatastoreData() /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , and . /// public MachineLearningDatastoreProperties Properties { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreResource.cs index 816ca2049dcaa..ff9e95fd0a30b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -368,7 +368,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -376,14 +376,15 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// + /// Secret expiry information. /// The cancellation token to use. - public virtual async Task> GetSecretsAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetSecretsAsync(SecretExpiry body = null, CancellationToken cancellationToken = default) { using var scope = _machineLearningDatastoreDatastoresClientDiagnostics.CreateScope("MachineLearningDatastoreResource.GetSecrets"); scope.Start(); try { - var response = await _machineLearningDatastoreDatastoresRestClient.ListSecretsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _machineLearningDatastoreDatastoresRestClient.ListSecretsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -406,7 +407,7 @@ public virtual async Task> GetSecretsA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -414,14 +415,15 @@ public virtual async Task> GetSecretsA /// /// /// + /// Secret expiry information. /// The cancellation token to use. - public virtual Response GetSecrets(CancellationToken cancellationToken = default) + public virtual Response GetSecrets(SecretExpiry body = null, CancellationToken cancellationToken = default) { using var scope = _machineLearningDatastoreDatastoresClientDiagnostics.CreateScope("MachineLearningDatastoreResource.GetSecrets"); scope.Start(); try { - var response = _machineLearningDatastoreDatastoresRestClient.ListSecrets(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _machineLearningDatastoreDatastoresRestClient.ListSecrets(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); return response; } catch (Exception e) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerCollection.cs index 42a7a93e8834c..17e38e1a8b24a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateO /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAll /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -321,7 +321,7 @@ public virtual Pageable GetAll(stri /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -407,7 +407,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -452,7 +452,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs index d7a0b18316740..5fab01f3f34f1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningEnvironmentVersionCollection GetMachineLearningEnv /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLea /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -338,7 +338,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionCollection.cs index b85c7593612e7..041f0e5e29d83 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string ve /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -269,13 +269,12 @@ public virtual Response Get(string ve /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningEnvironmentVersionResource(Client, MachineLearningEnvironmentVersionData.DeserializeMachineLearningEnvironmentVersionData(e)), _machineLearningEnvironmentVersionEnvironmentVersionsClientDiagnostics, Pipeline, "MachineLearningEnvironmentVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -292,7 +291,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -304,13 +303,12 @@ public virtual AsyncPageable GetAllAs /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningEnvironmentVersionResource(Client, MachineLearningEnvironmentVersionData.DeserializeMachineLearningEnvironmentVersionData(e)), _machineLearningEnvironmentVersionEnvironmentVersionsClientDiagnostics, Pipeline, "MachineLearningEnvironmentVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -327,7 +325,7 @@ public virtual Pageable GetAll(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -370,7 +368,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -413,7 +411,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -458,7 +456,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionResource.cs index 8bfd1ceeb9039..9994e06013c95 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; namespace Azure.ResourceManager.MachineLearning { @@ -102,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +143,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +183,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -270,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +319,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -352,5 +353,97 @@ public virtual ArmOperation Update(Wa throw; } } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// EnvironmentVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual async Task PublishAsync(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningEnvironmentVersionEnvironmentVersionsClientDiagnostics.CreateScope("MachineLearningEnvironmentVersionResource.Publish"); + scope.Start(); + try + { + var response = await _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.PublishAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningEnvironmentVersionEnvironmentVersionsClientDiagnostics, Pipeline, _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// EnvironmentVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Publish(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningEnvironmentVersionEnvironmentVersionsClientDiagnostics.CreateScope("MachineLearningEnvironmentVersionResource.Publish"); + scope.Start(); + try + { + var response = _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.Publish(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningEnvironmentVersionEnvironmentVersionsClientDiagnostics, Pipeline, _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureCollection.cs index 221eb1b0304e2..9e8a04b6b5616 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureCollection.cs @@ -14,6 +14,7 @@ using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; namespace Azure.ResourceManager.MachineLearning { @@ -64,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -109,7 +110,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -154,7 +155,7 @@ public virtual Response Get(string featureName, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,16 +163,15 @@ public virtual Response Get(string featureName, /// /// /// - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// feature name. - /// Description of the featureset. + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string skip = null, string tags = null, string featureName = null, string description = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(MachineLearningFeatureCollectionGetAllOptions options, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningFeatureFeaturesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, tags, featureName, description); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningFeatureFeaturesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, tags, featureName, description); + options ??= new MachineLearningFeatureCollectionGetAllOptions(); + + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningFeatureFeaturesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, options.Skip, options.Tags, options.FeatureName, options.Description, options.ListViewType, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningFeatureFeaturesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, options.Skip, options.Tags, options.FeatureName, options.Description, options.ListViewType, pageSizeHint); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningFeatureResource(Client, MachineLearningFeatureData.DeserializeMachineLearningFeatureData(e)), _machineLearningFeatureFeaturesClientDiagnostics, Pipeline, "MachineLearningFeatureCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -188,7 +188,7 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -196,16 +196,15 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// feature name. - /// Description of the featureset. + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string skip = null, string tags = null, string featureName = null, string description = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(MachineLearningFeatureCollectionGetAllOptions options, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningFeatureFeaturesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, tags, featureName, description); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningFeatureFeaturesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, tags, featureName, description); + options ??= new MachineLearningFeatureCollectionGetAllOptions(); + + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningFeatureFeaturesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, options.Skip, options.Tags, options.FeatureName, options.Description, options.ListViewType, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningFeatureFeaturesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, options.Skip, options.Tags, options.FeatureName, options.Description, options.ListViewType, pageSizeHint); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningFeatureResource(Client, MachineLearningFeatureData.DeserializeMachineLearningFeatureData(e)), _machineLearningFeatureFeaturesClientDiagnostics, Pipeline, "MachineLearningFeatureCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -222,7 +221,7 @@ public virtual Pageable GetAll(string skip = nul /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -265,7 +264,7 @@ public virtual async Task> ExistsAsync(string featureName, Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -308,7 +307,7 @@ public virtual Response Exists(string featureName, CancellationToken cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -353,7 +352,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -387,17 +386,17 @@ public virtual NullableResponse GetIfExists(stri IEnumerator IEnumerable.GetEnumerator() { - return GetAll().GetEnumerator(); + return GetAll(options: null).GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return GetAll().GetEnumerator(); + return GetAll(options: null).GetEnumerator(); } IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + return GetAllAsync(options: null, cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureResource.cs index d7a2f78df6520..33211318c5122 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerCollection.cs index bf6de70a563c9..3dab6499bc377 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string n /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(Machi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs index 40c0cd53934d0..bb908f9a86146 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningFeatureSetVersionCollection GetMachineLearningFeat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLear /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionCollection.cs index f7c25953bbdf5..8a5b4b3a3c27d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string ver /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(Machine /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs index c0f9684df3960..0395b50ee21de 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs @@ -9,7 +9,6 @@ using System.Globalization; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.MachineLearning.Models; @@ -111,7 +110,7 @@ public virtual MachineLearningFeatureCollection GetMachineLearningFeatures() /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +141,7 @@ public virtual async Task> GetMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -173,7 +172,7 @@ public virtual Response GetMachineLearningFeatur /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -213,7 +212,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +252,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -295,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -337,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -383,7 +382,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -429,7 +428,7 @@ public virtual ArmOperation Update(Wai /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -441,7 +440,7 @@ public virtual ArmOperation Update(Wai /// Feature set version backfill request entity. /// The cancellation token to use. /// is null. - public virtual async Task> BackfillAsync(WaitUntil waitUntil, FeatureSetVersionBackfillContent content, CancellationToken cancellationToken = default) + public virtual async Task> BackfillAsync(WaitUntil waitUntil, FeatureSetVersionBackfillContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); @@ -450,7 +449,7 @@ public virtual async Task> BackfillAs try { var response = await _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.BackfillAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new MachineLearningFeatureSetJobOperationSource(), _machineLearningFeatureSetVersionFeaturesetVersionsClientDiagnostics, Pipeline, _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateBackfillRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var operation = new MachineLearningArmOperation(new FeaturesetVersionBackfillResponseOperationSource(), _machineLearningFeatureSetVersionFeaturesetVersionsClientDiagnostics, Pipeline, _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateBackfillRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -475,7 +474,7 @@ public virtual async Task> BackfillAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -487,7 +486,7 @@ public virtual async Task> BackfillAs /// Feature set version backfill request entity. /// The cancellation token to use. /// is null. - public virtual ArmOperation Backfill(WaitUntil waitUntil, FeatureSetVersionBackfillContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation Backfill(WaitUntil waitUntil, FeatureSetVersionBackfillContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); @@ -496,7 +495,7 @@ public virtual ArmOperation Backfill(WaitUntil wai try { var response = _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.Backfill(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new MachineLearningArmOperation(new MachineLearningFeatureSetJobOperationSource(), _machineLearningFeatureSetVersionFeaturesetVersionsClientDiagnostics, Pipeline, _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateBackfillRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var operation = new MachineLearningArmOperation(new FeaturesetVersionBackfillResponseOperationSource(), _machineLearningFeatureSetVersionFeaturesetVersionsClientDiagnostics, Pipeline, _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateBackfillRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -507,73 +506,5 @@ public virtual ArmOperation Backfill(WaitUntil wai throw; } } - - /// - /// List materialization Jobs. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs - /// - /// - /// Operation Id - /// FeaturesetVersions_ListMaterializationJobs - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// Start time of the feature window to filter materialization jobs. - /// End time of the feature window to filter materialization jobs. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMaterializationJobsAsync(string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateListMaterializationJobsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, filters, featureWindowStart, featureWindowEnd); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateListMaterializationJobsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, filters, featureWindowStart, featureWindowEnd); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => MachineLearningFeatureSetJob.DeserializeMachineLearningFeatureSetJob(e), _machineLearningFeatureSetVersionFeaturesetVersionsClientDiagnostics, Pipeline, "MachineLearningFeatureSetVersionResource.GetMaterializationJobs", "value", "nextLink", cancellationToken); - } - - /// - /// List materialization Jobs. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs - /// - /// - /// Operation Id - /// FeaturesetVersions_ListMaterializationJobs - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// Start time of the feature window to filter materialization jobs. - /// End time of the feature window to filter materialization jobs. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMaterializationJobs(string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateListMaterializationJobsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, filters, featureWindowStart, featureWindowEnd); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateListMaterializationJobsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, filters, featureWindowStart, featureWindowEnd); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => MachineLearningFeatureSetJob.DeserializeMachineLearningFeatureSetJob(e), _machineLearningFeatureSetVersionFeaturesetVersionsClientDiagnostics, Pipeline, "MachineLearningFeatureSetVersionResource.GetMaterializationJobs", "value", "nextLink", cancellationToken); - } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerCollection.cs index 181271cd1a030..990f987da7cfc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs index 3a8fba4f69406..db0f598463d86 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningFeaturestoreEntityVersionCollection GetMachineLear /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMac /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionCollection.cs index a88cb49ae24a2..c51e94fbb1ab4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation Cr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(st /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionResource.cs index b83bd7471276e..528eb1462229e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobCollection.cs index ab7df039fde28..6048e04e6ce19 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobCollection.cs @@ -54,6 +54,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// Creates and executes a Job. + /// For update case, the Tags in the definition passed in will replace Tags in the existing job. /// /// /// Request Path @@ -65,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -105,6 +106,7 @@ public virtual async Task> CreateOrUpda /// /// Creates and executes a Job. + /// For update case, the Tags in the definition passed in will replace Tags in the existing job. /// /// /// Request Path @@ -116,7 +118,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +169,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +214,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +259,7 @@ public virtual Response Get(string id, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -265,15 +267,17 @@ public virtual Response Get(string id, CancellationT /// /// /// - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// Continuation token for pagination. + /// Type of job to be returned. + /// Jobs returned will have this tag key. + /// View type for including/excluding (for example) archived entities. + /// Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(MachineLearningJobCollectionGetAllOptions options, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string properties = null, CancellationToken cancellationToken = default) { - options ??= new MachineLearningJobCollectionGetAllOptions(); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningJobJobsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options.Skip, options.JobType, options.Tag, options.ListViewType, options.AssetName, options.Scheduled, options.ScheduleId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningJobJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options.Skip, options.JobType, options.Tag, options.ListViewType, options.AssetName, options.Scheduled, options.ScheduleId); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningJobJobsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, jobType, tag, listViewType, properties); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningJobJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, jobType, tag, listViewType, properties); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningJobResource(Client, MachineLearningJobData.DeserializeMachineLearningJobData(e)), _machineLearningJobJobsClientDiagnostics, Pipeline, "MachineLearningJobCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -290,7 +294,7 @@ public virtual AsyncPageable GetAllAsync(MachineLear /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -298,15 +302,17 @@ public virtual AsyncPageable GetAllAsync(MachineLear /// /// /// - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// Continuation token for pagination. + /// Type of job to be returned. + /// Jobs returned will have this tag key. + /// View type for including/excluding (for example) archived entities. + /// Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(MachineLearningJobCollectionGetAllOptions options, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string properties = null, CancellationToken cancellationToken = default) { - options ??= new MachineLearningJobCollectionGetAllOptions(); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningJobJobsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options.Skip, options.JobType, options.Tag, options.ListViewType, options.AssetName, options.Scheduled, options.ScheduleId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningJobJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options.Skip, options.JobType, options.Tag, options.ListViewType, options.AssetName, options.Scheduled, options.ScheduleId); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningJobJobsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, jobType, tag, listViewType, properties); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningJobJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, jobType, tag, listViewType, properties); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningJobResource(Client, MachineLearningJobData.DeserializeMachineLearningJobData(e)), _machineLearningJobJobsClientDiagnostics, Pipeline, "MachineLearningJobCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -323,7 +329,7 @@ public virtual Pageable GetAll(MachineLearningJobCol /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -366,7 +372,7 @@ public virtual async Task> ExistsAsync(string id, CancellationTok /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -409,7 +415,7 @@ public virtual Response Exists(string id, CancellationToken cancellationTo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -454,7 +460,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -488,17 +494,17 @@ public virtual NullableResponse GetIfExists(string i IEnumerator IEnumerable.GetEnumerator() { - return GetAll(options: null).GetEnumerator(); + return GetAll().GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return GetAll(options: null).GetEnumerator(); + return GetAll().GetEnumerator(); } IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { - return GetAllAsync(options: null, cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobData.cs index e8901332f1c84..e8c603ed97dc6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobData.cs @@ -55,7 +55,7 @@ public partial class MachineLearningJobData : ResourceData /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// /// is null. public MachineLearningJobData(MachineLearningJobProperties properties) @@ -73,7 +73,7 @@ public MachineLearningJobData(MachineLearningJobProperties properties) /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// /// Keeps track of any properties unknown to the library. internal MachineLearningJobData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MachineLearningJobProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) @@ -90,7 +90,7 @@ internal MachineLearningJobData() /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// public MachineLearningJobProperties Properties { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobResource.cs index 7d4e1786983ed..156c6d736d825 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobResource.cs @@ -11,7 +11,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.MachineLearning.Models; namespace Azure.ResourceManager.MachineLearning { @@ -102,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +141,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +181,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -224,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,90 +252,6 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } } - /// - /// Updates a Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id} - /// - /// - /// Operation Id - /// Jobs_Update - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Job definition to apply during the operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(MachineLearningJobPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _machineLearningJobJobsClientDiagnostics.CreateScope("MachineLearningJobResource.Update"); - scope.Start(); - try - { - var response = await _machineLearningJobJobsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new MachineLearningJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates a Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id} - /// - /// - /// Operation Id - /// Jobs_Update - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Job definition to apply during the operation. - /// The cancellation token to use. - /// is null. - public virtual Response Update(MachineLearningJobPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _machineLearningJobJobsClientDiagnostics.CreateScope("MachineLearningJobResource.Update"); - scope.Start(); - try - { - var response = _machineLearningJobJobsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - return Response.FromValue(new MachineLearningJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Cancels a Job (asynchronous). /// @@ -350,7 +265,7 @@ public virtual Response Update(MachineLearningJobPat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -392,7 +307,7 @@ public virtual async Task CancelAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobCollection.cs deleted file mode 100644 index ca6fde6957d72..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobCollection.cs +++ /dev/null @@ -1,509 +0,0 @@ -// 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.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.MachineLearning -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetMachineLearningLabelingJobs method from an instance of . - /// - public partial class MachineLearningLabelingJobCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _machineLearningLabelingJobLabelingJobsClientDiagnostics; - private readonly LabelingJobsRestOperations _machineLearningLabelingJobLabelingJobsRestClient; - - /// Initializes a new instance of the class for mocking. - protected MachineLearningLabelingJobCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal MachineLearningLabelingJobCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _machineLearningLabelingJobLabelingJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", MachineLearningLabelingJobResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(MachineLearningLabelingJobResource.ResourceType, out string machineLearningLabelingJobLabelingJobsApiVersion); - _machineLearningLabelingJobLabelingJobsRestClient = new LabelingJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineLearningLabelingJobLabelingJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != MachineLearningWorkspaceResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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 name and identifier for the LabelingJob. - /// LabelingJob definition object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string id, MachineLearningLabelingJobData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, data, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new MachineLearningLabelingJobOperationSource(Client), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, data).Request, response, OperationFinalStateVia.OriginalUri); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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 name and identifier for the LabelingJob. - /// LabelingJob definition object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string id, MachineLearningLabelingJobData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, data, cancellationToken); - var operation = new MachineLearningArmOperation(new MachineLearningLabelingJobOperationSource(Client), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, data).Request, response, OperationFinalStateVia.OriginalUri); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a labeling job by name/id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.Get"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, includeJobInstructions, includeLabelCategories, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineLearningLabelingJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a labeling job by name/id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.Get"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, includeJobInstructions, includeLabelCategories, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineLearningLabelingJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists labeling jobs in the workspace. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs - /// - /// - /// Operation Id - /// LabelingJobs_List - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Continuation token for pagination. - /// Number of labeling jobs to return. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string skip = null, int? top = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningLabelingJobLabelingJobsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningLabelingJobLabelingJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningLabelingJobResource(Client, MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(e)), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, "MachineLearningLabelingJobCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Lists labeling jobs in the workspace. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs - /// - /// - /// Operation Id - /// LabelingJobs_List - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Continuation token for pagination. - /// Number of labeling jobs to return. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string skip = null, int? top = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningLabelingJobLabelingJobsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningLabelingJobLabelingJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningLabelingJobResource(Client, MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(e)), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, "MachineLearningLabelingJobCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.Exists"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, includeJobInstructions, includeLabelCategories, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.Exists"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, includeJobInstructions, includeLabelCategories, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, includeJobInstructions, includeLabelCategories, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MachineLearningLabelingJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.GetIfExists"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, includeJobInstructions, includeLabelCategories, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MachineLearningLabelingJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.Serialization.cs deleted file mode 100644 index a340fed61c4d3..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.MachineLearning -{ - public partial class MachineLearningLabelingJobResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - MachineLearningLabelingJobData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - MachineLearningLabelingJobData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.cs deleted file mode 100644 index 40bd84343ee2d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.cs +++ /dev/null @@ -1,608 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.MachineLearning.Models; - -namespace Azure.ResourceManager.MachineLearning -{ - /// - /// A Class representing a MachineLearningLabelingJob along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetMachineLearningLabelingJobResource method. - /// Otherwise you can get one from its parent resource using the GetMachineLearningLabelingJob method. - /// - public partial class MachineLearningLabelingJobResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The workspaceName. - /// The id. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string id) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _machineLearningLabelingJobLabelingJobsClientDiagnostics; - private readonly LabelingJobsRestOperations _machineLearningLabelingJobLabelingJobsRestClient; - private readonly MachineLearningLabelingJobData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/labelingJobs"; - - /// Initializes a new instance of the class for mocking. - protected MachineLearningLabelingJobResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal MachineLearningLabelingJobResource(ArmClient client, MachineLearningLabelingJobData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal MachineLearningLabelingJobResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _machineLearningLabelingJobLabelingJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string machineLearningLabelingJobLabelingJobsApiVersion); - _machineLearningLabelingJobLabelingJobsRestClient = new LabelingJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineLearningLabelingJobLabelingJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual MachineLearningLabelingJobData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets a labeling job by name/id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - public virtual async Task> GetAsync(bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Get"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, includeJobInstructions, includeLabelCategories, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineLearningLabelingJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a labeling job by name/id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - public virtual Response Get(bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Get"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, includeJobInstructions, includeLabelCategories, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineLearningLabelingJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a labeling job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Delete - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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 cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Delete"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _machineLearningLabelingJobLabelingJobsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new MachineLearningArmOperation(response, rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a labeling job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Delete - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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 cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Delete"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var uri = _machineLearningLabelingJobLabelingJobsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new MachineLearningArmOperation(response, rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// LabelingJob definition object. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, MachineLearningLabelingJobData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Update"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new MachineLearningLabelingJobOperationSource(Client), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// LabelingJob definition object. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, MachineLearningLabelingJobData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Update"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new MachineLearningArmOperation(new MachineLearningLabelingJobOperationSource(Client), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Export labels from a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels - /// - /// - /// Operation Id - /// LabelingJobs_ExportLabels - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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 export summary. - /// The cancellation token to use. - /// is null. - public virtual async Task> ExportLabelsAsync(WaitUntil waitUntil, ExportSummary body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.ExportLabels"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.ExportLabelsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new ExportSummaryOperationSource(), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateExportLabelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Export labels from a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels - /// - /// - /// Operation Id - /// LabelingJobs_ExportLabels - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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 export summary. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation ExportLabels(WaitUntil waitUntil, ExportSummary body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.ExportLabels"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.ExportLabels(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); - var operation = new MachineLearningArmOperation(new ExportSummaryOperationSource(), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateExportLabelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Pause a labeling job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause - /// - /// - /// Operation Id - /// LabelingJobs_Pause - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task PauseAsync(CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Pause"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.PauseAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Pause a labeling job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause - /// - /// - /// Operation Id - /// LabelingJobs_Pause - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Pause(CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Pause"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Pause(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Resume a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume - /// - /// - /// Operation Id - /// LabelingJobs_Resume - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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 cancellation token to use. - public virtual async Task ResumeAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Resume"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.ResumeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(_machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateResumeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Resume a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume - /// - /// - /// Operation Id - /// LabelingJobs_Resume - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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 cancellation token to use. - public virtual ArmOperation Resume(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Resume"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Resume(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new MachineLearningArmOperation(_machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateResumeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerCollection.cs index f8fd2b457c6fa..bb2a8d182a79d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string name, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -323,7 +323,7 @@ public virtual Pageable GetAll(string ski /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -366,7 +366,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -409,7 +409,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs index 785cc4c4992a6..b00e62c329083 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningModelVersionCollection GetMachineLearningModelVers /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> GetMach /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLearningM /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -338,7 +338,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task> U /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionCollection.cs index c66981ce9e9d5..e8b2d0979f398 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> Cre /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string version, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -272,8 +272,8 @@ public virtual AsyncPageable GetAllAsync(Ma { options ??= new MachineLearningModelVersionCollectionGetAllOptions(); - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningModelVersionModelVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType, options.Stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningModelVersionModelVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType, options.Stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningModelVersionModelVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningModelVersionModelVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningModelVersionResource(Client, MachineLearningModelVersionData.DeserializeMachineLearningModelVersionData(e)), _machineLearningModelVersionModelVersionsClientDiagnostics, Pipeline, "MachineLearningModelVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync(Ma /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -305,8 +305,8 @@ public virtual Pageable GetAll(MachineLearn { options ??= new MachineLearningModelVersionCollectionGetAllOptions(); - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningModelVersionModelVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType, options.Stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningModelVersionModelVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType, options.Stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningModelVersionModelVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningModelVersionModelVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningModelVersionResource(Client, MachineLearningModelVersionData.DeserializeMachineLearningModelVersionData(e)), _machineLearningModelVersionModelVersionsClientDiagnostics, Pipeline, "MachineLearningModelVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -323,7 +323,7 @@ public virtual Pageable GetAll(MachineLearn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -366,7 +366,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -409,7 +409,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionResource.cs index e7934f1f69a50..5c9265e0d00de 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTok /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual async Task> Upd /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -355,19 +355,19 @@ public virtual ArmOperation Update(WaitUnti } /// - /// Model Version Package operation. + /// Publish version asset into registry. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish /// /// /// Operation Id - /// ModelVersions_Package + /// ModelVersions_Publish /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -376,21 +376,21 @@ public virtual ArmOperation Update(WaitUnti /// /// /// 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. - /// Package operation request body. + /// Destination registry info. /// The cancellation token to use. - /// is null. - public virtual async Task> PackageAsync(WaitUntil waitUntil, ModelPackageContent content, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task PublishAsync(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var scope = _machineLearningModelVersionModelVersionsClientDiagnostics.CreateScope("MachineLearningModelVersionResource.Package"); + using var scope = _machineLearningModelVersionModelVersionsClientDiagnostics.CreateScope("MachineLearningModelVersionResource.Publish"); scope.Start(); try { - var response = await _machineLearningModelVersionModelVersionsRestClient.PackageAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new ModelPackageResultOperationSource(), _machineLearningModelVersionModelVersionsClientDiagnostics, Pipeline, _machineLearningModelVersionModelVersionsRestClient.CreatePackageRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _machineLearningModelVersionModelVersionsRestClient.PublishAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningModelVersionModelVersionsClientDiagnostics, Pipeline, _machineLearningModelVersionModelVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; } catch (Exception e) @@ -401,19 +401,19 @@ public virtual async Task> PackageAsync(WaitUnt } /// - /// Model Version Package operation. + /// Publish version asset into registry. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish /// /// /// Operation Id - /// ModelVersions_Package + /// ModelVersions_Publish /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -422,21 +422,21 @@ public virtual async Task> PackageAsync(WaitUnt /// /// /// 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. - /// Package operation request body. + /// Destination registry info. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Package(WaitUntil waitUntil, ModelPackageContent content, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation Publish(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var scope = _machineLearningModelVersionModelVersionsClientDiagnostics.CreateScope("MachineLearningModelVersionResource.Package"); + using var scope = _machineLearningModelVersionModelVersionsClientDiagnostics.CreateScope("MachineLearningModelVersionResource.Publish"); scope.Start(); try { - var response = _machineLearningModelVersionModelVersionsRestClient.Package(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new MachineLearningArmOperation(new ModelPackageResultOperationSource(), _machineLearningModelVersionModelVersionsClientDiagnostics, Pipeline, _machineLearningModelVersionModelVersionsRestClient.CreatePackageRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _machineLearningModelVersionModelVersionsRestClient.Publish(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningModelVersionModelVersionsClientDiagnostics, Pipeline, _machineLearningModelVersionModelVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); + operation.WaitForCompletionResponse(cancellationToken); return operation; } catch (Exception e) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentCollection.cs index 4128a4d9cc932..acf141d84cf41 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string depl /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(string o /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string deploymentName, Can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string deploymentName, CancellationToken ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentResource.cs index 4153515729794..b3fb27cea2c4d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(Wait /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual async Task> GetLogsAsync( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual Response GetLogs(MachineLearningDe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -477,7 +477,7 @@ public virtual AsyncPageable GetSkusAsync(int? count = /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -509,7 +509,7 @@ public virtual Pageable GetSkus(int? count = null, str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -571,7 +571,7 @@ public virtual async Task> Add /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -633,7 +633,7 @@ public virtual Response AddTag(string k /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -690,7 +690,7 @@ public virtual async Task> Set /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -747,7 +747,7 @@ public virtual Response SetTags(IDictio /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -807,7 +807,7 @@ public virtual async Task> Rem /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointCollection.cs index aaaa5bc97ad18..ffae53b3715df 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string endpoi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(MachineLea /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string endpointName, Cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string endpointName, CancellationToken canc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs index 12d82c4951590..4acf9f2cc6121 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs @@ -110,7 +110,7 @@ public virtual MachineLearningOnlineDeploymentCollection GetMachineLearningOnlin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -172,7 +172,7 @@ public virtual Response GetMachineLearn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -336,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -382,7 +382,7 @@ public virtual async Task> U /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -428,7 +428,7 @@ public virtual ArmOperation Update(WaitUn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -466,7 +466,7 @@ public virtual async Task> GetKeysAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -504,7 +504,7 @@ public virtual Response GetKeys(CancellationTok /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -550,7 +550,7 @@ public virtual async Task RegenerateKeysAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -596,7 +596,7 @@ public virtual ArmOperation RegenerateKeys(WaitUntil waitUntil, MachineLearningE /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -634,7 +634,7 @@ public virtual async Task> GetTokenAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -672,7 +672,7 @@ public virtual Response GetToken(CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -734,7 +734,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -796,7 +796,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -853,7 +853,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -910,7 +910,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -970,7 +970,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicCollection.cs index c16080455b007..939d358774003 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string rul /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string ruleName, Cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string ruleName, CancellationToken cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicData.cs index 54fd952bf6b24..6a9059c92decf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicData.cs @@ -13,10 +13,7 @@ namespace Azure.ResourceManager.MachineLearning { - /// - /// A class representing the MachineLearningOutboundRuleBasic data model. - /// Outbound Rule Basic Resource for the managed network of a machine learning workspace. - /// + /// A class representing the MachineLearningOutboundRuleBasic data model. public partial class MachineLearningOutboundRuleBasicData : ResourceData { /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicResource.cs index 0d961463788d4..e43b83bca4bdb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionCollection.cs index 08b5c0382805e..a0238bcf7f216 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation Cr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -258,7 +258,7 @@ public virtual Response Get(st /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.Serialization.cs index ab906be394382..ef912fe2cd0f7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.Serialization.cs @@ -84,7 +84,7 @@ void IJsonModel.Write(Utf8JsonWrit writer.WritePropertyName("privateLinkServiceConnectionState"u8); writer.WriteObjectValue(ConnectionState, options); } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + if (Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.cs index 77eb1fe9e08eb..c822c370756b4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.cs @@ -94,6 +94,6 @@ internal MachineLearningPrivateEndpointConnectionData() /// The connection state. public MachineLearningPrivateLinkServiceConnectionState ConnectionState { get; set; } /// The current provisioning state. - public MachineLearningPrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + public MachineLearningPrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionResource.cs index 3684076c93721..2cd39cb1e131a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -320,7 +320,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -368,7 +368,7 @@ public virtual ArmOperation Up /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -425,7 +425,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -482,7 +482,7 @@ public virtual Response AddTag /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -538,7 +538,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -594,7 +594,7 @@ public virtual Response SetTag /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -649,7 +649,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerCollection.cs index 9a1adda7ef548..c01722e8cd9f8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Create /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAl /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string codeName, Cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string codeName, CancellationToken cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs index 0050a4589bb2e..5eb50d213c7dd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningRegistryCodeVersionCollection GetMachineLearningRe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionCollection.cs index 5c2a5860602f0..cbd6538e876a7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string v /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(strin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionResource.cs index 623e90614ee60..e8199e5890f49 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(W /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task> CreateOrGetStartPe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCollection.cs index dd68d226f5dc4..69fab7b7df67c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateO /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string registryName /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToke /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string registryName, Cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string registryName, CancellationToken canc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.Serialization.cs index 4a2528523b34e..f583515e0ebfa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.Serialization.cs @@ -115,6 +115,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteNull("managedResourceGroup"); } } + if (Optional.IsDefined(ManagedResourceGroupSettings)) + { + if (ManagedResourceGroupSettings != null) + { + writer.WritePropertyName("managedResourceGroupSettings"u8); + writer.WriteObjectValue(ManagedResourceGroupSettings, options); + } + else + { + writer.WriteNull("managedResourceGroupSettings"); + } + } if (Optional.IsDefined(MlFlowRegistryUri)) { if (MlFlowRegistryUri != null) @@ -127,13 +139,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteNull("mlFlowRegistryUri"); } } - if (Optional.IsCollectionDefined(PrivateEndpointConnections)) + if (Optional.IsCollectionDefined(RegistryPrivateEndpointConnections)) { - if (PrivateEndpointConnections != null) + if (RegistryPrivateEndpointConnections != null) { - writer.WritePropertyName("privateEndpointConnections"u8); + writer.WritePropertyName("registryPrivateEndpointConnections"u8); writer.WriteStartArray(); - foreach (var item in PrivateEndpointConnections) + foreach (var item in RegistryPrivateEndpointConnections) { writer.WriteObjectValue(item, options); } @@ -141,7 +153,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR } else { - writer.WriteNull("privateEndpointConnections"); + writer.WriteNull("registryPrivateEndpointConnections"); } } if (Optional.IsDefined(PublicNetworkAccess)) @@ -224,8 +236,9 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa Uri discoveryUrl = default; string intellectualPropertyPublisher = default; ArmResourceId managedResourceGroup = default; + ManagedResourceGroupSettings managedResourceGroupSettings = default; Uri mlFlowRegistryUri = default; - IList privateEndpointConnections = default; + IList registryPrivateEndpointConnections = default; string publicNetworkAccess = default; IList regionDetails = default; IDictionary serializedAdditionalRawData = default; @@ -338,6 +351,16 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa managedResourceGroup = ArmResourceId.DeserializeArmResourceId(property0.Value, options); continue; } + if (property0.NameEquals("managedResourceGroupSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + managedResourceGroupSettings = null; + continue; + } + managedResourceGroupSettings = ManagedResourceGroupSettings.DeserializeManagedResourceGroupSettings(property0.Value, options); + continue; + } if (property0.NameEquals("mlFlowRegistryUri"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -348,11 +371,11 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa mlFlowRegistryUri = new Uri(property0.Value.GetString()); continue; } - if (property0.NameEquals("privateEndpointConnections"u8)) + if (property0.NameEquals("registryPrivateEndpointConnections"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { - privateEndpointConnections = null; + registryPrivateEndpointConnections = null; continue; } List array = new List(); @@ -360,7 +383,7 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa { array.Add(RegistryPrivateEndpointConnection.DeserializeRegistryPrivateEndpointConnection(item, options)); } - privateEndpointConnections = array; + registryPrivateEndpointConnections = array; continue; } if (property0.NameEquals("publicNetworkAccess"u8)) @@ -410,8 +433,9 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa discoveryUrl, intellectualPropertyPublisher, managedResourceGroup, + managedResourceGroupSettings, mlFlowRegistryUri, - privateEndpointConnections ?? new ChangeTrackingList(), + registryPrivateEndpointConnections ?? new ChangeTrackingList(), publicNetworkAccess, regionDetails ?? new ChangeTrackingList(), serializedAdditionalRawData); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.cs index c75a6e947b928..b58c8118ed34b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.cs @@ -52,7 +52,7 @@ public partial class MachineLearningRegistryData : TrackedResourceData /// The location. public MachineLearningRegistryData(AzureLocation location) : base(location) { - PrivateEndpointConnections = new ChangeTrackingList(); + RegistryPrivateEndpointConnections = new ChangeTrackingList(); RegionDetails = new ChangeTrackingList(); } @@ -69,15 +69,16 @@ public MachineLearningRegistryData(AzureLocation location) : base(location) /// Discovery URL for the Registry. /// IntellectualPropertyPublisher for the registry. /// ResourceId of the managed RG if the registry has system created resources. + /// Managed resource group specific settings. /// MLFlow Registry URI for the Registry. - /// Private endpoint connections info used for pending connections in private link portal. + /// Private endpoint connections info used for pending connections in private link portal. /// /// Is the Registry accessible from the internet? /// Possible values: "Enabled" or "Disabled" /// /// Details of each region the registry is in. /// Keeps track of any properties unknown to the library. - internal MachineLearningRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, MachineLearningSku sku, Uri discoveryUri, string intellectualPropertyPublisher, ArmResourceId managedResourceGroup, Uri mlFlowRegistryUri, IList privateEndpointConnections, string publicNetworkAccess, IList regionDetails, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MachineLearningRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, MachineLearningSku sku, Uri discoveryUri, string intellectualPropertyPublisher, ArmResourceId managedResourceGroup, ManagedResourceGroupSettings managedResourceGroupSettings, Uri mlFlowRegistryUri, IList registryPrivateEndpointConnections, string publicNetworkAccess, IList regionDetails, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Identity = identity; Kind = kind; @@ -85,8 +86,9 @@ internal MachineLearningRegistryData(ResourceIdentifier id, string name, Resourc DiscoveryUri = discoveryUri; IntellectualPropertyPublisher = intellectualPropertyPublisher; ManagedResourceGroup = managedResourceGroup; + ManagedResourceGroupSettings = managedResourceGroupSettings; MlFlowRegistryUri = mlFlowRegistryUri; - PrivateEndpointConnections = privateEndpointConnections; + RegistryPrivateEndpointConnections = registryPrivateEndpointConnections; PublicNetworkAccess = publicNetworkAccess; RegionDetails = regionDetails; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -124,10 +126,24 @@ public ResourceIdentifier ManagedResourceId } } + /// Managed resource group specific settings. + internal ManagedResourceGroupSettings ManagedResourceGroupSettings { get; set; } + /// List of assigned identities for the managed resource group. + public IList ManagedResourceGroupAssignedIdentities + { + get => ManagedResourceGroupSettings is null ? default : ManagedResourceGroupSettings.AssignedIdentities; + set + { + if (ManagedResourceGroupSettings is null) + ManagedResourceGroupSettings = new ManagedResourceGroupSettings(); + ManagedResourceGroupSettings.AssignedIdentities = value; + } + } + /// MLFlow Registry URI for the Registry. public Uri MlFlowRegistryUri { get; set; } /// Private endpoint connections info used for pending connections in private link portal. - public IList PrivateEndpointConnections { get; set; } + public IList RegistryPrivateEndpointConnections { get; set; } /// /// Is the Registry accessible from the internet? /// Possible values: "Enabled" or "Disabled" diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerCollection.cs index dd58d7f1fe37f..20c400a6e01b6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation Create /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAl /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs index 88944d90eac99..f78de12c9c041 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningRegistryDataVersionCollection GetMachineLearningRe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionCollection.cs index a2632bf12181d..df93944ab685c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string v /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -291,7 +291,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -329,7 +329,7 @@ public virtual Pageable GetAll(strin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -372,7 +372,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -415,7 +415,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -460,7 +460,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionResource.cs index cf71022d53c89..fa4d25a7ff42b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(W /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task> CreateOrGetStartPe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerCollection.cs index 3e410cd346658..469b794f1519d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string environmentName, Ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string environmentName, CancellationToken c /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs index 959f528e5b3d7..b812f2ad22732 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningRegistryEnvironmentVersionCollection GetMachineLea /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMa /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionCollection.cs index cbc685e295d5d..00fc87675a378 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(s /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -265,13 +265,12 @@ public virtual Response Get(s /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningRegistryEnvironmentVersionResource(Client, MachineLearningEnvironmentVersionData.DeserializeMachineLearningEnvironmentVersionData(e)), _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsClientDiagnostics, Pipeline, "MachineLearningRegistryEnvironmentVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -288,7 +287,7 @@ public virtual AsyncPageable /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -300,13 +299,12 @@ public virtual AsyncPageable /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningRegistryEnvironmentVersionResource(Client, MachineLearningEnvironmentVersionData.DeserializeMachineLearningEnvironmentVersionData(e)), _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsClientDiagnostics, Pipeline, "MachineLearningRegistryEnvironmentVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -323,7 +321,7 @@ public virtual Pageable GetAl /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -366,7 +364,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -409,7 +407,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -454,7 +452,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionResource.cs index c56b6b80ab461..781cf6fd96177 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerCollection.cs index 89556f401a556..5faf54f4eba8b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation Creat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(st /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string modelName, Cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string modelName, CancellationToken cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs index c7a069dc82c3f..f82fbb9a18ce2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningRegistryModelVersionCollection GetMachineLearningR /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineL /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionCollection.cs index 2acfc862ee741..588cf26bbead7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateO /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAll /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(Mach /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionResource.cs index fe99bdc237e0f..b3cc69fa826cd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -346,98 +346,6 @@ public virtual ArmOperation Update( } } - /// - /// Model Version Package operation. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package - /// - /// - /// Operation Id - /// RegistryModelVersions_Package - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// Package operation request body. - /// The cancellation token to use. - /// is null. - public virtual async Task> PackageAsync(WaitUntil waitUntil, ModelPackageContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _machineLearningRegistryModelVersionRegistryModelVersionsClientDiagnostics.CreateScope("MachineLearningRegistryModelVersionResource.Package"); - scope.Start(); - try - { - var response = await _machineLearningRegistryModelVersionRegistryModelVersionsRestClient.PackageAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new ModelPackageResultOperationSource(), _machineLearningRegistryModelVersionRegistryModelVersionsClientDiagnostics, Pipeline, _machineLearningRegistryModelVersionRegistryModelVersionsRestClient.CreatePackageRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Model Version Package operation. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package - /// - /// - /// Operation Id - /// RegistryModelVersions_Package - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// Package operation request body. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Package(WaitUntil waitUntil, ModelPackageContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _machineLearningRegistryModelVersionRegistryModelVersionsClientDiagnostics.CreateScope("MachineLearningRegistryModelVersionResource.Package"); - scope.Start(); - try - { - var response = _machineLearningRegistryModelVersionRegistryModelVersionsRestClient.Package(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new MachineLearningArmOperation(new ModelPackageResultOperationSource(), _machineLearningRegistryModelVersionRegistryModelVersionsClientDiagnostics, Pipeline, _machineLearningRegistryModelVersionRegistryModelVersionsRestClient.CreatePackageRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Generate a storage location and credential for the client to upload a model asset to. /// @@ -451,7 +359,7 @@ public virtual ArmOperation Package(WaitUntil waitUntil, Mod /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -493,7 +401,7 @@ public virtual async Task> CreateOrGetStartPe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs index fd6380308e8bd..4ffedbcaedb31 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs @@ -37,6 +37,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _machineLearningRegistryRegistriesClientDiagnostics; private readonly RegistriesRestOperations _machineLearningRegistryRegistriesRestClient; + private readonly ClientDiagnostics _registryDataReferencesClientDiagnostics; + private readonly RegistryDataReferencesRestOperations _registryDataReferencesRestClient; private readonly MachineLearningRegistryData _data; /// Gets the resource type for the operations. @@ -64,6 +66,8 @@ internal MachineLearningRegistryResource(ArmClient client, ResourceIdentifier id _machineLearningRegistryRegistriesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string machineLearningRegistryRegistriesApiVersion); _machineLearningRegistryRegistriesRestClient = new RegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineLearningRegistryRegistriesApiVersion); + _registryDataReferencesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _registryDataReferencesRestClient = new RegistryDataReferencesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -110,7 +114,7 @@ public virtual MachineLearningRegistryCodeContainerCollection GetMachineLearning /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -141,7 +145,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -179,7 +183,7 @@ public virtual MachineLearninRegistryComponentContainerCollection GetMachineLear /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +214,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -248,7 +252,7 @@ public virtual MachineLearningRegistryDataContainerCollection GetMachineLearning /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -279,7 +283,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -317,7 +321,7 @@ public virtual MachineLearningRegistryEnvironmentContainerCollection GetMachineL /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -348,7 +352,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -386,7 +390,7 @@ public virtual MachineLearningRegistryModelContainerCollection GetMachineLearnin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -417,7 +421,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -448,7 +452,7 @@ public virtual Response GetMachin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -488,7 +492,7 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -528,7 +532,7 @@ public virtual Response Get(CancellationToken c /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -570,7 +574,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -612,7 +616,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -654,7 +658,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -683,6 +687,92 @@ public virtual Response Update(MachineLearningR } } + /// + /// Get blob reference SAS Uri. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version} + /// + /// + /// Operation Id + /// RegistryDataReferences_GetBlobReferenceSas + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// + /// Data reference name. + /// Version identifier. + /// Asset id and blob uri. + /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// , or is null. + public virtual async Task> GetBlobReferenceSasRegistryDataReferenceAsync(string name, string version, GetBlobReferenceSasRequestDto body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _registryDataReferencesClientDiagnostics.CreateScope("MachineLearningRegistryResource.GetBlobReferenceSasRegistryDataReference"); + scope.Start(); + try + { + var response = await _registryDataReferencesRestClient.GetBlobReferenceSasAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, version, body, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get blob reference SAS Uri. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version} + /// + /// + /// Operation Id + /// RegistryDataReferences_GetBlobReferenceSas + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// + /// Data reference name. + /// Version identifier. + /// Asset id and blob uri. + /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// , or is null. + public virtual Response GetBlobReferenceSasRegistryDataReference(string name, string version, GetBlobReferenceSasRequestDto body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _registryDataReferencesClientDiagnostics.CreateScope("MachineLearningRegistryResource.GetBlobReferenceSasRegistryDataReference"); + scope.Start(); + try + { + var response = _registryDataReferencesRestClient.GetBlobReferenceSas(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, version, body, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Remove regions from registry /// @@ -696,7 +786,7 @@ public virtual Response Update(MachineLearningR /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -742,7 +832,7 @@ public virtual async Task> RemoveR /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -788,7 +878,7 @@ public virtual ArmOperation RemoveRegions(WaitU /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -850,7 +940,7 @@ public virtual async Task> AddTagAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -912,7 +1002,7 @@ public virtual Response AddTag(string key, stri /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -969,7 +1059,7 @@ public virtual async Task> SetTagsAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1026,7 +1116,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1086,7 +1176,7 @@ public virtual async Task> RemoveTagAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleCollection.cs index 42b6caf4fd239..976f305e9a891 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateO /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string name, Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(string skip = nu /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleResource.cs index 7a96c93fb2cfe..e309c5f2fc01d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken c /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> UpdateA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceCollection.cs index 4f45ed6a16df9..eacb178398128 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -74,7 +74,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// 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. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for creating or updating a machine learning workspace. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -114,7 +114,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -123,7 +123,7 @@ public virtual async Task> Create /// /// /// 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. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for creating or updating a machine learning workspace. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -171,7 +171,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -216,7 +216,7 @@ public virtual async Task> GetAsync(s /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -253,7 +253,7 @@ public virtual Response Get(string workspaceNa /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -261,14 +261,15 @@ public virtual Response Get(string workspaceNa /// /// /// - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string skip = null, string kind = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skip, kind); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skip, kind); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, kind, skip, aiCapabilities); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, kind, skip, aiCapabilities); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MachineLearningWorkspaceCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -285,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(strin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -293,14 +294,15 @@ public virtual AsyncPageable GetAllAsync(strin /// /// /// - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string skip = null, string kind = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skip, kind); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skip, kind); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, kind, skip, aiCapabilities); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, kind, skip, aiCapabilities); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MachineLearningWorkspaceCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -317,7 +319,7 @@ public virtual Pageable GetAll(string skip = n /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -325,7 +327,7 @@ public virtual Pageable GetAll(string skip = n /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -360,7 +362,7 @@ public virtual async Task> ExistsAsync(string workspaceName, Canc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -368,7 +370,7 @@ public virtual async Task> ExistsAsync(string workspaceName, Canc /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -403,7 +405,7 @@ public virtual Response Exists(string workspaceName, CancellationToken can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -411,7 +413,7 @@ public virtual Response Exists(string workspaceName, CancellationToken can /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -448,7 +450,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -456,7 +458,7 @@ public virtual async Task> Ge /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionCollection.cs index 4b998de842993..445b375eb7efc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string c /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -266,12 +266,13 @@ public virtual Response Get(string c /// /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string target = null, string category = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceConnectionResource(Client, MachineLearningWorkspaceConnectionData.DeserializeMachineLearningWorkspaceConnectionData(e)), _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics, Pipeline, "MachineLearningWorkspaceConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -288,7 +289,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -298,12 +299,13 @@ public virtual AsyncPageable GetAllA /// /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string target = null, string category = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceConnectionResource(Client, MachineLearningWorkspaceConnectionData.DeserializeMachineLearningWorkspaceConnectionData(e)), _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics, Pipeline, "MachineLearningWorkspaceConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -320,7 +322,7 @@ public virtual Pageable GetAll(strin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -363,7 +365,7 @@ public virtual async Task> ExistsAsync(string connectionName, Can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -406,7 +408,7 @@ public virtual Response Exists(string connectionName, CancellationToken ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -451,7 +453,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionData.cs index 961a1f3afc63d..5f9a695aeddcd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionData.cs @@ -51,7 +51,7 @@ public partial class MachineLearningWorkspaceConnectionData : ResourceData /// Initializes a new instance of . /// /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// The available derived classes include , , , , , , , , , , and . /// /// is null. public MachineLearningWorkspaceConnectionData(MachineLearningWorkspaceConnectionProperties properties) @@ -68,7 +68,7 @@ public MachineLearningWorkspaceConnectionData(MachineLearningWorkspaceConnection /// The systemData. /// /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// The available derived classes include , , , , , , , , , , and . /// /// Keeps track of any properties unknown to the library. internal MachineLearningWorkspaceConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MachineLearningWorkspaceConnectionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) @@ -85,7 +85,7 @@ internal MachineLearningWorkspaceConnectionData() /// /// Gets or sets the properties /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// The available derived classes include , , , , , , , , , , and . /// public MachineLearningWorkspaceConnectionProperties Properties { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionResource.cs index a20c7ae286cc9..205f66e7ff1bd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionResource.cs @@ -9,6 +9,7 @@ using System.Globalization; using System.Threading; using System.Threading.Tasks; +using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.MachineLearning.Models; @@ -36,6 +37,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics; private readonly WorkspaceConnectionsRestOperations _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient; + private readonly ClientDiagnostics _workspaceConnectionDeploymentConnectionClientDiagnostics; + private readonly ConnectionRestOperations _workspaceConnectionDeploymentConnectionRestClient; private readonly MachineLearningWorkspaceConnectionData _data; /// Gets the resource type for the operations. @@ -63,6 +66,9 @@ internal MachineLearningWorkspaceConnectionResource(ArmClient client, ResourceId _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string machineLearningWorkspaceConnectionWorkspaceConnectionsApiVersion); _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient = new WorkspaceConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineLearningWorkspaceConnectionWorkspaceConnectionsApiVersion); + _workspaceConnectionDeploymentConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionDeploymentResource.ResourceType, out string workspaceConnectionDeploymentConnectionApiVersion); + _workspaceConnectionDeploymentConnectionRestClient = new ConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionDeploymentConnectionApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -89,6 +95,213 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of WorkspaceConnectionDeploymentResources in the MachineLearningWorkspaceConnection. + /// An object representing collection of WorkspaceConnectionDeploymentResources and their operations over a WorkspaceConnectionDeploymentResource. + public virtual WorkspaceConnectionDeploymentCollection GetWorkspaceConnectionDeployments() + { + return GetCachedClient(client => new WorkspaceConnectionDeploymentCollection(client, Id)); + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkspaceConnectionDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) + { + return await GetWorkspaceConnectionDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkspaceConnectionDeployment(string deploymentName, CancellationToken cancellationToken = default) + { + return GetWorkspaceConnectionDeployments().Get(deploymentName, cancellationToken); + } + + /// Gets a collection of RaiBlocklistPropertiesBasicResources in the MachineLearningWorkspaceConnection. + /// An object representing collection of RaiBlocklistPropertiesBasicResources and their operations over a RaiBlocklistPropertiesBasicResource. + public virtual RaiBlocklistPropertiesBasicResourceCollection GetRaiBlocklistPropertiesBasicResources() + { + return GetCachedClient(client => new RaiBlocklistPropertiesBasicResourceCollection(client, Id)); + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRaiBlocklistPropertiesBasicResourceAsync(string raiBlocklistName, CancellationToken cancellationToken = default) + { + return await GetRaiBlocklistPropertiesBasicResources().GetAsync(raiBlocklistName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRaiBlocklistPropertiesBasicResource(string raiBlocklistName, CancellationToken cancellationToken = default) + { + return GetRaiBlocklistPropertiesBasicResources().Get(raiBlocklistName, cancellationToken); + } + + /// Gets a collection of WorkspaceConnectionRaiPolicyResources in the MachineLearningWorkspaceConnection. + /// An object representing collection of WorkspaceConnectionRaiPolicyResources and their operations over a WorkspaceConnectionRaiPolicyResource. + public virtual WorkspaceConnectionRaiPolicyCollection GetWorkspaceConnectionRaiPolicies() + { + return GetCachedClient(client => new WorkspaceConnectionRaiPolicyCollection(client, Id)); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkspaceConnectionRaiPolicyAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + return await GetWorkspaceConnectionRaiPolicies().GetAsync(raiPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkspaceConnectionRaiPolicy(string raiPolicyName, CancellationToken cancellationToken = default) + { + return GetWorkspaceConnectionRaiPolicies().Get(raiPolicyName, cancellationToken); + } + /// /// Lists machine learning workspaces connections by name. /// @@ -102,7 +315,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +355,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +395,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +439,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -270,7 +483,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -312,7 +525,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -354,7 +567,7 @@ public virtual Response Update(Machi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -392,7 +605,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -416,5 +629,151 @@ public virtual Response GetSecrets(C throw; } } + + /// + /// Test machine learning workspaces connections under the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection + /// + /// + /// Operation Id + /// WorkspaceConnections_TestConnection + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Workspace Connection object. + /// The cancellation token to use. + public virtual async Task TestConnectionAsync(WaitUntil waitUntil, MachineLearningWorkspaceConnectionData data = null, CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics.CreateScope("MachineLearningWorkspaceConnectionResource.TestConnection"); + scope.Start(); + try + { + var response = await _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.TestConnectionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics, Pipeline, _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateTestConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Test machine learning workspaces connections under the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection + /// + /// + /// Operation Id + /// WorkspaceConnections_TestConnection + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Workspace Connection object. + /// The cancellation token to use. + public virtual ArmOperation TestConnection(WaitUntil waitUntil, MachineLearningWorkspaceConnectionData data = null, CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics.CreateScope("MachineLearningWorkspaceConnectionResource.TestConnection"); + scope.Start(); + try + { + var response = _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.TestConnection(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics, Pipeline, _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateTestConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get available models under the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models + /// + /// + /// Operation Id + /// Connection_GetModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetModelsConnectionsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateGetModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionDeploymentConnectionRestClient.CreateGetModelsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "MachineLearningWorkspaceConnectionResource.GetModelsConnections", "value", "nextLink", cancellationToken); + } + + /// + /// Get available models under the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models + /// + /// + /// Operation Id + /// Connection_GetModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetModelsConnections(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateGetModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionDeploymentConnectionRestClient.CreateGetModelsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "MachineLearningWorkspaceConnectionResource.GetModelsConnections", "value", "nextLink", cancellationToken); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.Serialization.cs index 889f237d0cebe..514bb6dfc90b8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.Serialization.cs @@ -84,6 +84,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("allowPublicAccessWhenBehindVnet"u8); writer.WriteBooleanValue(AllowPublicAccessWhenBehindVnet.Value); } + if (Optional.IsDefined(AllowRoleAssignmentOnRG)) + { + writer.WritePropertyName("allowRoleAssignmentOnRG"u8); + writer.WriteBooleanValue(AllowRoleAssignmentOnRG.Value); + } if (Optional.IsDefined(ApplicationInsights)) { writer.WritePropertyName("applicationInsights"u8); @@ -129,6 +134,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("enableDataIsolation"u8); writer.WriteBooleanValue(EnableDataIsolation.Value); } + if (Optional.IsDefined(EnableServiceSideCMKEncryption)) + { + writer.WritePropertyName("enableServiceSideCMKEncryption"u8); + writer.WriteBooleanValue(EnableServiceSideCMKEncryption.Value); + } + if (Optional.IsDefined(EnableSimplifiedCmk)) + { + writer.WritePropertyName("enableSimplifiedCmk"u8); + writer.WriteBooleanValue(EnableSimplifiedCmk.Value); + } + if (Optional.IsDefined(EnableSoftwareBillOfMaterials)) + { + writer.WritePropertyName("enableSoftwareBillOfMaterials"u8); + writer.WriteBooleanValue(EnableSoftwareBillOfMaterials.Value); + } if (Optional.IsDefined(Encryption)) { writer.WritePropertyName("encryption"u8); @@ -169,6 +189,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("imageBuildCompute"u8); writer.WriteStringValue(ImageBuildCompute); } + if (Optional.IsCollectionDefined(IPAllowlist)) + { + writer.WritePropertyName("ipAllowlist"u8); + writer.WriteStartArray(); + foreach (var item in IPAllowlist) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(KeyVault)) { writer.WritePropertyName("keyVault"u8); @@ -229,6 +259,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("publicNetworkAccess"u8); writer.WriteStringValue(PublicNetworkAccessType.Value.ToString()); } + if (Optional.IsDefined(ServerlessComputeSettings)) + { + writer.WritePropertyName("serverlessComputeSettings"u8); + writer.WriteObjectValue(ServerlessComputeSettings, options); + } if (Optional.IsDefined(ServiceManagedResourcesSettings)) { writer.WritePropertyName("serviceManagedResourcesSettings"u8); @@ -348,6 +383,7 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace ResourceType type = default; SystemData systemData = default; bool? allowPublicAccessWhenBehindVnet = default; + bool? allowRoleAssignmentOnRG = default; string applicationInsights = default; IList associatedWorkspaces = default; IList containerRegistries = default; @@ -355,6 +391,9 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace string description = default; Uri discoveryUrl = default; bool? enableDataIsolation = default; + bool? enableServiceSideCMKEncryption = default; + bool? enableSimplifiedCmk = default; + bool? enableSoftwareBillOfMaterials = default; MachineLearningEncryptionSetting encryption = default; IList existingWorkspaces = default; FeatureStoreSettings featureStoreSettings = default; @@ -362,6 +401,7 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace bool? hbiWorkspace = default; ResourceIdentifier hubResourceId = default; string imageBuildCompute = default; + IList ipAllowlist = default; string keyVault = default; IList keyVaults = default; ManagedNetworkSettings managedNetwork = default; @@ -372,6 +412,7 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace int? privateLinkCount = default; MachineLearningProvisioningState? provisioningState = default; MachineLearningPublicNetworkAccessType? publicNetworkAccess = default; + ServerlessComputeSettings serverlessComputeSettings = default; ServiceManagedResourcesSettings serviceManagedResourcesSettings = default; string serviceProvisionedResourceGroup = default; IList sharedPrivateLinkResources = default; @@ -473,6 +514,15 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace allowPublicAccessWhenBehindVnet = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("allowRoleAssignmentOnRG"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowRoleAssignmentOnRG = property0.Value.GetBoolean(); + continue; + } if (property0.NameEquals("applicationInsights"u8)) { applicationInsights = property0.Value.GetString(); @@ -534,6 +584,33 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace enableDataIsolation = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("enableServiceSideCMKEncryption"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableServiceSideCMKEncryption = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("enableSimplifiedCmk"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableSimplifiedCmk = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("enableSoftwareBillOfMaterials"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableSoftwareBillOfMaterials = property0.Value.GetBoolean(); + continue; + } if (property0.NameEquals("encryption"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -594,6 +671,20 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace imageBuildCompute = property0.Value.GetString(); continue; } + if (property0.NameEquals("ipAllowlist"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAllowlist = array; + continue; + } if (property0.NameEquals("keyVault"u8)) { keyVault = property0.Value.GetString(); @@ -686,6 +777,15 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace publicNetworkAccess = new MachineLearningPublicNetworkAccessType(property0.Value.GetString()); continue; } + if (property0.NameEquals("serverlessComputeSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverlessComputeSettings = ServerlessComputeSettings.DeserializeServerlessComputeSettings(property0.Value, options); + continue; + } if (property0.NameEquals("serviceManagedResourcesSettings"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -808,6 +908,7 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace kind, sku, allowPublicAccessWhenBehindVnet, + allowRoleAssignmentOnRG, applicationInsights, associatedWorkspaces ?? new ChangeTrackingList(), containerRegistries ?? new ChangeTrackingList(), @@ -815,6 +916,9 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace description, discoveryUrl, enableDataIsolation, + enableServiceSideCMKEncryption, + enableSimplifiedCmk, + enableSoftwareBillOfMaterials, encryption, existingWorkspaces ?? new ChangeTrackingList(), featureStoreSettings, @@ -822,6 +926,7 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace hbiWorkspace, hubResourceId, imageBuildCompute, + ipAllowlist ?? new ChangeTrackingList(), keyVault, keyVaults ?? new ChangeTrackingList(), managedNetwork, @@ -832,6 +937,7 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace privateLinkCount, provisioningState, publicNetworkAccess, + serverlessComputeSettings, serviceManagedResourcesSettings, serviceProvisionedResourceGroup, sharedPrivateLinkResources ?? new ChangeTrackingList(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.cs index 0a2cbb29eed3d..40bbc153be846 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.cs @@ -58,6 +58,7 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) AssociatedWorkspaces = new ChangeTrackingList(); ContainerRegistries = new ChangeTrackingList(); ExistingWorkspaces = new ChangeTrackingList(); + IPAllowlist = new ChangeTrackingList(); KeyVaults = new ChangeTrackingList(); PrivateEndpointConnections = new ChangeTrackingList(); SharedPrivateLinkResources = new ChangeTrackingList(); @@ -75,6 +76,7 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) /// /// Optional. This field is required to be implemented by the RP because AML is supporting more than one tier. /// The flag to indicate whether to allow public access when behind VNet. + /// The flag to indicate whether we will do role assignment for the workspace MSI on resource group level. /// ARM id of the application insights associated with this workspace. /// /// @@ -82,6 +84,9 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) /// The description of this workspace. /// Url for the discovery service to identify regional endpoints for machine learning experimentation services. /// + /// + /// Flag to tell if simplified CMK should be enabled for this workspace. + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. /// /// /// Settings for feature store type workspace. @@ -89,6 +94,7 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) /// The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service. /// /// The compute name for image build. + /// The list of IPv4 addresses that are allowed to access the workspace. /// ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created. /// /// Managed Network settings for a machine learning workspace. @@ -99,6 +105,7 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) /// Count of private connections in the workspace. /// The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. /// Whether requests from Public Network are allowed. + /// Settings for serverless compute in a workspace. /// The service managed resource settings. /// The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace. /// The list of shared private link resources in this workspace. @@ -112,12 +119,13 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) /// WorkspaceHub's configuration object. /// The immutable id associated with this workspace. /// Keeps track of any properties unknown to the library. - internal MachineLearningWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, MachineLearningSku sku, bool? allowPublicAccessWhenBehindVnet, string applicationInsights, IList associatedWorkspaces, IList containerRegistries, string containerRegistry, string description, Uri discoveryUri, bool? enableDataIsolation, MachineLearningEncryptionSetting encryption, IList existingWorkspaces, FeatureStoreSettings featureStoreSettings, string friendlyName, bool? isHbiWorkspace, ResourceIdentifier hubResourceId, string imageBuildCompute, string keyVault, IList keyVaults, ManagedNetworkSettings managedNetwork, Uri mlFlowTrackingUri, MachineLearningNotebookResourceInfo notebookInfo, string primaryUserAssignedIdentity, IReadOnlyList privateEndpointConnections, int? privateLinkCount, MachineLearningProvisioningState? provisioningState, MachineLearningPublicNetworkAccessType? publicNetworkAccessType, ServiceManagedResourcesSettings serviceManagedResourcesSettings, string serviceProvisionedResourceGroup, IList sharedPrivateLinkResources, int? softDeleteRetentionInDays, string storageAccount, IList storageAccounts, bool? isStorageHnsEnabled, string systemDatastoresAuthMode, Guid? tenantId, bool? isV1LegacyMode, WorkspaceHubConfig workspaceHubConfig, string workspaceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MachineLearningWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, MachineLearningSku sku, bool? allowPublicAccessWhenBehindVnet, bool? allowRoleAssignmentOnRG, string applicationInsights, IList associatedWorkspaces, IList containerRegistries, string containerRegistry, string description, Uri discoveryUri, bool? enableDataIsolation, bool? enableServiceSideCMKEncryption, bool? enableSimplifiedCmk, bool? enableSoftwareBillOfMaterials, MachineLearningEncryptionSetting encryption, IList existingWorkspaces, FeatureStoreSettings featureStoreSettings, string friendlyName, bool? isHbiWorkspace, ResourceIdentifier hubResourceId, string imageBuildCompute, IList ipAllowlist, string keyVault, IList keyVaults, ManagedNetworkSettings managedNetwork, Uri mlFlowTrackingUri, MachineLearningNotebookResourceInfo notebookInfo, string primaryUserAssignedIdentity, IReadOnlyList privateEndpointConnections, int? privateLinkCount, MachineLearningProvisioningState? provisioningState, MachineLearningPublicNetworkAccessType? publicNetworkAccessType, ServerlessComputeSettings serverlessComputeSettings, ServiceManagedResourcesSettings serviceManagedResourcesSettings, string serviceProvisionedResourceGroup, IList sharedPrivateLinkResources, int? softDeleteRetentionInDays, string storageAccount, IList storageAccounts, bool? isStorageHnsEnabled, string systemDatastoresAuthMode, Guid? tenantId, bool? isV1LegacyMode, WorkspaceHubConfig workspaceHubConfig, string workspaceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Identity = identity; Kind = kind; Sku = sku; AllowPublicAccessWhenBehindVnet = allowPublicAccessWhenBehindVnet; + AllowRoleAssignmentOnRG = allowRoleAssignmentOnRG; ApplicationInsights = applicationInsights; AssociatedWorkspaces = associatedWorkspaces; ContainerRegistries = containerRegistries; @@ -125,6 +133,9 @@ internal MachineLearningWorkspaceData(ResourceIdentifier id, string name, Resour Description = description; DiscoveryUri = discoveryUri; EnableDataIsolation = enableDataIsolation; + EnableServiceSideCMKEncryption = enableServiceSideCMKEncryption; + EnableSimplifiedCmk = enableSimplifiedCmk; + EnableSoftwareBillOfMaterials = enableSoftwareBillOfMaterials; Encryption = encryption; ExistingWorkspaces = existingWorkspaces; FeatureStoreSettings = featureStoreSettings; @@ -132,6 +143,7 @@ internal MachineLearningWorkspaceData(ResourceIdentifier id, string name, Resour IsHbiWorkspace = isHbiWorkspace; HubResourceId = hubResourceId; ImageBuildCompute = imageBuildCompute; + IPAllowlist = ipAllowlist; KeyVault = keyVault; KeyVaults = keyVaults; ManagedNetwork = managedNetwork; @@ -142,6 +154,7 @@ internal MachineLearningWorkspaceData(ResourceIdentifier id, string name, Resour PrivateLinkCount = privateLinkCount; ProvisioningState = provisioningState; PublicNetworkAccessType = publicNetworkAccessType; + ServerlessComputeSettings = serverlessComputeSettings; ServiceManagedResourcesSettings = serviceManagedResourcesSettings; ServiceProvisionedResourceGroup = serviceProvisionedResourceGroup; SharedPrivateLinkResources = sharedPrivateLinkResources; @@ -170,6 +183,8 @@ internal MachineLearningWorkspaceData() public MachineLearningSku Sku { get; set; } /// The flag to indicate whether to allow public access when behind VNet. public bool? AllowPublicAccessWhenBehindVnet { get; set; } + /// The flag to indicate whether we will do role assignment for the workspace MSI on resource group level. + public bool? AllowRoleAssignmentOnRG { get; set; } /// ARM id of the application insights associated with this workspace. public string ApplicationInsights { get; set; } /// Gets the associated workspaces. @@ -184,6 +199,12 @@ internal MachineLearningWorkspaceData() public Uri DiscoveryUri { get; set; } /// Gets or sets the enable data isolation. public bool? EnableDataIsolation { get; set; } + /// Gets or sets the enable service side cmk encryption. + public bool? EnableServiceSideCMKEncryption { get; set; } + /// Flag to tell if simplified CMK should be enabled for this workspace. + public bool? EnableSimplifiedCmk { get; set; } + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. + public bool? EnableSoftwareBillOfMaterials { get; set; } /// Gets or sets the encryption. public MachineLearningEncryptionSetting Encryption { get; set; } /// Gets the existing workspaces. @@ -198,6 +219,8 @@ internal MachineLearningWorkspaceData() public ResourceIdentifier HubResourceId { get; set; } /// The compute name for image build. public string ImageBuildCompute { get; set; } + /// The list of IPv4 addresses that are allowed to access the workspace. + public IList IPAllowlist { get; } /// ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created. public string KeyVault { get; set; } /// Gets the key vaults. @@ -218,6 +241,8 @@ internal MachineLearningWorkspaceData() public MachineLearningProvisioningState? ProvisioningState { get; } /// Whether requests from Public Network are allowed. public MachineLearningPublicNetworkAccessType? PublicNetworkAccessType { get; set; } + /// Settings for serverless compute in a workspace. + public ServerlessComputeSettings ServerlessComputeSettings { get; set; } /// The service managed resource settings. internal ServiceManagedResourcesSettings ServiceManagedResourcesSettings { get; set; } /// Gets or sets the cosmos db collections throughput. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs index 38f807b23fe9c..4ae5e56ea584c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs @@ -40,6 +40,10 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly WorkspacesRestOperations _machineLearningWorkspaceWorkspacesRestClient; private readonly ClientDiagnostics _workspaceFeaturesClientDiagnostics; private readonly WorkspaceFeaturesRestOperations _workspaceFeaturesRestClient; + private readonly ClientDiagnostics _workspaceConnectionDeploymentConnectionClientDiagnostics; + private readonly ConnectionRestOperations _workspaceConnectionDeploymentConnectionRestClient; + private readonly ClientDiagnostics _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics; + private readonly EndpointDeploymentRestOperations _workspaceEndpointDeploymentEndpointDeploymentRestClient; private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics; private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient; private readonly ClientDiagnostics _managedNetworkProvisionsClientDiagnostics; @@ -73,6 +77,12 @@ internal MachineLearningWorkspaceResource(ArmClient client, ResourceIdentifier i _machineLearningWorkspaceWorkspacesRestClient = new WorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineLearningWorkspaceWorkspacesApiVersion); _workspaceFeaturesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ProviderConstants.DefaultProviderNamespace, Diagnostics); _workspaceFeaturesRestClient = new WorkspaceFeaturesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _workspaceConnectionDeploymentConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionDeploymentResource.ResourceType, out string workspaceConnectionDeploymentConnectionApiVersion); + _workspaceConnectionDeploymentConnectionRestClient = new ConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionDeploymentConnectionApiVersion); + _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceEndpointDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceEndpointDeploymentResource.ResourceType, out string workspaceEndpointDeploymentEndpointDeploymentApiVersion); + _workspaceEndpointDeploymentEndpointDeploymentRestClient = new EndpointDeploymentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointDeploymentEndpointDeploymentApiVersion); _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ProviderConstants.DefaultProviderNamespace, Diagnostics); _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _managedNetworkProvisionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ProviderConstants.DefaultProviderNamespace, Diagnostics); @@ -123,7 +133,7 @@ public virtual MachineLearningComputeCollection GetMachineLearningComputes() /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -154,7 +164,7 @@ public virtual async Task> GetMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -192,7 +202,7 @@ public virtual MachineLearningCodeContainerCollection GetMachineLearningCodeCont /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -223,7 +233,7 @@ public virtual async Task> GetMac /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -261,7 +271,7 @@ public virtual MachineLearningComponentContainerCollection GetMachineLearningCom /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +302,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -330,7 +340,7 @@ public virtual MachineLearningDataContainerCollection GetMachineLearningDataCont /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -361,7 +371,7 @@ public virtual async Task> GetMac /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -399,7 +409,7 @@ public virtual MachineLearningEnvironmentContainerCollection GetMachineLearningE /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -430,7 +440,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -448,6 +458,75 @@ public virtual Response GetMachineL return GetMachineLearningEnvironmentContainers().Get(name, cancellationToken); } + /// Gets a collection of MarketplaceSubscriptionResources in the MachineLearningWorkspace. + /// An object representing collection of MarketplaceSubscriptionResources and their operations over a MarketplaceSubscriptionResource. + public virtual MarketplaceSubscriptionCollection GetMarketplaceSubscriptions() + { + return GetCachedClient(client => new MarketplaceSubscriptionCollection(client, Id)); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMarketplaceSubscriptionAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMarketplaceSubscriptions().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMarketplaceSubscription(string name, CancellationToken cancellationToken = default) + { + return GetMarketplaceSubscriptions().Get(name, cancellationToken); + } + /// Gets a collection of MachineLearningModelContainerResources in the MachineLearningWorkspace. /// An object representing collection of MachineLearningModelContainerResources and their operations over a MachineLearningModelContainerResource. public virtual MachineLearningModelContainerCollection GetMachineLearningModelContainers() @@ -468,7 +547,7 @@ public virtual MachineLearningModelContainerCollection GetMachineLearningModelCo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -499,7 +578,7 @@ public virtual async Task> GetMa /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -537,7 +616,7 @@ public virtual MachineLearningBatchEndpointCollection GetMachineLearningBatchEnd /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -568,7 +647,7 @@ public virtual async Task> GetMac /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -606,7 +685,7 @@ public virtual MachineLearningDatastoreCollection GetMachineLearningDatastores() /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -637,7 +716,7 @@ public virtual async Task> GetMachine /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -675,7 +754,7 @@ public virtual MachineLearningFeatureSetContainerCollection GetMachineLearningFe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -706,7 +785,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -744,7 +823,7 @@ public virtual MachineLearningFeatureStoreEntityContainerCollection GetMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -775,7 +854,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -813,7 +892,7 @@ public virtual MachineLearningJobCollection GetMachineLearningJobs() /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -844,7 +923,7 @@ public virtual async Task> GetMachineLearni /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -862,215 +941,211 @@ public virtual Response GetMachineLearningJob(string return GetMachineLearningJobs().Get(id, cancellationToken); } - /// Gets a collection of MachineLearningLabelingJobResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningLabelingJobResources and their operations over a MachineLearningLabelingJobResource. - public virtual MachineLearningLabelingJobCollection GetMachineLearningLabelingJobs() + /// Gets a collection of MachineLearningOnlineEndpointResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningOnlineEndpointResources and their operations over a MachineLearningOnlineEndpointResource. + public virtual MachineLearningOnlineEndpointCollection GetMachineLearningOnlineEndpoints() { - return GetCachedClient(client => new MachineLearningLabelingJobCollection(client, Id)); + return GetCachedClient(client => new MachineLearningOnlineEndpointCollection(client, Id)); } /// - /// Gets a labeling job by name/id. + /// Get Online Endpoint. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName} /// /// /// Operation Id - /// LabelingJobs_Get + /// OnlineEndpoints_Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. + /// Online Endpoint name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningLabelingJobAsync(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) + public virtual async Task> GetMachineLearningOnlineEndpointAsync(string endpointName, CancellationToken cancellationToken = default) { - return await GetMachineLearningLabelingJobs().GetAsync(id, includeJobInstructions, includeLabelCategories, cancellationToken).ConfigureAwait(false); + return await GetMachineLearningOnlineEndpoints().GetAsync(endpointName, cancellationToken).ConfigureAwait(false); } /// - /// Gets a labeling job by name/id. + /// Get Online Endpoint. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName} /// /// /// Operation Id - /// LabelingJobs_Get + /// OnlineEndpoints_Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. + /// Online Endpoint name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetMachineLearningLabelingJob(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) + public virtual Response GetMachineLearningOnlineEndpoint(string endpointName, CancellationToken cancellationToken = default) { - return GetMachineLearningLabelingJobs().Get(id, includeJobInstructions, includeLabelCategories, cancellationToken); + return GetMachineLearningOnlineEndpoints().Get(endpointName, cancellationToken); } - /// Gets a collection of MachineLearningOnlineEndpointResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningOnlineEndpointResources and their operations over a MachineLearningOnlineEndpointResource. - public virtual MachineLearningOnlineEndpointCollection GetMachineLearningOnlineEndpoints() + /// Gets a collection of MachineLearningScheduleResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningScheduleResources and their operations over a MachineLearningScheduleResource. + public virtual MachineLearningScheduleCollection GetMachineLearningSchedules() { - return GetCachedClient(client => new MachineLearningOnlineEndpointCollection(client, Id)); + return GetCachedClient(client => new MachineLearningScheduleCollection(client, Id)); } /// - /// Get Online Endpoint. + /// Get schedule. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name} /// /// /// Operation Id - /// OnlineEndpoints_Get + /// Schedules_Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Online Endpoint name. + /// Schedule name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningOnlineEndpointAsync(string endpointName, CancellationToken cancellationToken = default) + public virtual async Task> GetMachineLearningScheduleAsync(string name, CancellationToken cancellationToken = default) { - return await GetMachineLearningOnlineEndpoints().GetAsync(endpointName, cancellationToken).ConfigureAwait(false); + return await GetMachineLearningSchedules().GetAsync(name, cancellationToken).ConfigureAwait(false); } /// - /// Get Online Endpoint. + /// Get schedule. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name} /// /// /// Operation Id - /// OnlineEndpoints_Get + /// Schedules_Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Online Endpoint name. + /// Schedule name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetMachineLearningOnlineEndpoint(string endpointName, CancellationToken cancellationToken = default) + public virtual Response GetMachineLearningSchedule(string name, CancellationToken cancellationToken = default) { - return GetMachineLearningOnlineEndpoints().Get(endpointName, cancellationToken); + return GetMachineLearningSchedules().Get(name, cancellationToken); } - /// Gets a collection of MachineLearningScheduleResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningScheduleResources and their operations over a MachineLearningScheduleResource. - public virtual MachineLearningScheduleCollection GetMachineLearningSchedules() + /// Gets a collection of ServerlessEndpointResources in the MachineLearningWorkspace. + /// An object representing collection of ServerlessEndpointResources and their operations over a ServerlessEndpointResource. + public virtual ServerlessEndpointCollection GetServerlessEndpoints() { - return GetCachedClient(client => new MachineLearningScheduleCollection(client, Id)); + return GetCachedClient(client => new ServerlessEndpointCollection(client, Id)); } /// - /// Get schedule. + /// Get Serverless Endpoint. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} /// /// /// Operation Id - /// Schedules_Get + /// ServerlessEndpoints_Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Schedule name. + /// Serverless Endpoint name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningScheduleAsync(string name, CancellationToken cancellationToken = default) + public virtual async Task> GetServerlessEndpointAsync(string name, CancellationToken cancellationToken = default) { - return await GetMachineLearningSchedules().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetServerlessEndpoints().GetAsync(name, cancellationToken).ConfigureAwait(false); } /// - /// Get schedule. + /// Get Serverless Endpoint. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} /// /// /// Operation Id - /// Schedules_Get + /// ServerlessEndpoints_Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Schedule name. + /// Serverless Endpoint name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetMachineLearningSchedule(string name, CancellationToken cancellationToken = default) + public virtual Response GetServerlessEndpoint(string name, CancellationToken cancellationToken = default) { - return GetMachineLearningSchedules().Get(name, cancellationToken); + return GetServerlessEndpoints().Get(name, cancellationToken); } /// Gets a collection of MachineLearningWorkspaceConnectionResources in the MachineLearningWorkspace. @@ -1093,7 +1168,7 @@ public virtual MachineLearningWorkspaceConnectionCollection GetMachineLearningWo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1124,7 +1199,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1142,6 +1217,75 @@ public virtual Response GetMachineLe return GetMachineLearningWorkspaceConnections().Get(connectionName, cancellationToken); } + /// Gets a collection of EndpointResourcePropertiesBasicResources in the MachineLearningWorkspace. + /// An object representing collection of EndpointResourcePropertiesBasicResources and their operations over a EndpointResourcePropertiesBasicResource. + public virtual EndpointResourcePropertiesBasicResourceCollection GetEndpointResourcePropertiesBasicResources() + { + return GetCachedClient(client => new EndpointResourcePropertiesBasicResourceCollection(client, Id)); + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEndpointResourcePropertiesBasicResourceAsync(string endpointName, CancellationToken cancellationToken = default) + { + return await GetEndpointResourcePropertiesBasicResources().GetAsync(endpointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEndpointResourcePropertiesBasicResource(string endpointName, CancellationToken cancellationToken = default) + { + return GetEndpointResourcePropertiesBasicResources().Get(endpointName, cancellationToken); + } + /// Gets a collection of MachineLearningOutboundRuleBasicResources in the MachineLearningWorkspace. /// An object representing collection of MachineLearningOutboundRuleBasicResources and their operations over a MachineLearningOutboundRuleBasicResource. public virtual MachineLearningOutboundRuleBasicCollection GetMachineLearningOutboundRuleBasics() @@ -1162,7 +1306,7 @@ public virtual MachineLearningOutboundRuleBasicCollection GetMachineLearningOutb /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1193,7 +1337,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1231,7 +1375,7 @@ public virtual MachineLearningPrivateEndpointConnectionCollection GetMachineLear /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1262,7 +1406,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1293,7 +1437,7 @@ public virtual Response GetMac /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1333,7 +1477,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1373,7 +1517,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1416,7 +1560,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1459,7 +1603,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceToPurge = nul /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1505,7 +1649,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1551,7 +1695,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1577,7 +1721,7 @@ public virtual AsyncPageable GetWorkspaceFeaturesAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1603,7 +1747,7 @@ public virtual Pageable GetWorkspaceFeatures(Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1646,7 +1790,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1689,7 +1833,7 @@ public virtual ArmOperation Diagnose(Wai /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1727,7 +1871,7 @@ public virtual async Task> GetKe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1765,7 +1909,7 @@ public virtual Response GetKeys(Cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1803,7 +1947,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1841,7 +1985,7 @@ public virtual Response GetNo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1879,7 +2023,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1917,7 +2061,7 @@ public virtual Response GetNotebo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1955,7 +2099,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1993,7 +2137,7 @@ public virtual Response Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2022,7 +2166,7 @@ public virtual AsyncPageable GetOutboundNetworkDep /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2051,7 +2195,7 @@ public virtual Pageable GetOutboundNetworkDependen /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2093,7 +2237,7 @@ public virtual async Task> Pre /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2135,7 +2279,7 @@ public virtual ArmOperation PrepareNotebook /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2177,7 +2321,7 @@ public virtual async Task ResyncKeysAsync(WaitUntil waitUntil, Can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2206,6 +2350,128 @@ public virtual ArmOperation ResyncKeys(WaitUntil waitUntil, CancellationToken ca } } + /// + /// Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels + /// + /// + /// Operation Id + /// Connection_ListModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetModelsConnectionsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateListModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetModelsConnections", "value", null, cancellationToken); + } + + /// + /// Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels + /// + /// + /// Operation Id + /// Connection_ListModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetModelsConnections(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateListModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetModelsConnections", "value", null, cancellationToken); + } + + /// + /// Get all the deployments under the workspace scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments + /// + /// + /// Operation Id + /// EndpointDeployment_GetInWorkspace + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetInWorkspaceEndpointDeploymentsAsync(EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateGetInWorkspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateGetInWorkspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, skip); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetInWorkspaceEndpointDeployments", "value", "nextLink", cancellationToken); + } + + /// + /// Get all the deployments under the workspace scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments + /// + /// + /// Operation Id + /// EndpointDeployment_GetInWorkspace + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetInWorkspaceEndpointDeployments(EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateGetInWorkspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateGetInWorkspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, skip); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetInWorkspaceEndpointDeployments", "value", "nextLink", cancellationToken); + } + /// /// Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. /// Each "private link resource" is a connection endpoint (IP address) to the resource. @@ -2223,7 +2489,7 @@ public virtual ArmOperation ResyncKeys(WaitUntil waitUntil, CancellationToken ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -2252,7 +2518,7 @@ public virtual AsyncPageable GetPrivateLinkR /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -2277,7 +2543,7 @@ public virtual Pageable GetPrivateLinkResour /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -2316,7 +2582,7 @@ public virtual async Task> Provision /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -2355,7 +2621,7 @@ public virtual ArmOperation ProvisionManagedNetwo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2417,7 +2683,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2479,7 +2745,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2536,7 +2802,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2593,7 +2859,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2653,7 +2919,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionCollection.cs new file mode 100644 index 0000000000000..a5a48c172723f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionCollection.cs @@ -0,0 +1,495 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMarketplaceSubscriptions method from an instance of . + /// + public partial class MarketplaceSubscriptionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _marketplaceSubscriptionClientDiagnostics; + private readonly MarketplaceSubscriptionsRestOperations _marketplaceSubscriptionRestClient; + + /// Initializes a new instance of the class for mocking. + protected MarketplaceSubscriptionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MarketplaceSubscriptionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _marketplaceSubscriptionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", MarketplaceSubscriptionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MarketplaceSubscriptionResource.ResourceType, out string marketplaceSubscriptionApiVersion); + _marketplaceSubscriptionRestClient = new MarketplaceSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, marketplaceSubscriptionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceResource.ResourceType), nameof(id)); + } + + /// + /// Create or update Marketplace Subscription (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Marketplace Subscription name. + /// Marketplace Subscription entity to apply during operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string name, MarketplaceSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new MarketplaceSubscriptionOperationSource(Client), _marketplaceSubscriptionClientDiagnostics, Pipeline, _marketplaceSubscriptionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Marketplace Subscription (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Marketplace Subscription name. + /// Marketplace Subscription entity to apply during operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string name, MarketplaceSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new MarketplaceSubscriptionOperationSource(Client), _marketplaceSubscriptionClientDiagnostics, Pipeline, _marketplaceSubscriptionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.Get"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MarketplaceSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.Get"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MarketplaceSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List containers. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token for pagination. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _marketplaceSubscriptionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _marketplaceSubscriptionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MarketplaceSubscriptionResource(Client, MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(e)), _marketplaceSubscriptionClientDiagnostics, Pipeline, "MarketplaceSubscriptionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List containers. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token for pagination. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _marketplaceSubscriptionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _marketplaceSubscriptionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MarketplaceSubscriptionResource(Client, MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(e)), _marketplaceSubscriptionClientDiagnostics, Pipeline, "MarketplaceSubscriptionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.Exists"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.Exists"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MarketplaceSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MarketplaceSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionData.Serialization.cs similarity index 70% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobData.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionData.Serialization.cs index 4a0b2fbf85dd5..7e8c7978e0755 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionData.Serialization.cs @@ -15,16 +15,16 @@ namespace Azure.ResourceManager.MachineLearning { - public partial class MachineLearningLabelingJobData : IUtf8JsonSerializable, IJsonModel + public partial class MarketplaceSubscriptionData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MachineLearningLabelingJobData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -68,19 +68,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WriteEndObject(); } - MachineLearningLabelingJobData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MarketplaceSubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MachineLearningLabelingJobData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningLabelingJobData(document.RootElement, options); + return DeserializeMarketplaceSubscriptionData(document.RootElement, options); } - internal static MachineLearningLabelingJobData DeserializeMachineLearningLabelingJobData(JsonElement element, ModelReaderWriterOptions options = null) + internal static MarketplaceSubscriptionData DeserializeMarketplaceSubscriptionData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -88,7 +88,7 @@ internal static MachineLearningLabelingJobData DeserializeMachineLearningLabelin { return null; } - LabelingJobProperties properties = default; + MarketplaceSubscriptionProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -99,7 +99,7 @@ internal static MachineLearningLabelingJobData DeserializeMachineLearningLabelin { if (property.NameEquals("properties"u8)) { - properties = LabelingJobProperties.DeserializeLabelingJobProperties(property.Value, options); + properties = MarketplaceSubscriptionProperties.DeserializeMarketplaceSubscriptionProperties(property.Value, options); continue; } if (property.NameEquals("id"u8)) @@ -132,7 +132,7 @@ internal static MachineLearningLabelingJobData DeserializeMachineLearningLabelin } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningLabelingJobData( + return new MarketplaceSubscriptionData( id, name, type, @@ -141,35 +141,35 @@ internal static MachineLearningLabelingJobData DeserializeMachineLearningLabelin serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MachineLearningLabelingJobData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionData)} does not support writing '{options.Format}' format."); } } - MachineLearningLabelingJobData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MarketplaceSubscriptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMachineLearningLabelingJobData(document.RootElement, options); + return DeserializeMarketplaceSubscriptionData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MachineLearningLabelingJobData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionData.cs similarity index 79% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobData.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionData.cs index 57bba6be68773..d1090441f2626 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.MachineLearning { /// - /// A class representing the MachineLearningLabelingJob data model. + /// A class representing the MarketplaceSubscription data model. /// Azure Resource Manager resource envelope. /// - public partial class MachineLearningLabelingJobData : ResourceData + public partial class MarketplaceSubscriptionData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,35 +51,35 @@ public partial class MachineLearningLabelingJobData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// [Required] Additional attributes of the entity. /// is null. - public MachineLearningLabelingJobData(LabelingJobProperties properties) + public MarketplaceSubscriptionData(MarketplaceSubscriptionProperties properties) { Argument.AssertNotNull(properties, nameof(properties)); Properties = properties; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// [Required] Additional attributes of the entity. /// Keeps track of any properties unknown to the library. - internal MachineLearningLabelingJobData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, LabelingJobProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal MarketplaceSubscriptionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MarketplaceSubscriptionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal MachineLearningLabelingJobData() + /// Initializes a new instance of for deserialization. + internal MarketplaceSubscriptionData() { } /// [Required] Additional attributes of the entity. - public LabelingJobProperties Properties { get; set; } + public MarketplaceSubscriptionProperties Properties { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.Serialization.cs new file mode 100644 index 0000000000000..129893722053a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class MarketplaceSubscriptionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MarketplaceSubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MarketplaceSubscriptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.cs new file mode 100644 index 0000000000000..055ef0d1c33b5 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a MarketplaceSubscription along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMarketplaceSubscriptionResource method. + /// Otherwise you can get one from its parent resource using the GetMarketplaceSubscription method. + /// + public partial class MarketplaceSubscriptionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The name. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _marketplaceSubscriptionClientDiagnostics; + private readonly MarketplaceSubscriptionsRestOperations _marketplaceSubscriptionRestClient; + private readonly MarketplaceSubscriptionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/marketplaceSubscriptions"; + + /// Initializes a new instance of the class for mocking. + protected MarketplaceSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MarketplaceSubscriptionResource(ArmClient client, MarketplaceSubscriptionData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MarketplaceSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _marketplaceSubscriptionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string marketplaceSubscriptionApiVersion); + _marketplaceSubscriptionRestClient = new MarketplaceSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, marketplaceSubscriptionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MarketplaceSubscriptionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionResource.Get"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MarketplaceSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionResource.Get"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MarketplaceSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Marketplace Subscription (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionResource.Delete"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_marketplaceSubscriptionClientDiagnostics, Pipeline, _marketplaceSubscriptionRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Marketplace Subscription (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionResource.Delete"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_marketplaceSubscriptionClientDiagnostics, Pipeline, _marketplaceSubscriptionRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Marketplace Subscription (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Marketplace Subscription entity to apply during operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MarketplaceSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionResource.Update"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new MarketplaceSubscriptionOperationSource(Client), _marketplaceSubscriptionClientDiagnostics, Pipeline, _marketplaceSubscriptionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Marketplace Subscription (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Marketplace Subscription entity to apply during operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MarketplaceSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionResource.Update"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new MarketplaceSubscriptionOperationSource(Client), _marketplaceSubscriptionClientDiagnostics, Pipeline, _marketplaceSubscriptionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.Serialization.cs new file mode 100644 index 0000000000000..b42ef8374b1c7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AadAuthTypeWorkspaceConnectionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AadAuthTypeWorkspaceConnectionProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("authType"u8); + writer.WriteStringValue(AuthType.ToString()); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(ExpiryOn)) + { + writer.WritePropertyName("expiryTime"u8); + writer.WriteStringValue(ExpiryOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AadAuthTypeWorkspaceConnectionProperties 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(AadAuthTypeWorkspaceConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAadAuthTypeWorkspaceConnectionProperties(document.RootElement, options); + } + + internal static AadAuthTypeWorkspaceConnectionProperties DeserializeAadAuthTypeWorkspaceConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MachineLearningConnectionAuthType authType = default; + MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authType"u8)) + { + authType = new MachineLearningConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new MachineLearningConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AadAuthTypeWorkspaceConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AadAuthTypeWorkspaceConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + AadAuthTypeWorkspaceConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAadAuthTypeWorkspaceConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AadAuthTypeWorkspaceConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.cs new file mode 100644 index 0000000000000..289ac575a90b7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// This connection type covers the AAD auth for any applicable Azure service. + public partial class AadAuthTypeWorkspaceConnectionProperties : MachineLearningWorkspaceConnectionProperties + { + /// Initializes a new instance of . + public AadAuthTypeWorkspaceConnectionProperties() + { + AuthType = MachineLearningConnectionAuthType.Aad; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal AadAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + AuthType = authType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs index 9f9c349491773..c3cee5f528c32 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write(Utf8JsonWr writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess WorkspaceConnectionAccessKey credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess return new AccessKeyAuthTypeWorkspaceConnectionProperties( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.cs index d716f8bfb5cc6..3ad0c6a0718ba 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,12 +23,20 @@ public AccessKeyAuthTypeWorkspaceConnectionProperties() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// - internal AccessKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, WorkspaceConnectionAccessKey credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal AccessKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionAccessKey credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.Serialization.cs similarity index 60% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.Serialization.cs index 8301b71e96918..bd95d002cfea6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.Serialization.cs @@ -13,30 +13,28 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class PartialJobBase : IUtf8JsonSerializable, IJsonModel + public partial class AccountApiKeys : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PartialJobBase)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AccountApiKeys)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(NotificationSetting)) + if (Optional.IsDefined(Key1)) { - if (NotificationSetting != null) - { - writer.WritePropertyName("notificationSetting"u8); - writer.WriteObjectValue(NotificationSetting, options); - } - else - { - writer.WriteNull("notificationSetting"); - } + writer.WritePropertyName("key1"u8); + writer.WriteStringValue(Key1); + } + if (Optional.IsDefined(Key2)) + { + writer.WritePropertyName("key2"u8); + writer.WriteStringValue(Key2); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -56,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp writer.WriteEndObject(); } - PartialJobBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AccountApiKeys IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PartialJobBase)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AccountApiKeys)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePartialJobBase(document.RootElement, options); + return DeserializeAccountApiKeys(document.RootElement, options); } - internal static PartialJobBase DeserializePartialJobBase(JsonElement element, ModelReaderWriterOptions options = null) + internal static AccountApiKeys DeserializeAccountApiKeys(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,19 +74,20 @@ internal static PartialJobBase DeserializePartialJobBase(JsonElement element, Mo { return null; } - PartialNotificationSetting notificationSetting = default; + string key1 = default; + string key2 = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("notificationSetting"u8)) + if (property.NameEquals("key1"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - notificationSetting = null; - continue; - } - notificationSetting = PartialNotificationSetting.DeserializePartialNotificationSetting(property.Value, options); + key1 = property.Value.GetString(); + continue; + } + if (property.NameEquals("key2"u8)) + { + key2 = property.Value.GetString(); continue; } if (options.Format != "W") @@ -97,38 +96,38 @@ internal static PartialJobBase DeserializePartialJobBase(JsonElement element, Mo } } serializedAdditionalRawData = rawDataDictionary; - return new PartialJobBase(notificationSetting, serializedAdditionalRawData); + return new AccountApiKeys(key1, key2, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PartialJobBase)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AccountApiKeys)} does not support writing '{options.Format}' format."); } } - PartialJobBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AccountApiKeys IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePartialJobBase(document.RootElement, options); + return DeserializeAccountApiKeys(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PartialJobBase)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AccountApiKeys)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteSetting.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs similarity index 71% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteSetting.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs index e04ee3590fa62..cb65f77cb4ff7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteSetting.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// The AutoDeleteSetting. - public partial class AutoDeleteSetting + /// The AccountApiKeys. + public partial class AccountApiKeys { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,25 @@ public partial class AutoDeleteSetting /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public AutoDeleteSetting() + /// Initializes a new instance of . + internal AccountApiKeys() { } - /// Initializes a new instance of . - /// When to check if an asset is expired. - /// Expiration condition value. + /// Initializes a new instance of . + /// + /// /// Keeps track of any properties unknown to the library. - internal AutoDeleteSetting(AutoDeleteCondition? condition, string value, IDictionary serializedAdditionalRawData) + internal AccountApiKeys(string key1, string key2, IDictionary serializedAdditionalRawData) { - Condition = condition; - Value = value; + Key1 = key1; + Key2 = key2; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// When to check if an asset is expired. - public AutoDeleteCondition? Condition { get; set; } - /// Expiration condition value. - public string Value { get; set; } + /// Gets the key 1. + public string Key1 { get; } + /// Gets the key 2. + public string Key2 { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs new file mode 100644 index 0000000000000..a0ec034812f77 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AccountKeyAuthTypeWorkspaceConnectionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountKeyAuthTypeWorkspaceConnectionProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + writer.WritePropertyName("authType"u8); + writer.WriteStringValue(AuthType.ToString()); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(ExpiryOn)) + { + writer.WritePropertyName("expiryTime"u8); + writer.WriteStringValue(ExpiryOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AccountKeyAuthTypeWorkspaceConnectionProperties 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(AccountKeyAuthTypeWorkspaceConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccountKeyAuthTypeWorkspaceConnectionProperties(document.RootElement, options); + } + + internal static AccountKeyAuthTypeWorkspaceConnectionProperties DeserializeAccountKeyAuthTypeWorkspaceConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WorkspaceConnectionAccountKey credentials = default; + MachineLearningConnectionAuthType authType = default; + MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = WorkspaceConnectionAccountKey.DeserializeWorkspaceConnectionAccountKey(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new MachineLearningConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new MachineLearningConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccountKeyAuthTypeWorkspaceConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AccountKeyAuthTypeWorkspaceConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + AccountKeyAuthTypeWorkspaceConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAccountKeyAuthTypeWorkspaceConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccountKeyAuthTypeWorkspaceConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.cs new file mode 100644 index 0000000000000..112aa7fecd584 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// This connection type covers the account key connection for Azure storage. + public partial class AccountKeyAuthTypeWorkspaceConnectionProperties : MachineLearningWorkspaceConnectionProperties + { + /// Initializes a new instance of . + public AccountKeyAuthTypeWorkspaceConnectionProperties() + { + AuthType = MachineLearningConnectionAuthType.AccountKey; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// Account key object for workspace connection credential. + internal AccountKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionAccountKey credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// Account key object for workspace connection credential. + internal WorkspaceConnectionAccountKey Credentials { get; set; } + /// Gets or sets the credentials key. + public string CredentialsKey + { + get => Credentials is null ? default : Credentials.Key; + set + { + if (Credentials is null) + Credentials = new WorkspaceConnectionAccountKey(); + Credentials.Key = value; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AllowedContentLevel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AllowedContentLevel.cs new file mode 100644 index 0000000000000..198e01da20db7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AllowedContentLevel.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Level at which content is filtered. + public readonly partial struct AllowedContentLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AllowedContentLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LowValue = "Low"; + private const string MediumValue = "Medium"; + private const string HighValue = "High"; + + /// Low. + public static AllowedContentLevel Low { get; } = new AllowedContentLevel(LowValue); + /// Medium. + public static AllowedContentLevel Medium { get; } = new AllowedContentLevel(MediumValue); + /// High. + public static AllowedContentLevel High { get; } = new AllowedContentLevel(HighValue); + /// Determines if two values are the same. + public static bool operator ==(AllowedContentLevel left, AllowedContentLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AllowedContentLevel left, AllowedContentLevel right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AllowedContentLevel(string value) => new AllowedContentLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AllowedContentLevel other && Equals(other); + /// + public bool Equals(AllowedContentLevel 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AmlTokenComputeIdentity.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AmlTokenComputeIdentity.cs index 10f2992e63d92..96c37b9a6f124 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AmlTokenComputeIdentity.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AmlTokenComputeIdentity.cs @@ -20,7 +20,7 @@ public AmlTokenComputeIdentity() } /// Initializes a new instance of . - /// [Required] Monitor compute identity type enum. + /// [Required] Specifies the type of identity to use within the monitoring jobs. /// Keeps track of any properties unknown to the library. internal AmlTokenComputeIdentity(MonitorComputeIdentityType computeIdentityType, IDictionary serializedAdditionalRawData) : base(computeIdentityType, serializedAdditionalRawData) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs new file mode 100644 index 0000000000000..9350d73c2fe37 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AnonymousAccessCredential : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnonymousAccessCredential)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AnonymousAccessCredential 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(AnonymousAccessCredential)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAnonymousAccessCredential(document.RootElement, options); + } + + internal static AnonymousAccessCredential DeserializeAnonymousAccessCredential(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReferenceCredentialType credentialType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentialType"u8)) + { + credentialType = new DataReferenceCredentialType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AnonymousAccessCredential(credentialType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AnonymousAccessCredential)} does not support writing '{options.Format}' format."); + } + } + + AnonymousAccessCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAnonymousAccessCredential(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AnonymousAccessCredential)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.cs new file mode 100644 index 0000000000000..f9d10cdb7fe7d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.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 Azure.ResourceManager.MachineLearning.Models +{ + /// Access credential with no credentials. + public partial class AnonymousAccessCredential : DataReferenceCredential + { + /// Initializes a new instance of . + internal AnonymousAccessCredential() + { + CredentialType = DataReferenceCredentialType.NoCredentials; + } + + /// Initializes a new instance of . + /// [Required] Credential type used to authentication with storage. + /// Keeps track of any properties unknown to the library. + internal AnonymousAccessCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData) : base(credentialType, serializedAdditionalRawData) + { + CredentialType = credentialType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.Serialization.cs index 1e901da2c0636..b7068ace607d1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor WorkspaceConnectionApiKey credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor return new ApiKeyAuthWorkspaceConnectionProperties( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.cs index be28e7c1bf475..4f69eac4a31b4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -43,12 +44,20 @@ public ApiKeyAuthWorkspaceConnectionProperties() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// Api key object for workspace connection credential. - internal ApiKeyAuthWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, WorkspaceConnectionApiKey credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal ApiKeyAuthWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionApiKey credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteCondition.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteCondition.cs deleted file mode 100644 index 141f335a29614..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteCondition.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The AutoDeleteCondition. - public readonly partial struct AutoDeleteCondition : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AutoDeleteCondition(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CreatedGreaterThanValue = "CreatedGreaterThan"; - private const string LastAccessedGreaterThanValue = "LastAccessedGreaterThan"; - - /// CreatedGreaterThan. - public static AutoDeleteCondition CreatedGreaterThan { get; } = new AutoDeleteCondition(CreatedGreaterThanValue); - /// LastAccessedGreaterThan. - public static AutoDeleteCondition LastAccessedGreaterThan { get; } = new AutoDeleteCondition(LastAccessedGreaterThanValue); - /// Determines if two values are the same. - public static bool operator ==(AutoDeleteCondition left, AutoDeleteCondition right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AutoDeleteCondition left, AutoDeleteCondition right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AutoDeleteCondition(string value) => new AutoDeleteCondition(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AutoDeleteCondition other && Equals(other); - /// - public bool Equals(AutoDeleteCondition 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.Serialization.cs index 2b01dd4816b68..5b388ec699c1f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.Serialization.cs @@ -165,24 +165,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -306,7 +288,6 @@ internal static AutoMLJob DeserializeAutoMLJob(JsonElement element, ModelReaderW bool? isArchived = default; JobType jobType = default; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -449,21 +430,6 @@ internal static AutoMLJob DeserializeAutoMLJob(JsonElement element, ModelReaderW notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -547,7 +513,6 @@ internal static AutoMLJob DeserializeAutoMLJob(JsonElement element, ModelReaderW isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status, environmentId, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.cs index 4e9eaa9ccd7c5..eb048bcfbc038 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.cs @@ -53,7 +53,6 @@ public AutoMLJob(AutoMLVertical taskDetails) /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -76,7 +75,7 @@ public AutoMLJob(AutoMLVertical taskDetails) /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , , , , , and . /// - internal AutoMLJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status, string environmentId, IDictionary environmentVariables, IDictionary outputs, JobQueueSettings queueSettings, MachineLearningJobResourceConfiguration resources, AutoMLVertical taskDetails) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) + internal AutoMLJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, string environmentId, IDictionary environmentVariables, IDictionary outputs, JobQueueSettings queueSettings, MachineLearningJobResourceConfiguration resources, AutoMLVertical taskDetails) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) { EnvironmentId = environmentId; EnvironmentVariables = environmentVariables; @@ -106,7 +105,19 @@ internal AutoMLJob() /// public IDictionary Outputs { get; set; } /// Queue settings for the job. - public JobQueueSettings QueueSettings { get; set; } + internal JobQueueSettings QueueSettings { get; set; } + /// Controls the compute job tier. + public JobTier? QueueJobTier + { + get => QueueSettings is null ? default : QueueSettings.JobTier; + set + { + if (QueueSettings is null) + QueueSettings = new JobQueueSettings(); + QueueSettings.JobTier = value; + } + } + /// Compute Resource configuration for the job. public MachineLearningJobResourceConfiguration Resources { get; set; } /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.Serialization.cs index aa22e4716acf7..565c40c815909 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.Serialization.cs @@ -72,18 +72,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteNull("featurizationSettings"); } } - if (Optional.IsDefined(FixedParameters)) - { - if (FixedParameters != null) - { - writer.WritePropertyName("fixedParameters"u8); - writer.WriteObjectValue(FixedParameters, options); - } - else - { - writer.WriteNull("fixedParameters"); - } - } if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -108,35 +96,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteNull("nCrossValidations"); } } - if (Optional.IsCollectionDefined(SearchSpace)) - { - if (SearchSpace != null) - { - writer.WritePropertyName("searchSpace"u8); - writer.WriteStartArray(); - foreach (var item in SearchSpace) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("searchSpace"); - } - } - if (Optional.IsDefined(SweepSettings)) - { - if (SweepSettings != null) - { - writer.WritePropertyName("sweepSettings"u8); - writer.WriteObjectValue(SweepSettings, options); - } - else - { - writer.WriteNull("sweepSettings"); - } - } if (Optional.IsDefined(TestData)) { if (TestData != null) @@ -260,11 +219,8 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso RegressionTrainingSettings trainingSettings = default; IList cvSplitColumnNames = default; TableVerticalFeaturizationSettings featurizationSettings = default; - TableFixedParameters fixedParameters = default; TableVerticalLimitSettings limitSettings = default; NCrossValidations nCrossValidations = default; - IList searchSpace = default; - TableSweepSettings sweepSettings = default; MachineLearningTableJobInput testData = default; double? testDataSize = default; MachineLearningTableJobInput validationData = default; @@ -322,16 +278,6 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso featurizationSettings = TableVerticalFeaturizationSettings.DeserializeTableVerticalFeaturizationSettings(property.Value, options); continue; } - if (property.NameEquals("fixedParameters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fixedParameters = null; - continue; - } - fixedParameters = TableFixedParameters.DeserializeTableFixedParameters(property.Value, options); - continue; - } if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -352,31 +298,6 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso nCrossValidations = NCrossValidations.DeserializeNCrossValidations(property.Value, options); continue; } - if (property.NameEquals("searchSpace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchSpace = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TableParameterSubspace.DeserializeTableParameterSubspace(item, options)); - } - searchSpace = array; - continue; - } - if (property.NameEquals("sweepSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sweepSettings = null; - continue; - } - sweepSettings = TableSweepSettings.DeserializeTableSweepSettings(property.Value, options); - continue; - } if (property.NameEquals("testData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -472,11 +393,8 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso trainingSettings, cvSplitColumnNames ?? new ChangeTrackingList(), featurizationSettings, - fixedParameters, limitSettings, nCrossValidations, - searchSpace ?? new ChangeTrackingList(), - sweepSettings, testData, testDataSize, validationData, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.cs index 15a8942eec1ae..0dbc63809cd91 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.cs @@ -21,7 +21,6 @@ public AutoMLVerticalRegression(MachineLearningTableJobInput trainingData) : bas Argument.AssertNotNull(trainingData, nameof(trainingData)); CvSplitColumnNames = new ChangeTrackingList(); - SearchSpace = new ChangeTrackingList(); TaskType = TaskType.Regression; } @@ -38,7 +37,6 @@ public AutoMLVerticalRegression(MachineLearningTableJobInput trainingData) : bas /// Inputs for training phase for an AutoML Job. /// Columns to use for CVSplit data. /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. /// /// Number of cross validation folds to be applied on training dataset @@ -46,8 +44,6 @@ public AutoMLVerticalRegression(MachineLearningTableJobInput trainingData) : bas /// 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 . /// - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Test data input. /// /// The fraction of test dataset that needs to be set aside for validation purpose. @@ -61,17 +57,14 @@ public AutoMLVerticalRegression(MachineLearningTableJobInput trainingData) : bas /// Applied when validation dataset is not provided. /// /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. - internal AutoMLVerticalRegression(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, AutoMLVerticalRegressionPrimaryMetric? primaryMetric, RegressionTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableFixedParameters fixedParameters, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, IList searchSpace, TableSweepSettings sweepSettings, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + internal AutoMLVerticalRegression(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, AutoMLVerticalRegressionPrimaryMetric? primaryMetric, RegressionTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) { PrimaryMetric = primaryMetric; TrainingSettings = trainingSettings; CvSplitColumnNames = cvSplitColumnNames; FeaturizationSettings = featurizationSettings; - FixedParameters = fixedParameters; LimitSettings = limitSettings; NCrossValidations = nCrossValidations; - SearchSpace = searchSpace; - SweepSettings = sweepSettings; TestData = testData; TestDataSize = testDataSize; ValidationData = validationData; @@ -93,8 +86,6 @@ internal AutoMLVerticalRegression() public IList CvSplitColumnNames { get; set; } /// Featurization inputs needed for AutoML job. public TableVerticalFeaturizationSettings FeaturizationSettings { get; set; } - /// Model/training parameters that will remain constant throughout training. - public TableFixedParameters FixedParameters { get; set; } /// Execution constraints for AutoMLJob. public TableVerticalLimitSettings LimitSettings { get; set; } /// @@ -104,10 +95,6 @@ internal AutoMLVerticalRegression() /// The available derived classes include and . /// public NCrossValidations NCrossValidations { get; set; } - /// Search space for sampling different combinations of models and their hyperparameters. - public IList SearchSpace { get; set; } - /// Settings for model sweeping and hyperparameter tuning. - public TableSweepSettings SweepSettings { get; set; } /// Test data input. public MachineLearningTableJobInput TestData { get; set; } /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegressionModel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegressionModel.cs index 7788e7a8a1f11..aa5310e7985e4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegressionModel.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegressionModel.cs @@ -57,7 +57,7 @@ public AutoMLVerticalRegressionModel(string value) public static AutoMLVerticalRegressionModel SGD { get; } = new AutoMLVerticalRegressionModel(SGDValue); /// /// Random forest is a supervised learning algorithm. - /// The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging method. + /// The "forest" it builds, is an ensemble of decision trees, usually trained with the “bagging” method. /// The general idea of the bagging method is that a combination of learning models increases the overall result. /// public static AutoMLVerticalRegressionModel RandomForest { get; } = new AutoMLVerticalRegressionModel(RandomForestValue); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.Serialization.cs deleted file mode 100644 index 8f3984ae96eb3..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.Serialization.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class AzMonMonitoringAlertNotificationSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzMonMonitoringAlertNotificationSettings)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("alertNotificationType"u8); - writer.WriteStringValue(AlertNotificationType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AzMonMonitoringAlertNotificationSettings 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(AzMonMonitoringAlertNotificationSettings)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzMonMonitoringAlertNotificationSettings(document.RootElement, options); - } - - internal static AzMonMonitoringAlertNotificationSettings DeserializeAzMonMonitoringAlertNotificationSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MonitoringAlertNotificationType alertNotificationType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("alertNotificationType"u8)) - { - alertNotificationType = new MonitoringAlertNotificationType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AzMonMonitoringAlertNotificationSettings(alertNotificationType, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AzMonMonitoringAlertNotificationSettings)} does not support writing '{options.Format}' format."); - } - } - - AzMonMonitoringAlertNotificationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzMonMonitoringAlertNotificationSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AzMonMonitoringAlertNotificationSettings)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.cs deleted file mode 100644 index f96f63f1c29ef..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The AzMonMonitoringAlertNotificationSettings. - public partial class AzMonMonitoringAlertNotificationSettings : MonitoringAlertNotificationSettingsBase - { - /// Initializes a new instance of . - public AzMonMonitoringAlertNotificationSettings() - { - AlertNotificationType = MonitoringAlertNotificationType.AzureMonitor; - } - - /// Initializes a new instance of . - /// [Required] Specifies the type of signal to monitor. - /// Keeps track of any properties unknown to the library. - internal AzMonMonitoringAlertNotificationSettings(MonitoringAlertNotificationType alertNotificationType, IDictionary serializedAdditionalRawData) : base(alertNotificationType, serializedAdditionalRawData) - { - AlertNotificationType = alertNotificationType; - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.cs deleted file mode 100644 index c0f3d1e49ed8c..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Azure ML batch inferencing server configurations. - public partial class AzureMLBatchInferencingServer : InferencingServer - { - /// Initializes a new instance of . - public AzureMLBatchInferencingServer() - { - ServerType = InferencingServerType.AzureMLBatch; - } - - /// Initializes a new instance of . - /// [Required] Inferencing server type for various targets. - /// Keeps track of any properties unknown to the library. - /// Code configuration for AML batch inferencing server. - internal AzureMLBatchInferencingServer(InferencingServerType serverType, IDictionary serializedAdditionalRawData, MachineLearningCodeConfiguration codeConfiguration) : base(serverType, serializedAdditionalRawData) - { - CodeConfiguration = codeConfiguration; - ServerType = serverType; - } - - /// Code configuration for AML batch inferencing server. - public MachineLearningCodeConfiguration CodeConfiguration { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.cs deleted file mode 100644 index 0015f874a6bc2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Azure ML online inferencing configurations. - public partial class AzureMLOnlineInferencingServer : InferencingServer - { - /// Initializes a new instance of . - public AzureMLOnlineInferencingServer() - { - ServerType = InferencingServerType.AzureMLOnline; - } - - /// Initializes a new instance of . - /// [Required] Inferencing server type for various targets. - /// Keeps track of any properties unknown to the library. - /// Code configuration for AML inferencing server. - internal AzureMLOnlineInferencingServer(InferencingServerType serverType, IDictionary serializedAdditionalRawData, MachineLearningCodeConfiguration codeConfiguration) : base(serverType, serializedAdditionalRawData) - { - CodeConfiguration = codeConfiguration; - ServerType = serverType; - } - - /// Code configuration for AML inferencing server. - public MachineLearningCodeConfiguration CodeConfiguration { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.Serialization.cs new file mode 100644 index 0000000000000..bba503c1bbb18 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AzureOpenAiFineTuning : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAiFineTuning)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(HyperParameters)) + { + if (HyperParameters != null) + { + writer.WritePropertyName("hyperParameters"u8); + writer.WriteObjectValue(HyperParameters, options); + } + else + { + writer.WriteNull("hyperParameters"); + } + } + writer.WritePropertyName("modelProvider"u8); + writer.WriteStringValue(ModelProvider.ToString()); + writer.WritePropertyName("taskType"u8); + writer.WriteStringValue(TaskType.ToString()); + writer.WritePropertyName("trainingData"u8); + writer.WriteObjectValue(TrainingData, options); + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AzureOpenAiFineTuning 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(AzureOpenAiFineTuning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOpenAiFineTuning(document.RootElement, options); + } + + internal static AzureOpenAiFineTuning DeserializeAzureOpenAiFineTuning(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureOpenAiHyperParameters hyperParameters = default; + ModelProvider modelProvider = default; + FineTuningTaskType taskType = default; + MachineLearningJobInput trainingData = default; + MachineLearningJobInput validationData = default; + MachineLearningFlowModelJobInput model = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + hyperParameters = null; + continue; + } + hyperParameters = AzureOpenAiHyperParameters.DeserializeAzureOpenAiHyperParameters(property.Value, options); + continue; + } + if (property.NameEquals("modelProvider"u8)) + { + modelProvider = new ModelProvider(property.Value.GetString()); + continue; + } + if (property.NameEquals("taskType"u8)) + { + taskType = new FineTuningTaskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingData"u8)) + { + trainingData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("validationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationData = null; + continue; + } + validationData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("model"u8)) + { + model = MachineLearningFlowModelJobInput.DeserializeMachineLearningFlowModelJobInput(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOpenAiFineTuning( + modelProvider, + taskType, + trainingData, + validationData, + model, + serializedAdditionalRawData, + hyperParameters); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOpenAiFineTuning)} does not support writing '{options.Format}' format."); + } + } + + AzureOpenAiFineTuning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureOpenAiFineTuning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOpenAiFineTuning)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.cs new file mode 100644 index 0000000000000..010bba8b688ab --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The AzureOpenAiFineTuning. + public partial class AzureOpenAiFineTuning : FineTuningVertical + { + /// Initializes a new instance of . + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// 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 . + /// + /// [Required] Input model for fine tuning. + /// or is null. + public AzureOpenAiFineTuning(FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningFlowModelJobInput model) : base(taskType, trainingData, model) + { + Argument.AssertNotNull(trainingData, nameof(trainingData)); + Argument.AssertNotNull(model, nameof(model)); + + ModelProvider = ModelProvider.AzureOpenAI; + } + + /// Initializes a new instance of . + /// [Required] Enum to determine the type of fine tuning. + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// 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 . + /// + /// + /// Validation data for fine tuning. + /// 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 . + /// + /// [Required] Input model for fine tuning. + /// Keeps track of any properties unknown to the library. + /// HyperParameters for fine tuning Azure Open AI model. + internal AzureOpenAiFineTuning(ModelProvider modelProvider, FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningJobInput validationData, MachineLearningFlowModelJobInput model, IDictionary serializedAdditionalRawData, AzureOpenAiHyperParameters hyperParameters) : base(modelProvider, taskType, trainingData, validationData, model, serializedAdditionalRawData) + { + HyperParameters = hyperParameters; + ModelProvider = modelProvider; + } + + /// Initializes a new instance of for deserialization. + internal AzureOpenAiFineTuning() + { + } + + /// HyperParameters for fine tuning Azure Open AI model. + public AzureOpenAiHyperParameters HyperParameters { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.Serialization.cs new file mode 100644 index 0000000000000..17269dbe9ec47 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AzureOpenAiHyperParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAiHyperParameters)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(LearningRateMultiplier)) + { + if (LearningRateMultiplier != null) + { + writer.WritePropertyName("learningRateMultiplier"u8); + writer.WriteNumberValue(LearningRateMultiplier.Value); + } + else + { + writer.WriteNull("learningRateMultiplier"); + } + } + if (Optional.IsDefined(BatchSize)) + { + if (BatchSize != null) + { + writer.WritePropertyName("batchSize"u8); + writer.WriteNumberValue(BatchSize.Value); + } + else + { + writer.WriteNull("batchSize"); + } + } + if (Optional.IsDefined(NEpochs)) + { + if (NEpochs != null) + { + writer.WritePropertyName("nEpochs"u8); + writer.WriteNumberValue(NEpochs.Value); + } + else + { + writer.WriteNull("nEpochs"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AzureOpenAiHyperParameters 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(AzureOpenAiHyperParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOpenAiHyperParameters(document.RootElement, options); + } + + internal static AzureOpenAiHyperParameters DeserializeAzureOpenAiHyperParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double? learningRateMultiplier = default; + int? batchSize = default; + int? nEpochs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("learningRateMultiplier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + learningRateMultiplier = null; + continue; + } + learningRateMultiplier = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("batchSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + batchSize = null; + continue; + } + batchSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nEpochs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + nEpochs = null; + continue; + } + nEpochs = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOpenAiHyperParameters(learningRateMultiplier, batchSize, nEpochs, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOpenAiHyperParameters)} does not support writing '{options.Format}' format."); + } + } + + AzureOpenAiHyperParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureOpenAiHyperParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOpenAiHyperParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.cs new file mode 100644 index 0000000000000..e86aa76fc6be7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure Open AI hyperparameters for fine tuning. + public partial class AzureOpenAiHyperParameters + { + /// + /// 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 . + public AzureOpenAiHyperParameters() + { + } + + /// Initializes a new instance of . + /// Scaling factor for the learning rate. A smaller learning rate may be useful to avoid over fitting. + /// Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + /// The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + /// Keeps track of any properties unknown to the library. + internal AzureOpenAiHyperParameters(double? learningRateMultiplier, int? batchSize, int? nEpochs, IDictionary serializedAdditionalRawData) + { + LearningRateMultiplier = learningRateMultiplier; + BatchSize = batchSize; + NEpochs = nEpochs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Scaling factor for the learning rate. A smaller learning rate may be useful to avoid over fitting. + public double? LearningRateMultiplier { get; set; } + /// Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + public int? BatchSize { get; set; } + /// The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + public int? NEpochs { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.Serialization.cs deleted file mode 100644 index a78b73d62c722..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.Serialization.cs +++ /dev/null @@ -1,110 +0,0 @@ -// 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.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownBaseEnvironmentSource))] - public partial class BaseEnvironmentSource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("baseEnvironmentSourceType"u8); - writer.WriteStringValue(BaseEnvironmentSourceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - BaseEnvironmentSource 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(BaseEnvironmentSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBaseEnvironmentSource(document.RootElement, options); - } - - internal static BaseEnvironmentSource DeserializeBaseEnvironmentSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("baseEnvironmentSourceType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "EnvironmentAsset": return BaseEnvironmentType.DeserializeBaseEnvironmentType(element, options); - } - } - return UnknownBaseEnvironmentSource.DeserializeUnknownBaseEnvironmentSource(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); - default: - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support writing '{options.Format}' format."); - } - } - - BaseEnvironmentSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBaseEnvironmentSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.cs deleted file mode 100644 index a4569bd0bb2d9..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// - /// 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 . - /// - public abstract partial class BaseEnvironmentSource - { - /// - /// 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 BaseEnvironmentSource() - { - } - - /// Initializes a new instance of . - /// [Required] Base environment type. - /// Keeps track of any properties unknown to the library. - internal BaseEnvironmentSource(BaseEnvironmentSourceType baseEnvironmentSourceType, IDictionary serializedAdditionalRawData) - { - BaseEnvironmentSourceType = baseEnvironmentSourceType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// [Required] Base environment type. - internal BaseEnvironmentSourceType BaseEnvironmentSourceType { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSourceType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSourceType.cs deleted file mode 100644 index f87bd297d3e3e..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSourceType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Base environment type. - internal readonly partial struct BaseEnvironmentSourceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public BaseEnvironmentSourceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnvironmentAssetValue = "EnvironmentAsset"; - - /// EnvironmentAsset. - public static BaseEnvironmentSourceType EnvironmentAsset { get; } = new BaseEnvironmentSourceType(EnvironmentAssetValue); - /// Determines if two values are the same. - public static bool operator ==(BaseEnvironmentSourceType left, BaseEnvironmentSourceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(BaseEnvironmentSourceType left, BaseEnvironmentSourceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator BaseEnvironmentSourceType(string value) => new BaseEnvironmentSourceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is BaseEnvironmentSourceType other && Equals(other); - /// - public bool Equals(BaseEnvironmentSourceType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.Serialization.cs deleted file mode 100644 index 16edb0ec928a5..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class BaseEnvironmentType : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BaseEnvironmentType)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("resourceId"u8); - writer.WriteStringValue(ResourceId); - writer.WritePropertyName("baseEnvironmentSourceType"u8); - writer.WriteStringValue(BaseEnvironmentSourceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - BaseEnvironmentType 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(BaseEnvironmentType)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBaseEnvironmentType(document.RootElement, options); - } - - internal static BaseEnvironmentType DeserializeBaseEnvironmentType(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier resourceId = default; - BaseEnvironmentSourceType baseEnvironmentSourceType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("resourceId"u8)) - { - resourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("baseEnvironmentSourceType"u8)) - { - baseEnvironmentSourceType = new BaseEnvironmentSourceType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new BaseEnvironmentType(baseEnvironmentSourceType, serializedAdditionalRawData, resourceId); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(BaseEnvironmentType)} does not support writing '{options.Format}' format."); - } - } - - BaseEnvironmentType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBaseEnvironmentType(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(BaseEnvironmentType)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.cs deleted file mode 100644 index 334c4ebf008c3..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Base environment type. - public partial class BaseEnvironmentType : BaseEnvironmentSource - { - /// Initializes a new instance of . - /// [Required] Resource id accepting ArmId or AzureMlId. - /// is null. - public BaseEnvironmentType(ResourceIdentifier resourceId) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - ResourceId = resourceId; - BaseEnvironmentSourceType = BaseEnvironmentSourceType.EnvironmentAsset; - } - - /// Initializes a new instance of . - /// [Required] Base environment type. - /// Keeps track of any properties unknown to the library. - /// [Required] Resource id accepting ArmId or AzureMlId. - internal BaseEnvironmentType(BaseEnvironmentSourceType baseEnvironmentSourceType, IDictionary serializedAdditionalRawData, ResourceIdentifier resourceId) : base(baseEnvironmentSourceType, serializedAdditionalRawData) - { - ResourceId = resourceId; - BaseEnvironmentSourceType = baseEnvironmentSourceType; - } - - /// Initializes a new instance of for deserialization. - internal BaseEnvironmentType() - { - } - - /// [Required] Resource id accepting ArmId or AzureMlId. - public ResourceIdentifier ResourceId { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModel.cs index 843a27caf9b53..5a569a531dd8b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModel.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModel.cs @@ -78,7 +78,7 @@ public ClassificationModel(string value) public static ClassificationModel DecisionTree { get; } = new ClassificationModel(DecisionTreeValue); /// /// Random forest is a supervised learning algorithm. - /// The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging method. + /// The "forest" it builds, is an ensemble of decision trees, usually trained with the “bagging” method. /// The general idea of the bagging method is that a combination of learning models increases the overall result. /// public static ClassificationModel RandomForest { get; } = new ClassificationModel(RandomForestValue); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetric.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetric.cs deleted file mode 100644 index 46b681e987305..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetric.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The ClassificationModelPerformanceMetric. - public readonly partial struct ClassificationModelPerformanceMetric : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ClassificationModelPerformanceMetric(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AccuracyValue = "Accuracy"; - private const string PrecisionValue = "Precision"; - private const string RecallValue = "Recall"; - - /// Calculates the accuracy of the model predictions. - public static ClassificationModelPerformanceMetric Accuracy { get; } = new ClassificationModelPerformanceMetric(AccuracyValue); - /// Calculates the precision of the model predictions. - public static ClassificationModelPerformanceMetric Precision { get; } = new ClassificationModelPerformanceMetric(PrecisionValue); - /// Calculates the recall of the model predictions. - public static ClassificationModelPerformanceMetric Recall { get; } = new ClassificationModelPerformanceMetric(RecallValue); - /// Determines if two values are the same. - public static bool operator ==(ClassificationModelPerformanceMetric left, ClassificationModelPerformanceMetric right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ClassificationModelPerformanceMetric left, ClassificationModelPerformanceMetric right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ClassificationModelPerformanceMetric(string value) => new ClassificationModelPerformanceMetric(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ClassificationModelPerformanceMetric other && Equals(other); - /// - public bool Equals(ClassificationModelPerformanceMetric 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.Serialization.cs deleted file mode 100644 index 82ce87326fae2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.Serialization.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ClassificationModelPerformanceMetricThreshold : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ClassificationModelPerformanceMetricThreshold)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("metric"u8); - writer.WriteStringValue(Metric.ToString()); - writer.WritePropertyName("modelType"u8); - writer.WriteStringValue(ModelType.ToString()); - if (Optional.IsDefined(Threshold)) - { - if (Threshold != null) - { - writer.WritePropertyName("threshold"u8); - writer.WriteObjectValue(Threshold, options); - } - else - { - writer.WriteNull("threshold"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ClassificationModelPerformanceMetricThreshold 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(ClassificationModelPerformanceMetricThreshold)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeClassificationModelPerformanceMetricThreshold(document.RootElement, options); - } - - internal static ClassificationModelPerformanceMetricThreshold DeserializeClassificationModelPerformanceMetricThreshold(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ClassificationModelPerformanceMetric metric = default; - MonitoringModelType modelType = default; - MonitoringThreshold threshold = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metric"u8)) - { - metric = new ClassificationModelPerformanceMetric(property.Value.GetString()); - continue; - } - if (property.NameEquals("modelType"u8)) - { - modelType = new MonitoringModelType(property.Value.GetString()); - continue; - } - if (property.NameEquals("threshold"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - threshold = null; - continue; - } - threshold = MonitoringThreshold.DeserializeMonitoringThreshold(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ClassificationModelPerformanceMetricThreshold(modelType, threshold, serializedAdditionalRawData, metric); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ClassificationModelPerformanceMetricThreshold)} does not support writing '{options.Format}' format."); - } - } - - ClassificationModelPerformanceMetricThreshold IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeClassificationModelPerformanceMetricThreshold(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ClassificationModelPerformanceMetricThreshold)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.cs deleted file mode 100644 index 911371099c1e2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The ClassificationModelPerformanceMetricThreshold. - public partial class ClassificationModelPerformanceMetricThreshold : ModelPerformanceMetricThresholdBase - { - /// Initializes a new instance of . - /// [Required] The classification model performance to calculate. - public ClassificationModelPerformanceMetricThreshold(ClassificationModelPerformanceMetric metric) - { - Metric = metric; - ModelType = MonitoringModelType.Classification; - } - - /// Initializes a new instance of . - /// [Required] Specifies the data type of the metric threshold. - /// The threshold value. If null, a default value will be set depending on the selected metric. - /// Keeps track of any properties unknown to the library. - /// [Required] The classification model performance to calculate. - internal ClassificationModelPerformanceMetricThreshold(MonitoringModelType modelType, MonitoringThreshold threshold, IDictionary serializedAdditionalRawData, ClassificationModelPerformanceMetric metric) : base(modelType, threshold, serializedAdditionalRawData) - { - Metric = metric; - ModelType = modelType; - } - - /// Initializes a new instance of for deserialization. - internal ClassificationModelPerformanceMetricThreshold() - { - } - - /// [Required] The classification model performance to calculate. - public ClassificationModelPerformanceMetric Metric { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.Serialization.cs index 822c4b50339d3..0acf1eda328a3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.Serialization.cs @@ -84,18 +84,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("featurizationSettings"); } } - if (Optional.IsDefined(FixedParameters)) - { - if (FixedParameters != null) - { - writer.WritePropertyName("fixedParameters"u8); - writer.WriteObjectValue(FixedParameters, options); - } - else - { - writer.WriteNull("fixedParameters"); - } - } if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -120,35 +108,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("nCrossValidations"); } } - if (Optional.IsCollectionDefined(SearchSpace)) - { - if (SearchSpace != null) - { - writer.WritePropertyName("searchSpace"u8); - writer.WriteStartArray(); - foreach (var item in SearchSpace) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("searchSpace"); - } - } - if (Optional.IsDefined(SweepSettings)) - { - if (SweepSettings != null) - { - writer.WritePropertyName("sweepSettings"u8); - writer.WriteObjectValue(SweepSettings, options); - } - else - { - writer.WriteNull("sweepSettings"); - } - } if (Optional.IsDefined(TestData)) { if (TestData != null) @@ -273,11 +232,8 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele ClassificationTrainingSettings trainingSettings = default; IList cvSplitColumnNames = default; TableVerticalFeaturizationSettings featurizationSettings = default; - TableFixedParameters fixedParameters = default; TableVerticalLimitSettings limitSettings = default; NCrossValidations nCrossValidations = default; - IList searchSpace = default; - TableSweepSettings sweepSettings = default; MachineLearningTableJobInput testData = default; double? testDataSize = default; MachineLearningTableJobInput validationData = default; @@ -345,16 +301,6 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele featurizationSettings = TableVerticalFeaturizationSettings.DeserializeTableVerticalFeaturizationSettings(property.Value, options); continue; } - if (property.NameEquals("fixedParameters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fixedParameters = null; - continue; - } - fixedParameters = TableFixedParameters.DeserializeTableFixedParameters(property.Value, options); - continue; - } if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -375,31 +321,6 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele nCrossValidations = NCrossValidations.DeserializeNCrossValidations(property.Value, options); continue; } - if (property.NameEquals("searchSpace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchSpace = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TableParameterSubspace.DeserializeTableParameterSubspace(item, options)); - } - searchSpace = array; - continue; - } - if (property.NameEquals("sweepSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sweepSettings = null; - continue; - } - sweepSettings = TableSweepSettings.DeserializeTableSweepSettings(property.Value, options); - continue; - } if (property.NameEquals("testData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -496,11 +417,8 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele trainingSettings, cvSplitColumnNames ?? new ChangeTrackingList(), featurizationSettings, - fixedParameters, limitSettings, nCrossValidations, - searchSpace ?? new ChangeTrackingList(), - sweepSettings, testData, testDataSize, validationData, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.cs index 99051a32fd6bd..73f6d2ce3538e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.cs @@ -21,7 +21,6 @@ public ClassificationTask(MachineLearningTableJobInput trainingData) : base(trai Argument.AssertNotNull(trainingData, nameof(trainingData)); CvSplitColumnNames = new ChangeTrackingList(); - SearchSpace = new ChangeTrackingList(); TaskType = TaskType.Classification; } @@ -39,7 +38,6 @@ public ClassificationTask(MachineLearningTableJobInput trainingData) : base(trai /// Inputs for training phase for an AutoML Job. /// Columns to use for CVSplit data. /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. /// /// Number of cross validation folds to be applied on training dataset @@ -47,8 +45,6 @@ public ClassificationTask(MachineLearningTableJobInput trainingData) : base(trai /// 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 . /// - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Test data input. /// /// The fraction of test dataset that needs to be set aside for validation purpose. @@ -62,18 +58,15 @@ public ClassificationTask(MachineLearningTableJobInput trainingData) : base(trai /// Applied when validation dataset is not provided. /// /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. - internal ClassificationTask(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, string positiveLabel, ClassificationPrimaryMetric? primaryMetric, ClassificationTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableFixedParameters fixedParameters, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, IList searchSpace, TableSweepSettings sweepSettings, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + internal ClassificationTask(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, string positiveLabel, ClassificationPrimaryMetric? primaryMetric, ClassificationTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) { PositiveLabel = positiveLabel; PrimaryMetric = primaryMetric; TrainingSettings = trainingSettings; CvSplitColumnNames = cvSplitColumnNames; FeaturizationSettings = featurizationSettings; - FixedParameters = fixedParameters; LimitSettings = limitSettings; NCrossValidations = nCrossValidations; - SearchSpace = searchSpace; - SweepSettings = sweepSettings; TestData = testData; TestDataSize = testDataSize; ValidationData = validationData; @@ -97,8 +90,6 @@ internal ClassificationTask() public IList CvSplitColumnNames { get; set; } /// Featurization inputs needed for AutoML job. public TableVerticalFeaturizationSettings FeaturizationSettings { get; set; } - /// Model/training parameters that will remain constant throughout training. - public TableFixedParameters FixedParameters { get; set; } /// Execution constraints for AutoMLJob. public TableVerticalLimitSettings LimitSettings { get; set; } /// @@ -108,10 +99,6 @@ internal ClassificationTask() /// The available derived classes include and . /// public NCrossValidations NCrossValidations { get; set; } - /// Search space for sampling different combinations of models and their hyperparameters. - public IList SearchSpace { get; set; } - /// Settings for model sweeping and hyperparameter tuning. - public TableSweepSettings SweepSettings { get; set; } /// Test data input. public MachineLearningTableJobInput TestData { get; set; } /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.Serialization.cs index 5c999009fc225..c6958af3f6a0f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.Serialization.cs @@ -102,11 +102,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WriteNull("stackEnsembleSettings"); } } - if (Optional.IsDefined(TrainingMode)) - { - writer.WritePropertyName("trainingMode"u8); - writer.WriteStringValue(TrainingMode.Value.ToString()); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -154,7 +149,6 @@ internal static ClassificationTrainingSettings DeserializeClassificationTraining bool? enableVoteEnsemble = default; TimeSpan? ensembleModelDownloadTimeout = default; MachineLearningStackEnsembleSettings stackEnsembleSettings = default; - TrainingMode? trainingMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -253,15 +247,6 @@ internal static ClassificationTrainingSettings DeserializeClassificationTraining stackEnsembleSettings = MachineLearningStackEnsembleSettings.DeserializeMachineLearningStackEnsembleSettings(property.Value, options); continue; } - if (property.NameEquals("trainingMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - trainingMode = new TrainingMode(property.Value.GetString()); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -276,7 +261,6 @@ internal static ClassificationTrainingSettings DeserializeClassificationTraining enableVoteEnsemble, ensembleModelDownloadTimeout, stackEnsembleSettings, - trainingMode, serializedAdditionalRawData, allowedTrainingAlgorithms ?? new ChangeTrackingList(), blockedTrainingAlgorithms ?? new ChangeTrackingList()); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.cs index c638f2edd997b..a0646519ae840 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.cs @@ -31,15 +31,10 @@ public ClassificationTrainingSettings() /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// /// Stack ensemble settings for stack ensemble run. - /// - /// TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' for now, however in the future may result in mixed mode or heuristics based mode selection. Default is 'auto'. - /// If 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. - /// If 'NonDistributed' then only non distributed algorithms are chosen. - /// /// Keeps track of any properties unknown to the library. /// Allowed models for classification task. /// Blocked models for classification task. - internal ClassificationTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, TrainingMode? trainingMode, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, trainingMode, serializedAdditionalRawData) + internal ClassificationTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, serializedAdditionalRawData) { AllowedTrainingAlgorithms = allowedTrainingAlgorithms; BlockedTrainingAlgorithms = blockedTrainingAlgorithms; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.Serialization.cs deleted file mode 100644 index 9c99f438f1606..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.Serialization.cs +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class CocoExportSummary : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CocoExportSummary)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ContainerName)) - { - if (ContainerName != null) - { - writer.WritePropertyName("containerName"u8); - writer.WriteStringValue(ContainerName); - } - else - { - writer.WriteNull("containerName"); - } - } - if (options.Format != "W" && Optional.IsDefined(SnapshotPath)) - { - if (SnapshotPath != null) - { - writer.WritePropertyName("snapshotPath"u8); - writer.WriteStringValue(SnapshotPath); - } - else - { - writer.WriteNull("snapshotPath"); - } - } - if (options.Format != "W" && Optional.IsDefined(EndOn)) - { - if (EndOn != null) - { - writer.WritePropertyName("endDateTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - else - { - writer.WriteNull("endDateTime"); - } - } - if (options.Format != "W" && Optional.IsDefined(ExportedRowCount)) - { - if (ExportedRowCount != null) - { - writer.WritePropertyName("exportedRowCount"u8); - writer.WriteNumberValue(ExportedRowCount.Value); - } - else - { - writer.WriteNull("exportedRowCount"); - } - } - writer.WritePropertyName("format"u8); - writer.WriteStringValue(Format.ToString()); - if (options.Format != "W" && Optional.IsDefined(LabelingJobId)) - { - if (LabelingJobId != null) - { - writer.WritePropertyName("labelingJobId"u8); - writer.WriteStringValue(LabelingJobId); - } - else - { - writer.WriteNull("labelingJobId"); - } - } - if (options.Format != "W" && Optional.IsDefined(StartOn)) - { - if (StartOn != null) - { - writer.WritePropertyName("startDateTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - else - { - writer.WriteNull("startDateTime"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CocoExportSummary 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(CocoExportSummary)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCocoExportSummary(document.RootElement, options); - } - - internal static CocoExportSummary DeserializeCocoExportSummary(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string containerName = default; - string snapshotPath = default; - DateTimeOffset? endDateTime = default; - long? exportedRowCount = default; - ExportFormatType format = default; - string labelingJobId = default; - DateTimeOffset? startDateTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("containerName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - containerName = null; - continue; - } - containerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("snapshotPath"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - snapshotPath = null; - continue; - } - snapshotPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("endDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - endDateTime = null; - continue; - } - endDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("exportedRowCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - exportedRowCount = null; - continue; - } - exportedRowCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("format"u8)) - { - format = new ExportFormatType(property.Value.GetString()); - continue; - } - if (property.NameEquals("labelingJobId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labelingJobId = null; - continue; - } - labelingJobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("startDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - startDateTime = null; - continue; - } - startDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CocoExportSummary( - endDateTime, - exportedRowCount, - format, - labelingJobId, - startDateTime, - serializedAdditionalRawData, - containerName, - snapshotPath); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(CocoExportSummary)} does not support writing '{options.Format}' format."); - } - } - - CocoExportSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCocoExportSummary(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CocoExportSummary)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.cs deleted file mode 100644 index f02cada066e9f..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The CocoExportSummary. - public partial class CocoExportSummary : ExportSummary - { - /// Initializes a new instance of . - public CocoExportSummary() - { - Format = ExportFormatType.Coco; - } - - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// [Required] The format of exported labels, also as the discriminator. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// Keeps track of any properties unknown to the library. - /// The container name to which the labels will be exported. - /// The output path where the labels will be exported. - internal CocoExportSummary(DateTimeOffset? endOn, long? exportedRowCount, ExportFormatType format, string labelingJobId, DateTimeOffset? startOn, IDictionary serializedAdditionalRawData, string containerName, string snapshotPath) : base(endOn, exportedRowCount, format, labelingJobId, startOn, serializedAdditionalRawData) - { - ContainerName = containerName; - SnapshotPath = snapshotPath; - Format = format; - } - - /// The container name to which the labels will be exported. - public string ContainerName { get; } - /// The output path where the labels will be exported. - public string SnapshotPath { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceFrequency.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceFrequency.cs new file mode 100644 index 0000000000000..cd5034bc606e3 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceFrequency.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 Azure.ResourceManager.MachineLearning.Models +{ + /// Enum to describe the frequency of a compute recurrence schedule. + public readonly partial struct ComputeRecurrenceFrequency : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeRecurrenceFrequency(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MinuteValue = "Minute"; + private const string HourValue = "Hour"; + private const string DayValue = "Day"; + private const string WeekValue = "Week"; + private const string MonthValue = "Month"; + + /// Minute frequency. + public static ComputeRecurrenceFrequency Minute { get; } = new ComputeRecurrenceFrequency(MinuteValue); + /// Hour frequency. + public static ComputeRecurrenceFrequency Hour { get; } = new ComputeRecurrenceFrequency(HourValue); + /// Day frequency. + public static ComputeRecurrenceFrequency Day { get; } = new ComputeRecurrenceFrequency(DayValue); + /// Week frequency. + public static ComputeRecurrenceFrequency Week { get; } = new ComputeRecurrenceFrequency(WeekValue); + /// Month frequency. + public static ComputeRecurrenceFrequency Month { get; } = new ComputeRecurrenceFrequency(MonthValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeRecurrenceFrequency left, ComputeRecurrenceFrequency right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeRecurrenceFrequency left, ComputeRecurrenceFrequency right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeRecurrenceFrequency(string value) => new ComputeRecurrenceFrequency(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeRecurrenceFrequency other && Equals(other); + /// + public bool Equals(ComputeRecurrenceFrequency 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.Serialization.cs new file mode 100644 index 0000000000000..35546bb5ce259 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.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.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ComputeRecurrenceSchedule : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeRecurrenceSchedule)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("hours"u8); + writer.WriteStartArray(); + foreach (var item in Hours) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("minutes"u8); + writer.WriteStartArray(); + foreach (var item in Minutes) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + if (Optional.IsCollectionDefined(MonthDays)) + { + if (MonthDays != null) + { + writer.WritePropertyName("monthDays"u8); + writer.WriteStartArray(); + foreach (var item in MonthDays) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("monthDays"); + } + } + if (Optional.IsCollectionDefined(WeekDays)) + { + if (WeekDays != null) + { + writer.WritePropertyName("weekDays"u8); + writer.WriteStartArray(); + foreach (var item in WeekDays) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("weekDays"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeRecurrenceSchedule 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(ComputeRecurrenceSchedule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeRecurrenceSchedule(document.RootElement, options); + } + + internal static ComputeRecurrenceSchedule DeserializeComputeRecurrenceSchedule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList hours = default; + IList minutes = default; + IList monthDays = default; + IList weekDays = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hours"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + hours = array; + continue; + } + if (property.NameEquals("minutes"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + minutes = array; + continue; + } + if (property.NameEquals("monthDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + monthDays = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + monthDays = array; + continue; + } + if (property.NameEquals("weekDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + weekDays = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new ComputeWeekDay(item.GetString())); + } + weekDays = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeRecurrenceSchedule(hours, minutes, monthDays ?? new ChangeTrackingList(), weekDays ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeRecurrenceSchedule)} does not support writing '{options.Format}' format."); + } + } + + ComputeRecurrenceSchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeRecurrenceSchedule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeRecurrenceSchedule)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.cs new file mode 100644 index 0000000000000..704a3dfcca345 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.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; +using System.Linq; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ComputeRecurrenceSchedule. + public partial class ComputeRecurrenceSchedule + { + /// + /// 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 . + /// [Required] List of hours for the schedule. + /// [Required] List of minutes for the schedule. + /// or is null. + public ComputeRecurrenceSchedule(IEnumerable hours, IEnumerable minutes) + { + Argument.AssertNotNull(hours, nameof(hours)); + Argument.AssertNotNull(minutes, nameof(minutes)); + + Hours = hours.ToList(); + Minutes = minutes.ToList(); + MonthDays = new ChangeTrackingList(); + WeekDays = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// [Required] List of hours for the schedule. + /// [Required] List of minutes for the schedule. + /// List of month days for the schedule. + /// List of days for the schedule. + /// Keeps track of any properties unknown to the library. + internal ComputeRecurrenceSchedule(IList hours, IList minutes, IList monthDays, IList weekDays, IDictionary serializedAdditionalRawData) + { + Hours = hours; + Minutes = minutes; + MonthDays = monthDays; + WeekDays = weekDays; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeRecurrenceSchedule() + { + } + + /// [Required] List of hours for the schedule. + public IList Hours { get; } + /// [Required] List of minutes for the schedule. + public IList Minutes { get; } + /// List of month days for the schedule. + public IList MonthDays { get; set; } + /// List of days for the schedule. + public IList WeekDays { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.Serialization.cs index 76bd0cc08a359..1e21beef50843 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.Serialization.cs @@ -96,11 +96,11 @@ internal static ComputeStartStopRecurrenceSchedule DeserializeComputeStartStopRe { return null; } - MachineLearningRecurrenceFrequency? frequency = default; + ComputeRecurrenceFrequency? frequency = default; int? interval = default; string startTime = default; string timeZone = default; - MachineLearningRecurrenceSchedule schedule = default; + ComputeRecurrenceSchedule schedule = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -111,7 +111,7 @@ internal static ComputeStartStopRecurrenceSchedule DeserializeComputeStartStopRe { continue; } - frequency = new MachineLearningRecurrenceFrequency(property.Value.GetString()); + frequency = new ComputeRecurrenceFrequency(property.Value.GetString()); continue; } if (property.NameEquals("interval"u8)) @@ -144,7 +144,7 @@ internal static ComputeStartStopRecurrenceSchedule DeserializeComputeStartStopRe { continue; } - schedule = MachineLearningRecurrenceSchedule.DeserializeMachineLearningRecurrenceSchedule(property.Value, options); + schedule = ComputeRecurrenceSchedule.DeserializeComputeRecurrenceSchedule(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.cs index 2daa6fd1180c2..d06404c620d9e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.cs @@ -60,7 +60,7 @@ public ComputeStartStopRecurrenceSchedule() /// /// [Required] The recurrence schedule. /// Keeps track of any properties unknown to the library. - internal ComputeStartStopRecurrenceSchedule(MachineLearningRecurrenceFrequency? frequency, int? interval, string startTime, string timeZone, MachineLearningRecurrenceSchedule schedule, IDictionary serializedAdditionalRawData) + internal ComputeStartStopRecurrenceSchedule(ComputeRecurrenceFrequency? frequency, int? interval, string startTime, string timeZone, ComputeRecurrenceSchedule schedule, IDictionary serializedAdditionalRawData) { Frequency = frequency; Interval = interval; @@ -71,7 +71,7 @@ internal ComputeStartStopRecurrenceSchedule(MachineLearningRecurrenceFrequency? } /// [Required] The frequency to trigger schedule. - public MachineLearningRecurrenceFrequency? Frequency { get; set; } + public ComputeRecurrenceFrequency? Frequency { get; set; } /// [Required] Specifies schedule interval in conjunction with frequency. public int? Interval { get; set; } /// The start time in yyyy-MM-ddTHH:mm:ss format. @@ -82,6 +82,6 @@ internal ComputeStartStopRecurrenceSchedule(MachineLearningRecurrenceFrequency? /// public string TimeZone { get; set; } /// [Required] The recurrence schedule. - public MachineLearningRecurrenceSchedule Schedule { get; set; } + public ComputeRecurrenceSchedule Schedule { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeWeekDay.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeWeekDay.cs new file mode 100644 index 0000000000000..eb1d5f38d2dc2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeWeekDay.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 Azure.ResourceManager.MachineLearning.Models +{ + /// Enum of weekday. + public readonly partial struct ComputeWeekDay : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeWeekDay(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MondayValue = "Monday"; + private const string TuesdayValue = "Tuesday"; + private const string WednesdayValue = "Wednesday"; + private const string ThursdayValue = "Thursday"; + private const string FridayValue = "Friday"; + private const string SaturdayValue = "Saturday"; + private const string SundayValue = "Sunday"; + + /// Monday weekday. + public static ComputeWeekDay Monday { get; } = new ComputeWeekDay(MondayValue); + /// Tuesday weekday. + public static ComputeWeekDay Tuesday { get; } = new ComputeWeekDay(TuesdayValue); + /// Wednesday weekday. + public static ComputeWeekDay Wednesday { get; } = new ComputeWeekDay(WednesdayValue); + /// Thursday weekday. + public static ComputeWeekDay Thursday { get; } = new ComputeWeekDay(ThursdayValue); + /// Friday weekday. + public static ComputeWeekDay Friday { get; } = new ComputeWeekDay(FridayValue); + /// Saturday weekday. + public static ComputeWeekDay Saturday { get; } = new ComputeWeekDay(SaturdayValue); + /// Sunday weekday. + public static ComputeWeekDay Sunday { get; } = new ComputeWeekDay(SundayValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeWeekDay left, ComputeWeekDay right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeWeekDay left, ComputeWeekDay right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeWeekDay(string value) => new ComputeWeekDay(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeWeekDay other && Equals(other); + /// + public bool Equals(ComputeWeekDay 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ConnectionGroup.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ConnectionGroup.cs new file mode 100644 index 0000000000000..74692bb3b9166 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ConnectionGroup.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 Azure.ResourceManager.MachineLearning.Models +{ + /// Group based on connection category. + public readonly partial struct ConnectionGroup : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectionGroup(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureValue = "Azure"; + private const string AzureAIValue = "AzureAI"; + private const string DatabaseValue = "Database"; + private const string NoSQLValue = "NoSQL"; + private const string FileValue = "File"; + private const string GenericProtocolValue = "GenericProtocol"; + private const string ServicesAndAppsValue = "ServicesAndApps"; + + /// Azure. + public static ConnectionGroup Azure { get; } = new ConnectionGroup(AzureValue); + /// AzureAI. + public static ConnectionGroup AzureAI { get; } = new ConnectionGroup(AzureAIValue); + /// Database. + public static ConnectionGroup Database { get; } = new ConnectionGroup(DatabaseValue); + /// NoSQL. + public static ConnectionGroup NoSQL { get; } = new ConnectionGroup(NoSQLValue); + /// File. + public static ConnectionGroup File { get; } = new ConnectionGroup(FileValue); + /// GenericProtocol. + public static ConnectionGroup GenericProtocol { get; } = new ConnectionGroup(GenericProtocolValue); + /// ServicesAndApps. + public static ConnectionGroup ServicesAndApps { get; } = new ConnectionGroup(ServicesAndAppsValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectionGroup left, ConnectionGroup right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectionGroup left, ConnectionGroup right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ConnectionGroup(string value) => new ConnectionGroup(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectionGroup other && Equals(other); + /// + public bool Equals(ConnectionGroup 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.Serialization.cs index 28dc671c88ad5..5efea0b7e8274 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.Serialization.cs @@ -13,21 +13,21 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class UnknownInferencingServer : IUtf8JsonSerializable, IJsonModel + internal partial class ContentSafety : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InferencingServer)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ContentSafety)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("serverType"u8); - writer.WriteStringValue(ServerType.ToString()); + writer.WritePropertyName("contentSafetyStatus"u8); + writer.WriteStringValue(ContentSafetyStatus.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +46,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WriteEndObject(); } - InferencingServer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentSafety IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InferencingServer)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ContentSafety)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInferencingServer(document.RootElement, options); + return DeserializeContentSafety(document.RootElement, options); } - internal static UnknownInferencingServer DeserializeUnknownInferencingServer(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentSafety DeserializeContentSafety(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +66,14 @@ internal static UnknownInferencingServer DeserializeUnknownInferencingServer(Jso { return null; } - InferencingServerType serverType = "Unknown"; + ContentSafetyStatus contentSafetyStatus = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("serverType"u8)) + if (property.NameEquals("contentSafetyStatus"u8)) { - serverType = new InferencingServerType(property.Value.GetString()); + contentSafetyStatus = new ContentSafetyStatus(property.Value.GetString()); continue; } if (options.Format != "W") @@ -82,38 +82,38 @@ internal static UnknownInferencingServer DeserializeUnknownInferencingServer(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownInferencingServer(serverType, serializedAdditionalRawData); + return new ContentSafety(contentSafetyStatus, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(InferencingServer)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContentSafety)} does not support writing '{options.Format}' format."); } } - InferencingServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ContentSafety IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInferencingServer(document.RootElement, options); + return DeserializeContentSafety(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InferencingServer)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContentSafety)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.cs new file mode 100644 index 0000000000000..8d2c748d01e82 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ContentSafety. + internal partial class ContentSafety + { + /// + /// 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 . + /// [Required] Specifies the status of content safety. + public ContentSafety(ContentSafetyStatus contentSafetyStatus) + { + ContentSafetyStatus = contentSafetyStatus; + } + + /// Initializes a new instance of . + /// [Required] Specifies the status of content safety. + /// Keeps track of any properties unknown to the library. + internal ContentSafety(ContentSafetyStatus contentSafetyStatus, IDictionary serializedAdditionalRawData) + { + ContentSafetyStatus = contentSafetyStatus; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ContentSafety() + { + } + + /// [Required] Specifies the status of content safety. + public ContentSafetyStatus ContentSafetyStatus { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..1f9a6b636ae59 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ContentSafetyEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentSafetyEndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (Optional.IsDefined(RaiPolicyName)) + { + writer.WritePropertyName("raiPolicyName"u8); + writer.WriteStringValue(RaiPolicyName); + } + if (Optional.IsDefined(VersionUpgradeOption)) + { + writer.WritePropertyName("versionUpgradeOption"u8); + writer.WriteStringValue(VersionUpgradeOption.Value.ToString()); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ContentSafetyEndpointDeploymentResourceProperties 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(ContentSafetyEndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContentSafetyEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static ContentSafetyEndpointDeploymentResourceProperties DeserializeContentSafetyEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointDeploymentModel model = default; + string raiPolicyName = default; + DeploymentModelVersionUpgradeOption? versionUpgradeOption = default; + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("model"u8)) + { + model = EndpointDeploymentModel.DeserializeEndpointDeploymentModel(property.Value, options); + continue; + } + if (property.NameEquals("raiPolicyName"u8)) + { + raiPolicyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("versionUpgradeOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + versionUpgradeOption = new DeploymentModelVersionUpgradeOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContentSafetyEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + type, + serializedAdditionalRawData, + model, + raiPolicyName, + versionUpgradeOption); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContentSafetyEndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ContentSafetyEndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContentSafetyEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContentSafetyEndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.cs new file mode 100644 index 0000000000000..46d2ac213c276 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ContentSafetyEndpointDeploymentResourceProperties. + public partial class ContentSafetyEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + /// Model used for the endpoint deployment. + /// is null. + public ContentSafetyEndpointDeploymentResourceProperties(EndpointDeploymentModel model) + { + Argument.AssertNotNull(model, nameof(model)); + + Model = model; + EndpointDeploymentResourcePropertiesType = "Azure.ContentSafety"; + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + internal ContentSafetyEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData, EndpointDeploymentModel model, string raiPolicyName, DeploymentModelVersionUpgradeOption? versionUpgradeOption) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + Model = model; + RaiPolicyName = raiPolicyName; + VersionUpgradeOption = versionUpgradeOption; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "Azure.ContentSafety"; + } + + /// Initializes a new instance of for deserialization. + internal ContentSafetyEndpointDeploymentResourceProperties() + { + } + + /// Model used for the endpoint deployment. + public EndpointDeploymentModel Model { get; set; } + /// The name of RAI policy. + public string RaiPolicyName { get; set; } + /// Deployment model version upgrade option. + public DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..ff216c2c4849c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ContentSafetyEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentSafetyEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ContentSafetyEndpointResourceProperties 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(ContentSafetyEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContentSafetyEndpointResourceProperties(document.RootElement, options); + } + + internal static ContentSafetyEndpointResourceProperties DeserializeContentSafetyEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContentSafetyEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContentSafetyEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ContentSafetyEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContentSafetyEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContentSafetyEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.cs new file mode 100644 index 0000000000000..cd968320a7661 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ContentSafetyEndpointResourceProperties. + public partial class ContentSafetyEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public ContentSafetyEndpointResourceProperties() + { + EndpointType = EndpointType.AzureContentSafety; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal ContentSafetyEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + EndpointType = endpointType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyStatus.cs new file mode 100644 index 0000000000000..200ff6eea22d6 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Specifies the status of content safety. + public readonly partial struct ContentSafetyStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContentSafetyStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled. + public static ContentSafetyStatus Enabled { get; } = new ContentSafetyStatus(EnabledValue); + /// Disabled. + public static ContentSafetyStatus Disabled { get; } = new ContentSafetyStatus(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(ContentSafetyStatus left, ContentSafetyStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContentSafetyStatus left, ContentSafetyStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ContentSafetyStatus(string value) => new ContentSafetyStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContentSafetyStatus other && Equals(other); + /// + public bool Equals(ContentSafetyStatus 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CredentialsType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CredentialsType.cs index 132623c2a375c..77b6bb13f48a5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CredentialsType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CredentialsType.cs @@ -27,8 +27,6 @@ public CredentialsType(string value) private const string NoneValue = "None"; private const string SasValue = "Sas"; private const string ServicePrincipalValue = "ServicePrincipal"; - private const string KerberosKeytabValue = "KerberosKeytab"; - private const string KerberosPasswordValue = "KerberosPassword"; /// AccountKey. public static CredentialsType AccountKey { get; } = new CredentialsType(AccountKeyValue); @@ -40,10 +38,6 @@ public CredentialsType(string value) public static CredentialsType Sas { get; } = new CredentialsType(SasValue); /// ServicePrincipal. public static CredentialsType ServicePrincipal { get; } = new CredentialsType(ServicePrincipalValue); - /// KerberosKeytab. - public static CredentialsType KerberosKeytab { get; } = new CredentialsType(KerberosKeytabValue); - /// KerberosPassword. - public static CredentialsType KerberosPassword { get; } = new CredentialsType(KerberosPasswordValue); /// Determines if two values are the same. public static bool operator ==(CredentialsType left, CredentialsType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.Serialization.cs index 742ff3365a7e2..055fe46969383 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.Serialization.cs @@ -101,7 +101,7 @@ internal static CronTrigger DeserializeCronTrigger(JsonElement element, ModelRea string endTime = default; string startTime = default; string timeZone = default; - MachineLearningTriggerType triggerType = default; + TriggerType triggerType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -138,7 +138,7 @@ internal static CronTrigger DeserializeCronTrigger(JsonElement element, ModelRea } if (property.NameEquals("triggerType"u8)) { - triggerType = new MachineLearningTriggerType(property.Value.GetString()); + triggerType = new TriggerType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.cs index b03714d0e7ddc..e564f8c07ede5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.cs @@ -24,7 +24,7 @@ public CronTrigger(string expression) Argument.AssertNotNull(expression, nameof(expression)); Expression = expression; - TriggerType = MachineLearningTriggerType.Cron; + TriggerType = TriggerType.Cron; } /// Initializes a new instance of . @@ -44,7 +44,7 @@ public CronTrigger(string expression) /// [Required] Specifies cron expression of schedule. /// The expression should follow NCronTab format. /// - internal CronTrigger(string endTime, string startTime, string timeZone, MachineLearningTriggerType triggerType, IDictionary serializedAdditionalRawData, string expression) : base(endTime, startTime, timeZone, triggerType, serializedAdditionalRawData) + internal CronTrigger(string endTime, string startTime, string timeZone, TriggerType triggerType, IDictionary serializedAdditionalRawData, string expression) : base(endTime, startTime, timeZone, triggerType, serializedAdditionalRawData) { Expression = expression; TriggerType = triggerType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.Serialization.cs deleted file mode 100644 index bb814d15b773b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.Serialization.cs +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class CsvExportSummary : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CsvExportSummary)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ContainerName)) - { - if (ContainerName != null) - { - writer.WritePropertyName("containerName"u8); - writer.WriteStringValue(ContainerName); - } - else - { - writer.WriteNull("containerName"); - } - } - if (options.Format != "W" && Optional.IsDefined(SnapshotPath)) - { - if (SnapshotPath != null) - { - writer.WritePropertyName("snapshotPath"u8); - writer.WriteStringValue(SnapshotPath); - } - else - { - writer.WriteNull("snapshotPath"); - } - } - if (options.Format != "W" && Optional.IsDefined(EndOn)) - { - if (EndOn != null) - { - writer.WritePropertyName("endDateTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - else - { - writer.WriteNull("endDateTime"); - } - } - if (options.Format != "W" && Optional.IsDefined(ExportedRowCount)) - { - if (ExportedRowCount != null) - { - writer.WritePropertyName("exportedRowCount"u8); - writer.WriteNumberValue(ExportedRowCount.Value); - } - else - { - writer.WriteNull("exportedRowCount"); - } - } - writer.WritePropertyName("format"u8); - writer.WriteStringValue(Format.ToString()); - if (options.Format != "W" && Optional.IsDefined(LabelingJobId)) - { - if (LabelingJobId != null) - { - writer.WritePropertyName("labelingJobId"u8); - writer.WriteStringValue(LabelingJobId); - } - else - { - writer.WriteNull("labelingJobId"); - } - } - if (options.Format != "W" && Optional.IsDefined(StartOn)) - { - if (StartOn != null) - { - writer.WritePropertyName("startDateTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - else - { - writer.WriteNull("startDateTime"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CsvExportSummary 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(CsvExportSummary)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCsvExportSummary(document.RootElement, options); - } - - internal static CsvExportSummary DeserializeCsvExportSummary(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string containerName = default; - string snapshotPath = default; - DateTimeOffset? endDateTime = default; - long? exportedRowCount = default; - ExportFormatType format = default; - string labelingJobId = default; - DateTimeOffset? startDateTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("containerName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - containerName = null; - continue; - } - containerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("snapshotPath"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - snapshotPath = null; - continue; - } - snapshotPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("endDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - endDateTime = null; - continue; - } - endDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("exportedRowCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - exportedRowCount = null; - continue; - } - exportedRowCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("format"u8)) - { - format = new ExportFormatType(property.Value.GetString()); - continue; - } - if (property.NameEquals("labelingJobId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labelingJobId = null; - continue; - } - labelingJobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("startDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - startDateTime = null; - continue; - } - startDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CsvExportSummary( - endDateTime, - exportedRowCount, - format, - labelingJobId, - startDateTime, - serializedAdditionalRawData, - containerName, - snapshotPath); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(CsvExportSummary)} does not support writing '{options.Format}' format."); - } - } - - CsvExportSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCsvExportSummary(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CsvExportSummary)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.cs deleted file mode 100644 index 5b478f5388eed..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The CsvExportSummary. - public partial class CsvExportSummary : ExportSummary - { - /// Initializes a new instance of . - public CsvExportSummary() - { - Format = ExportFormatType.CSV; - } - - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// [Required] The format of exported labels, also as the discriminator. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// Keeps track of any properties unknown to the library. - /// The container name to which the labels will be exported. - /// The output path where the labels will be exported. - internal CsvExportSummary(DateTimeOffset? endOn, long? exportedRowCount, ExportFormatType format, string labelingJobId, DateTimeOffset? startOn, IDictionary serializedAdditionalRawData, string containerName, string snapshotPath) : base(endOn, exportedRowCount, format, labelingJobId, startOn, serializedAdditionalRawData) - { - ContainerName = containerName; - SnapshotPath = snapshotPath; - Format = format; - } - - /// The container name to which the labels will be exported. - public string ContainerName { get; } - /// The output path where the labels will be exported. - public string SnapshotPath { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.cs deleted file mode 100644 index 142d98b3fb45c..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Custom inference server configurations. - public partial class CustomInferencingServer : InferencingServer - { - /// Initializes a new instance of . - public CustomInferencingServer() - { - ServerType = InferencingServerType.Custom; - } - - /// Initializes a new instance of . - /// [Required] Inferencing server type for various targets. - /// Keeps track of any properties unknown to the library. - /// Inference configuration for custom inferencing. - internal CustomInferencingServer(InferencingServerType serverType, IDictionary serializedAdditionalRawData, OnlineInferenceConfiguration inferenceConfiguration) : base(serverType, serializedAdditionalRawData) - { - InferenceConfiguration = inferenceConfiguration; - ServerType = serverType; - } - - /// Inference configuration for custom inferencing. - public OnlineInferenceConfiguration InferenceConfiguration { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.Serialization.cs index 4a7186181490b..79cf83cbcc789 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor CustomKeys credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor return new CustomKeysWorkspaceConnectionProperties( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.cs index b6dfcb621047a..421b83411cc22 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -28,12 +29,20 @@ public CustomKeysWorkspaceConnectionProperties() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// Custom Keys credential object. - internal CustomKeysWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, CustomKeys credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal CustomKeysWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, CustomKeys credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.Serialization.cs new file mode 100644 index 0000000000000..f5ce08ae51bba --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.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.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class CustomModelFineTuning : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomModelFineTuning)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(HyperParameters)) + { + if (HyperParameters != null) + { + writer.WritePropertyName("hyperParameters"u8); + writer.WriteStartObject(); + foreach (var item in HyperParameters) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("hyperParameters"); + } + } + writer.WritePropertyName("modelProvider"u8); + writer.WriteStringValue(ModelProvider.ToString()); + writer.WritePropertyName("taskType"u8); + writer.WriteStringValue(TaskType.ToString()); + writer.WritePropertyName("trainingData"u8); + writer.WriteObjectValue(TrainingData, options); + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomModelFineTuning 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(CustomModelFineTuning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomModelFineTuning(document.RootElement, options); + } + + internal static CustomModelFineTuning DeserializeCustomModelFineTuning(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary hyperParameters = default; + ModelProvider modelProvider = default; + FineTuningTaskType taskType = default; + MachineLearningJobInput trainingData = default; + MachineLearningJobInput validationData = default; + MachineLearningFlowModelJobInput model = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + hyperParameters = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + hyperParameters = dictionary; + continue; + } + if (property.NameEquals("modelProvider"u8)) + { + modelProvider = new ModelProvider(property.Value.GetString()); + continue; + } + if (property.NameEquals("taskType"u8)) + { + taskType = new FineTuningTaskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingData"u8)) + { + trainingData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("validationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationData = null; + continue; + } + validationData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("model"u8)) + { + model = MachineLearningFlowModelJobInput.DeserializeMachineLearningFlowModelJobInput(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomModelFineTuning( + modelProvider, + taskType, + trainingData, + validationData, + model, + serializedAdditionalRawData, + hyperParameters ?? new ChangeTrackingDictionary()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomModelFineTuning)} does not support writing '{options.Format}' format."); + } + } + + CustomModelFineTuning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomModelFineTuning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomModelFineTuning)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.cs new file mode 100644 index 0000000000000..2431930ea9bcc --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The CustomModelFineTuning. + public partial class CustomModelFineTuning : FineTuningVertical + { + /// Initializes a new instance of . + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// 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 . + /// + /// [Required] Input model for fine tuning. + /// or is null. + public CustomModelFineTuning(FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningFlowModelJobInput model) : base(taskType, trainingData, model) + { + Argument.AssertNotNull(trainingData, nameof(trainingData)); + Argument.AssertNotNull(model, nameof(model)); + + HyperParameters = new ChangeTrackingDictionary(); + ModelProvider = ModelProvider.Custom; + } + + /// Initializes a new instance of . + /// [Required] Enum to determine the type of fine tuning. + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// 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 . + /// + /// + /// Validation data for fine tuning. + /// 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 . + /// + /// [Required] Input model for fine tuning. + /// Keeps track of any properties unknown to the library. + /// HyperParameters for fine tuning custom model. + internal CustomModelFineTuning(ModelProvider modelProvider, FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningJobInput validationData, MachineLearningFlowModelJobInput model, IDictionary serializedAdditionalRawData, IDictionary hyperParameters) : base(modelProvider, taskType, trainingData, validationData, model, serializedAdditionalRawData) + { + HyperParameters = hyperParameters; + ModelProvider = modelProvider; + } + + /// Initializes a new instance of for deserialization. + internal CustomModelFineTuning() + { + } + + /// HyperParameters for fine tuning custom model. + public IDictionary HyperParameters { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.Serialization.cs index 922b3892d5328..45a4cf658a3be 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.Serialization.cs @@ -71,12 +71,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("workspaceConnection"u8); - writer.WriteObjectValue(WorkspaceConnection, options); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -140,8 +150,7 @@ internal static CustomMonitoringSignal DeserializeCustomMonitoringSignal(JsonEle IDictionary inputAssets = default; IDictionary inputs = default; IList metricThresholds = default; - MonitoringWorkspaceConnection workspaceConnection = default; - MonitoringNotificationMode? mode = default; + IList notificationTypes = default; IDictionary properties = default; MonitoringSignalType signalType = default; IDictionary serializedAdditionalRawData = default; @@ -193,18 +202,19 @@ internal static CustomMonitoringSignal DeserializeCustomMonitoringSignal(JsonEle metricThresholds = array; continue; } - if (property.NameEquals("workspaceConnection"u8)) - { - workspaceConnection = MonitoringWorkspaceConnection.DeserializeMonitoringWorkspaceConnection(property.Value, options); - continue; - } - if (property.NameEquals("mode"u8)) + if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + notificationTypes = null; continue; } - mode = new MonitoringNotificationMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MonitoringNotificationType(item.GetString())); + } + notificationTypes = array; continue; } if (property.NameEquals("properties"u8)) @@ -234,15 +244,14 @@ internal static CustomMonitoringSignal DeserializeCustomMonitoringSignal(JsonEle } serializedAdditionalRawData = rawDataDictionary; return new CustomMonitoringSignal( - mode, + notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData, componentId, inputAssets ?? new ChangeTrackingDictionary(), inputs ?? new ChangeTrackingDictionary(), - metricThresholds, - workspaceConnection); + metricThresholds); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.cs index ee4d23f2ca111..426203fea1080 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.cs @@ -15,34 +15,31 @@ namespace Azure.ResourceManager.MachineLearning.Models public partial class CustomMonitoringSignal : MonitoringSignalBase { /// Initializes a new instance of . - /// [Required] ARM resource ID of the component resource used to calculate the custom metrics. + /// [Required] Reference to the component asset used to calculate the custom metrics. /// [Required] A list of metrics to calculate and their associated thresholds. - /// [Required] A list of metrics to calculate and their associated thresholds. - /// , or is null. - public CustomMonitoringSignal(string componentId, IEnumerable metricThresholds, MonitoringWorkspaceConnection workspaceConnection) + /// or is null. + public CustomMonitoringSignal(string componentId, IEnumerable metricThresholds) { Argument.AssertNotNull(componentId, nameof(componentId)); Argument.AssertNotNull(metricThresholds, nameof(metricThresholds)); - Argument.AssertNotNull(workspaceConnection, nameof(workspaceConnection)); ComponentId = componentId; InputAssets = new ChangeTrackingDictionary(); Inputs = new ChangeTrackingDictionary(); MetricThresholds = metricThresholds.ToList(); - WorkspaceConnection = workspaceConnection; SignalType = MonitoringSignalType.Custom; } /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. - /// [Required] ARM resource ID of the component resource used to calculate the custom metrics. + /// [Required] Reference to the component asset used to calculate the custom metrics. /// /// Monitoring assets to take as input. Key is the component input port name, value is the data asset. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// Extra component parameters to take as input. Key is the component literal input port name, value is the parameter value. @@ -50,14 +47,12 @@ public CustomMonitoringSignal(string componentId, IEnumerable, , , , , and . /// /// [Required] A list of metrics to calculate and their associated thresholds. - /// [Required] A list of metrics to calculate and their associated thresholds. - internal CustomMonitoringSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, string componentId, IDictionary inputAssets, IDictionary inputs, IList metricThresholds, MonitoringWorkspaceConnection workspaceConnection) : base(mode, properties, signalType, serializedAdditionalRawData) + internal CustomMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, string componentId, IDictionary inputAssets, IDictionary inputs, IList metricThresholds) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) { ComponentId = componentId; InputAssets = inputAssets; Inputs = inputs; MetricThresholds = metricThresholds; - WorkspaceConnection = workspaceConnection; SignalType = signalType; } @@ -66,12 +61,12 @@ internal CustomMonitoringSignal() { } - /// [Required] ARM resource ID of the component resource used to calculate the custom metrics. + /// [Required] Reference to the component asset used to calculate the custom metrics. public string ComponentId { get; set; } /// /// Monitoring assets to take as input. Key is the component input port name, value is the data asset. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public IDictionary InputAssets { get; set; } /// @@ -82,7 +77,5 @@ internal CustomMonitoringSignal() public IDictionary Inputs { get; set; } /// [Required] A list of metrics to calculate and their associated thresholds. public IList MetricThresholds { get; } - /// [Required] A list of metrics to calculate and their associated thresholds. - public MonitoringWorkspaceConnection WorkspaceConnection { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.Serialization.cs index b77ca56561b54..fff95ca8fb826 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.Serialization.cs @@ -79,6 +79,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt } writer.WriteEndArray(); } + if (Optional.IsDefined(Kernel)) + { + writer.WritePropertyName("kernel"u8); + writer.WriteObjectValue(Kernel, options); + } foreach (var item in AdditionalProperties) { writer.WritePropertyName(item.Key); @@ -120,6 +125,7 @@ internal static CustomService DeserializeCustomService(JsonElement element, Mode DockerSetting docker = default; IList endpoints = default; IList volumes = default; + JupyterKernelConfig kernel = default; IDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -190,6 +196,15 @@ internal static CustomService DeserializeCustomService(JsonElement element, Mode volumes = array; continue; } + if (property.NameEquals("kernel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kernel = JupyterKernelConfig.DeserializeJupyterKernelConfig(property.Value, options); + continue; + } additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; @@ -200,6 +215,7 @@ internal static CustomService DeserializeCustomService(JsonElement element, Mode docker, endpoints ?? new ChangeTrackingList(), volumes ?? new ChangeTrackingList(), + kernel, additionalProperties); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.cs index f0396ea418bd3..79b4d17819364 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.cs @@ -29,8 +29,9 @@ public CustomService() /// Describes the docker settings for the image. /// Configuring the endpoints for the container. /// Configuring the volumes for the container. + /// Describes the jupyter kernel settings for the image if its a custom environment. /// Additional Properties. - internal CustomService(string name, ImageSetting image, IDictionary environmentVariables, DockerSetting docker, IList endpoints, IList volumes, IDictionary additionalProperties) + internal CustomService(string name, ImageSetting image, IDictionary environmentVariables, DockerSetting docker, IList endpoints, IList volumes, JupyterKernelConfig kernel, IDictionary additionalProperties) { Name = name; Image = image; @@ -38,6 +39,7 @@ internal CustomService(string name, ImageSetting image, IDictionary Endpoints { get; } /// Configuring the volumes for the container. public IList Volumes { get; } + /// Describes the jupyter kernel settings for the image if its a custom environment. + public JupyterKernelConfig Kernel { get; set; } /// /// Additional Properties /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataAvailabilityStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataAvailabilityStatus.cs new file mode 100644 index 0000000000000..5494b42eb341a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataAvailabilityStatus.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 Azure.ResourceManager.MachineLearning.Models +{ + /// The DataAvailabilityStatus. + public readonly partial struct DataAvailabilityStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataAvailabilityStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string PendingValue = "Pending"; + private const string IncompleteValue = "Incomplete"; + private const string CompleteValue = "Complete"; + + /// None. + public static DataAvailabilityStatus None { get; } = new DataAvailabilityStatus(NoneValue); + /// Pending. + public static DataAvailabilityStatus Pending { get; } = new DataAvailabilityStatus(PendingValue); + /// Incomplete. + public static DataAvailabilityStatus Incomplete { get; } = new DataAvailabilityStatus(IncompleteValue); + /// Complete. + public static DataAvailabilityStatus Complete { get; } = new DataAvailabilityStatus(CompleteValue); + /// Determines if two values are the same. + public static bool operator ==(DataAvailabilityStatus left, DataAvailabilityStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataAvailabilityStatus left, DataAvailabilityStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DataAvailabilityStatus(string value) => new DataAvailabilityStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataAvailabilityStatus other && Equals(other); + /// + public bool Equals(DataAvailabilityStatus 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.Serialization.cs index c86ee0d0d53b0..6b0025c155159 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.Serialization.cs @@ -26,18 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea } writer.WriteStartObject(); - if (Optional.IsDefined(DataSegment)) - { - if (DataSegment != null) - { - writer.WritePropertyName("dataSegment"u8); - writer.WriteObjectValue(DataSegment, options); - } - else - { - writer.WriteNull("dataSegment"); - } - } if (Optional.IsCollectionDefined(FeatureDataTypeOverride)) { if (FeatureDataTypeOverride != null) @@ -56,6 +44,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteNull("featureDataTypeOverride"); } } + if (Optional.IsDefined(FeatureImportanceSettings)) + { + if (FeatureImportanceSettings != null) + { + writer.WritePropertyName("featureImportanceSettings"u8); + writer.WriteObjectValue(FeatureImportanceSettings, options); + } + else + { + writer.WriteNull("featureImportanceSettings"); + } + } if (Optional.IsDefined(Features)) { if (Features != null) @@ -79,10 +79,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteObjectValue(ProductionData, options); writer.WritePropertyName("referenceData"u8); writer.WriteObjectValue(ReferenceData, options); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -142,29 +154,19 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J { return null; } - MonitoringDataSegment dataSegment = default; IDictionary featureDataTypeOverride = default; + FeatureImportanceSettings featureImportanceSettings = default; MonitoringFeatureFilterBase features = default; IList metricThresholds = default; MonitoringInputDataBase productionData = default; MonitoringInputDataBase referenceData = default; - MonitoringNotificationMode? mode = default; + IList notificationTypes = default; IDictionary properties = default; MonitoringSignalType signalType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("dataSegment"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - dataSegment = null; - continue; - } - dataSegment = MonitoringDataSegment.DeserializeMonitoringDataSegment(property.Value, options); - continue; - } if (property.NameEquals("featureDataTypeOverride"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -180,6 +182,16 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J featureDataTypeOverride = dictionary; continue; } + if (property.NameEquals("featureImportanceSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureImportanceSettings = null; + continue; + } + featureImportanceSettings = FeatureImportanceSettings.DeserializeFeatureImportanceSettings(property.Value, options); + continue; + } if (property.NameEquals("features"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -210,13 +222,19 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); continue; } - if (property.NameEquals("mode"u8)) + if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + notificationTypes = null; continue; } - mode = new MonitoringNotificationMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MonitoringNotificationType(item.GetString())); + } + notificationTypes = array; continue; } if (property.NameEquals("properties"u8)) @@ -246,12 +264,12 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J } serializedAdditionalRawData = rawDataDictionary; return new DataDriftMonitoringSignal( - mode, + notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData, - dataSegment, featureDataTypeOverride ?? new ChangeTrackingDictionary(), + featureImportanceSettings, features, metricThresholds, productionData, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.cs index 8ebd4c0c95c0a..b12edc740dd84 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.cs @@ -23,12 +23,12 @@ public partial class DataDriftMonitoringSignal : MonitoringSignalBase /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// , or is null. public DataDriftMonitoringSignal(IEnumerable metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) @@ -45,12 +45,12 @@ public DataDriftMonitoringSignal(IEnumerable metri } /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. - /// The data segment used for scoping on a subset of the data population. /// A dictionary that maps feature names to their respective data types. + /// The settings for computing feature importance. /// /// The feature filter which identifies which feature to calculate drift over. /// 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. @@ -64,17 +64,17 @@ public DataDriftMonitoringSignal(IEnumerable metri /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// - internal DataDriftMonitoringSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, MonitoringDataSegment dataSegment, IDictionary featureDataTypeOverride, MonitoringFeatureFilterBase features, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(mode, properties, signalType, serializedAdditionalRawData) + internal DataDriftMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, FeatureImportanceSettings featureImportanceSettings, MonitoringFeatureFilterBase features, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) { - DataSegment = dataSegment; FeatureDataTypeOverride = featureDataTypeOverride; + FeatureImportanceSettings = featureImportanceSettings; Features = features; MetricThresholds = metricThresholds; ProductionData = productionData; @@ -87,10 +87,10 @@ internal DataDriftMonitoringSignal() { } - /// The data segment used for scoping on a subset of the data population. - public MonitoringDataSegment DataSegment { get; set; } /// A dictionary that maps feature names to their respective data types. public IDictionary FeatureDataTypeOverride { get; set; } + /// The settings for computing feature importance. + public FeatureImportanceSettings FeatureImportanceSettings { get; set; } /// /// The feature filter which identifies which feature to calculate drift over. /// 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. @@ -106,13 +106,13 @@ internal DataDriftMonitoringSignal() /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ProductionData { get; set; } /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ReferenceData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.Serialization.cs deleted file mode 100644 index 970167633c6e2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.Serialization.cs +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class DataImport : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataImport)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(Source)) - { - if (Source != null) - { - writer.WritePropertyName("source"u8); - writer.WriteObjectValue(Source, options); - } - else - { - writer.WriteNull("source"); - } - } - writer.WritePropertyName("dataType"u8); - writer.WriteStringValue(DataType.ToString()); - writer.WritePropertyName("dataUri"u8); - writer.WriteStringValue(DataUri.AbsoluteUri); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } - if (Optional.IsDefined(IsAnonymous)) - { - writer.WritePropertyName("isAnonymous"u8); - writer.WriteBooleanValue(IsAnonymous.Value); - } - if (Optional.IsDefined(IsArchived)) - { - writer.WritePropertyName("isArchived"u8); - writer.WriteBooleanValue(IsArchived.Value); - } - if (Optional.IsDefined(Description)) - { - if (Description != null) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - else - { - writer.WriteNull("description"); - } - } - if (Optional.IsCollectionDefined(Properties)) - { - if (Properties != null) - { - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("properties"); - } - } - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags != null) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("tags"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataImport 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(DataImport)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataImport(document.RootElement, options); - } - - internal static DataImport DeserializeDataImport(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string assetName = default; - DataImportSource source = default; - MachineLearningDataType dataType = default; - Uri dataUri = default; - IntellectualProperty intellectualProperty = default; - string stage = default; - AutoDeleteSetting autoDeleteSetting = default; - bool? isAnonymous = default; - bool? isArchived = default; - string description = default; - IDictionary properties = default; - IDictionary tags = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("source"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - source = null; - continue; - } - source = DataImportSource.DeserializeDataImportSource(property.Value, options); - continue; - } - if (property.NameEquals("dataType"u8)) - { - dataType = new MachineLearningDataType(property.Value.GetString()); - continue; - } - if (property.NameEquals("dataUri"u8)) - { - dataUri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } - if (property.NameEquals("stage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - stage = null; - continue; - } - stage = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } - if (property.NameEquals("isAnonymous"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isAnonymous = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isArchived"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isArchived = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("description"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - description = null; - continue; - } - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - properties = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - properties = dictionary; - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tags = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataImport( - description, - properties ?? new ChangeTrackingDictionary(), - tags ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData, - autoDeleteSetting, - isAnonymous, - isArchived, - dataType, - dataUri, - intellectualProperty, - stage, - assetName, - source); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DataImport)} does not support writing '{options.Format}' format."); - } - } - - DataImport IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataImport(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataImport)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.cs deleted file mode 100644 index 683e6b78bbeb1..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The DataImport. - public partial class DataImport : MachineLearningDataVersionProperties - { - /// Initializes a new instance of . - /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// is null. - public DataImport(Uri dataUri) : base(dataUri) - { - Argument.AssertNotNull(dataUri, nameof(dataUri)); - - DataType = MachineLearningDataType.UriFolder; - } - - /// Initializes a new instance of . - /// The asset description text. - /// The asset property dictionary. - /// Tag dictionary. Tags can be added, removed, and updated. - /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. - /// [Required] Specifies the type of data. - /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// Intellectual Property details. Used if data is an Intellectual Property. - /// Stage in the data lifecycle assigned to this data asset. - /// Name of the asset for data import job to create. - /// - /// Source data of the asset to import from - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - internal DataImport(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IntellectualProperty intellectualProperty, string stage, string assetName, DataImportSource source) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived, dataType, dataUri, intellectualProperty, stage) - { - AssetName = assetName; - Source = source; - DataType = dataType; - } - - /// Initializes a new instance of for deserialization. - internal DataImport() - { - } - - /// Name of the asset for data import job to create. - public string AssetName { get; set; } - /// - /// Source data of the asset to import from - /// 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 DataImportSource Source { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.Serialization.cs deleted file mode 100644 index 9e7d478387162..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.Serialization.cs +++ /dev/null @@ -1,123 +0,0 @@ -// 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.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownDataImportSource))] - public partial class DataImportSource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataImportSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Connection)) - { - if (Connection != null) - { - writer.WritePropertyName("connection"u8); - writer.WriteStringValue(Connection); - } - else - { - writer.WriteNull("connection"); - } - } - writer.WritePropertyName("sourceType"u8); - writer.WriteStringValue(SourceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataImportSource 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(DataImportSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataImportSource(document.RootElement, options); - } - - internal static DataImportSource DeserializeDataImportSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("sourceType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "database": return DatabaseSource.DeserializeDatabaseSource(element, options); - case "file_system": return FileSystemSource.DeserializeFileSystemSource(element, options); - } - } - return UnknownDataImportSource.DeserializeUnknownDataImportSource(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); - default: - throw new FormatException($"The model {nameof(DataImportSource)} does not support writing '{options.Format}' format."); - } - } - - DataImportSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataImportSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataImportSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSourceType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSourceType.cs deleted file mode 100644 index aab5956201d6d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSourceType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Enum to determine the type of data. - internal readonly partial struct DataImportSourceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DataImportSourceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DatabaseValue = "database"; - private const string FileSystemValue = "file_system"; - - /// database. - public static DataImportSourceType Database { get; } = new DataImportSourceType(DatabaseValue); - /// file_system. - public static DataImportSourceType FileSystem { get; } = new DataImportSourceType(FileSystemValue); - /// Determines if two values are the same. - public static bool operator ==(DataImportSourceType left, DataImportSourceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DataImportSourceType left, DataImportSourceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DataImportSourceType(string value) => new DataImportSourceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DataImportSourceType other && Equals(other); - /// - public bool Equals(DataImportSourceType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.Serialization.cs index 5c49d8e52292b..a306c83986c8c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.Serialization.cs @@ -44,6 +44,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteNull("featureDataTypeOverride"); } } + if (Optional.IsDefined(FeatureImportanceSettings)) + { + if (FeatureImportanceSettings != null) + { + writer.WritePropertyName("featureImportanceSettings"u8); + writer.WriteObjectValue(FeatureImportanceSettings, options); + } + else + { + writer.WriteNull("featureImportanceSettings"); + } + } if (Optional.IsDefined(Features)) { if (Features != null) @@ -67,10 +79,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteObjectValue(ProductionData, options); writer.WritePropertyName("referenceData"u8); writer.WriteObjectValue(ReferenceData, options); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -131,11 +155,12 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign return null; } IDictionary featureDataTypeOverride = default; + FeatureImportanceSettings featureImportanceSettings = default; MonitoringFeatureFilterBase features = default; IList metricThresholds = default; MonitoringInputDataBase productionData = default; MonitoringInputDataBase referenceData = default; - MonitoringNotificationMode? mode = default; + IList notificationTypes = default; IDictionary properties = default; MonitoringSignalType signalType = default; IDictionary serializedAdditionalRawData = default; @@ -157,6 +182,16 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign featureDataTypeOverride = dictionary; continue; } + if (property.NameEquals("featureImportanceSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureImportanceSettings = null; + continue; + } + featureImportanceSettings = FeatureImportanceSettings.DeserializeFeatureImportanceSettings(property.Value, options); + continue; + } if (property.NameEquals("features"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -187,13 +222,19 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); continue; } - if (property.NameEquals("mode"u8)) + if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + notificationTypes = null; continue; } - mode = new MonitoringNotificationMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MonitoringNotificationType(item.GetString())); + } + notificationTypes = array; continue; } if (property.NameEquals("properties"u8)) @@ -223,11 +264,12 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign } serializedAdditionalRawData = rawDataDictionary; return new DataQualityMonitoringSignal( - mode, + notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData, featureDataTypeOverride ?? new ChangeTrackingDictionary(), + featureImportanceSettings, features, metricThresholds, productionData, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.cs index 0beb09ed161ea..c33c8b7923324 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.cs @@ -23,12 +23,12 @@ public partial class DataQualityMonitoringSignal : MonitoringSignalBase /// /// [Required] The data produced by the production service which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// , or is null. public DataQualityMonitoringSignal(IEnumerable metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) @@ -45,11 +45,12 @@ public DataQualityMonitoringSignal(IEnumerable m } /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. /// A dictionary that maps feature names to their respective data types. + /// The settings for computing feature importance. /// /// The features to calculate drift over. /// 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. @@ -63,16 +64,17 @@ public DataQualityMonitoringSignal(IEnumerable m /// /// [Required] The data produced by the production service which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// - internal DataQualityMonitoringSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, MonitoringFeatureFilterBase features, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(mode, properties, signalType, serializedAdditionalRawData) + internal DataQualityMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, FeatureImportanceSettings featureImportanceSettings, MonitoringFeatureFilterBase features, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) { FeatureDataTypeOverride = featureDataTypeOverride; + FeatureImportanceSettings = featureImportanceSettings; Features = features; MetricThresholds = metricThresholds; ProductionData = productionData; @@ -87,6 +89,8 @@ internal DataQualityMonitoringSignal() /// A dictionary that maps feature names to their respective data types. public IDictionary FeatureDataTypeOverride { get; set; } + /// The settings for computing feature importance. + public FeatureImportanceSettings FeatureImportanceSettings { get; set; } /// /// The features to calculate drift over. /// 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. @@ -102,13 +106,13 @@ internal DataQualityMonitoringSignal() /// /// [Required] The data produced by the production service which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ProductionData { get; set; } /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ReferenceData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.Serialization.cs new file mode 100644 index 0000000000000..fbcec599988b7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.Serialization.cs @@ -0,0 +1,113 @@ +// 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.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + [PersistableModelProxy(typeof(UnknownDataReferenceCredential))] + public partial class DataReferenceCredential : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DataReferenceCredential 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(DataReferenceCredential)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReferenceCredential(document.RootElement, options); + } + + internal static DataReferenceCredential DeserializeDataReferenceCredential(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("credentialType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "DockerCredentials": return DockerCredential.DeserializeDockerCredential(element, options); + case "ManagedIdentity": return ManagedIdentityCredential.DeserializeManagedIdentityCredential(element, options); + case "NoCredentials": return AnonymousAccessCredential.DeserializeAnonymousAccessCredential(element, options); + case "SAS": return SasCredential.DeserializeSasCredential(element, options); + } + } + return UnknownDataReferenceCredential.DeserializeUnknownDataReferenceCredential(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); + default: + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support writing '{options.Format}' format."); + } + } + + DataReferenceCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataReferenceCredential(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.cs similarity index 63% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.cs index ee07f315e4449..089ec7b699bc7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.cs @@ -11,10 +11,11 @@ namespace Azure.ResourceManager.MachineLearning.Models { /// - /// 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 . + /// DataReferenceCredential base class + /// 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 DataImportSource + public abstract partial class DataReferenceCredential { /// /// Keeps track of any properties unknown to the library. @@ -48,25 +49,21 @@ public abstract partial class DataImportSource /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - protected DataImportSource() + /// Initializes a new instance of . + protected DataReferenceCredential() { } - /// Initializes a new instance of . - /// Workspace connection for data import source storage. - /// [Required] Specifies the type of data. + /// Initializes a new instance of . + /// [Required] Credential type used to authentication with storage. /// Keeps track of any properties unknown to the library. - internal DataImportSource(string connection, DataImportSourceType sourceType, IDictionary serializedAdditionalRawData) + internal DataReferenceCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData) { - Connection = connection; - SourceType = sourceType; + CredentialType = credentialType; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Workspace connection for data import source storage. - public string Connection { get; set; } - /// [Required] Specifies the type of data. - internal DataImportSourceType SourceType { get; set; } + /// [Required] Credential type used to authentication with storage. + internal DataReferenceCredentialType CredentialType { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredentialType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredentialType.cs new file mode 100644 index 0000000000000..53ea40481a158 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredentialType.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 Azure.ResourceManager.MachineLearning.Models +{ + /// Enum to determine the DataReference credentials type. + internal readonly partial struct DataReferenceCredentialType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReferenceCredentialType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SasValue = "SAS"; + private const string DockerCredentialsValue = "DockerCredentials"; + private const string ManagedIdentityValue = "ManagedIdentity"; + private const string NoCredentialsValue = "NoCredentials"; + + /// SAS. + public static DataReferenceCredentialType Sas { get; } = new DataReferenceCredentialType(SasValue); + /// DockerCredentials. + public static DataReferenceCredentialType DockerCredentials { get; } = new DataReferenceCredentialType(DockerCredentialsValue); + /// ManagedIdentity. + public static DataReferenceCredentialType ManagedIdentity { get; } = new DataReferenceCredentialType(ManagedIdentityValue); + /// NoCredentials. + public static DataReferenceCredentialType NoCredentials { get; } = new DataReferenceCredentialType(NoCredentialsValue); + /// Determines if two values are the same. + public static bool operator ==(DataReferenceCredentialType left, DataReferenceCredentialType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReferenceCredentialType left, DataReferenceCredentialType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DataReferenceCredentialType(string value) => new DataReferenceCredentialType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReferenceCredentialType other && Equals(other); + /// + public bool Equals(DataReferenceCredentialType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.Serialization.cs deleted file mode 100644 index d25a95f94cbed..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.Serialization.cs +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class DatabaseSource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DatabaseSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Query)) - { - if (Query != null) - { - writer.WritePropertyName("query"u8); - writer.WriteStringValue(Query); - } - else - { - writer.WriteNull("query"); - } - } - if (Optional.IsDefined(StoredProcedure)) - { - if (StoredProcedure != null) - { - writer.WritePropertyName("storedProcedure"u8); - writer.WriteStringValue(StoredProcedure); - } - else - { - writer.WriteNull("storedProcedure"); - } - } - if (Optional.IsCollectionDefined(StoredProcedureParams)) - { - if (StoredProcedureParams != null) - { - writer.WritePropertyName("storedProcedureParams"u8); - writer.WriteStartArray(); - foreach (var item in StoredProcedureParams) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStartObject(); - foreach (var item0 in item) - { - writer.WritePropertyName(item0.Key); - writer.WriteStringValue(item0.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("storedProcedureParams"); - } - } - if (Optional.IsDefined(TableName)) - { - if (TableName != null) - { - writer.WritePropertyName("tableName"u8); - writer.WriteStringValue(TableName); - } - else - { - writer.WriteNull("tableName"); - } - } - if (Optional.IsDefined(Connection)) - { - if (Connection != null) - { - writer.WritePropertyName("connection"u8); - writer.WriteStringValue(Connection); - } - else - { - writer.WriteNull("connection"); - } - } - writer.WritePropertyName("sourceType"u8); - writer.WriteStringValue(SourceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DatabaseSource 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(DatabaseSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDatabaseSource(document.RootElement, options); - } - - internal static DatabaseSource DeserializeDatabaseSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string query = default; - string storedProcedure = default; - IList> storedProcedureParams = default; - string tableName = default; - string connection = default; - DataImportSourceType sourceType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("query"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - query = null; - continue; - } - query = property.Value.GetString(); - continue; - } - if (property.NameEquals("storedProcedure"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - storedProcedure = null; - continue; - } - storedProcedure = property.Value.GetString(); - continue; - } - if (property.NameEquals("storedProcedureParams"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - storedProcedureParams = null; - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in item.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - array.Add(dictionary); - } - } - storedProcedureParams = array; - continue; - } - if (property.NameEquals("tableName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tableName = null; - continue; - } - tableName = property.Value.GetString(); - continue; - } - if (property.NameEquals("connection"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - connection = null; - continue; - } - connection = property.Value.GetString(); - continue; - } - if (property.NameEquals("sourceType"u8)) - { - sourceType = new DataImportSourceType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DatabaseSource( - connection, - sourceType, - serializedAdditionalRawData, - query, - storedProcedure, - storedProcedureParams ?? new ChangeTrackingList>(), - tableName); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DatabaseSource)} does not support writing '{options.Format}' format."); - } - } - - DatabaseSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDatabaseSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DatabaseSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.cs deleted file mode 100644 index 8fe8540dd4173..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The DatabaseSource. - public partial class DatabaseSource : DataImportSource - { - /// Initializes a new instance of . - public DatabaseSource() - { - StoredProcedureParams = new ChangeTrackingList>(); - SourceType = DataImportSourceType.Database; - } - - /// Initializes a new instance of . - /// Workspace connection for data import source storage. - /// [Required] Specifies the type of data. - /// Keeps track of any properties unknown to the library. - /// SQL Query statement for data import Database source. - /// SQL StoredProcedure on data import Database source. - /// SQL StoredProcedure parameters. - /// Name of the table on data import Database source. - internal DatabaseSource(string connection, DataImportSourceType sourceType, IDictionary serializedAdditionalRawData, string query, string storedProcedure, IList> storedProcedureParams, string tableName) : base(connection, sourceType, serializedAdditionalRawData) - { - Query = query; - StoredProcedure = storedProcedure; - StoredProcedureParams = storedProcedureParams; - TableName = tableName; - SourceType = sourceType; - } - - /// SQL Query statement for data import Database source. - public string Query { get; set; } - /// SQL StoredProcedure on data import Database source. - public string StoredProcedure { get; set; } - /// SQL StoredProcedure parameters. - public IList> StoredProcedureParams { get; set; } - /// Name of the table on data import Database source. - public string TableName { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.Serialization.cs deleted file mode 100644 index 4d2dd07a9bbff..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.Serialization.cs +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class DatasetExportSummary : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DatasetExportSummary)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(LabeledAssetName)) - { - if (LabeledAssetName != null) - { - writer.WritePropertyName("labeledAssetName"u8); - writer.WriteStringValue(LabeledAssetName); - } - else - { - writer.WriteNull("labeledAssetName"); - } - } - if (options.Format != "W" && Optional.IsDefined(EndOn)) - { - if (EndOn != null) - { - writer.WritePropertyName("endDateTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - else - { - writer.WriteNull("endDateTime"); - } - } - if (options.Format != "W" && Optional.IsDefined(ExportedRowCount)) - { - if (ExportedRowCount != null) - { - writer.WritePropertyName("exportedRowCount"u8); - writer.WriteNumberValue(ExportedRowCount.Value); - } - else - { - writer.WriteNull("exportedRowCount"); - } - } - writer.WritePropertyName("format"u8); - writer.WriteStringValue(Format.ToString()); - if (options.Format != "W" && Optional.IsDefined(LabelingJobId)) - { - if (LabelingJobId != null) - { - writer.WritePropertyName("labelingJobId"u8); - writer.WriteStringValue(LabelingJobId); - } - else - { - writer.WriteNull("labelingJobId"); - } - } - if (options.Format != "W" && Optional.IsDefined(StartOn)) - { - if (StartOn != null) - { - writer.WritePropertyName("startDateTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - else - { - writer.WriteNull("startDateTime"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DatasetExportSummary 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(DatasetExportSummary)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDatasetExportSummary(document.RootElement, options); - } - - internal static DatasetExportSummary DeserializeDatasetExportSummary(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string labeledAssetName = default; - DateTimeOffset? endDateTime = default; - long? exportedRowCount = default; - ExportFormatType format = default; - string labelingJobId = default; - DateTimeOffset? startDateTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("labeledAssetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labeledAssetName = null; - continue; - } - labeledAssetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("endDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - endDateTime = null; - continue; - } - endDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("exportedRowCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - exportedRowCount = null; - continue; - } - exportedRowCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("format"u8)) - { - format = new ExportFormatType(property.Value.GetString()); - continue; - } - if (property.NameEquals("labelingJobId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labelingJobId = null; - continue; - } - labelingJobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("startDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - startDateTime = null; - continue; - } - startDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DatasetExportSummary( - endDateTime, - exportedRowCount, - format, - labelingJobId, - startDateTime, - serializedAdditionalRawData, - labeledAssetName); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DatasetExportSummary)} does not support writing '{options.Format}' format."); - } - } - - DatasetExportSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDatasetExportSummary(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DatasetExportSummary)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.cs deleted file mode 100644 index 8dd335d9531de..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The DatasetExportSummary. - public partial class DatasetExportSummary : ExportSummary - { - /// Initializes a new instance of . - public DatasetExportSummary() - { - Format = ExportFormatType.Dataset; - } - - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// [Required] The format of exported labels, also as the discriminator. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// Keeps track of any properties unknown to the library. - /// The unique name of the labeled data asset. - internal DatasetExportSummary(DateTimeOffset? endOn, long? exportedRowCount, ExportFormatType format, string labelingJobId, DateTimeOffset? startOn, IDictionary serializedAdditionalRawData, string labeledAssetName) : base(endOn, exportedRowCount, format, labelingJobId, startOn, serializedAdditionalRawData) - { - LabeledAssetName = labeledAssetName; - Format = format; - } - - /// The unique name of the labeled data asset. - public string LabeledAssetName { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatastoreType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatastoreType.cs index 5fa1aabc66cbe..222080975d92d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatastoreType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatastoreType.cs @@ -26,7 +26,6 @@ public DatastoreType(string value) private const string AzureDataLakeGen1Value = "AzureDataLakeGen1"; private const string AzureDataLakeGen2Value = "AzureDataLakeGen2"; private const string AzureFileValue = "AzureFile"; - private const string HdfsValue = "Hdfs"; private const string OneLakeValue = "OneLake"; /// AzureBlob. @@ -37,8 +36,6 @@ public DatastoreType(string value) public static DatastoreType AzureDataLakeGen2 { get; } = new DatastoreType(AzureDataLakeGen2Value); /// AzureFile. public static DatastoreType AzureFile { get; } = new DatastoreType(AzureFileValue); - /// Hdfs. - public static DatastoreType Hdfs { get; } = new DatastoreType(HdfsValue); /// OneLake. public static DatastoreType OneLake { get; } = new DatastoreType(OneLakeValue); /// Determines if two values are the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DefaultResourceProvisioningState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DefaultResourceProvisioningState.cs new file mode 100644 index 0000000000000..86281efb3fc5e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DefaultResourceProvisioningState.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The DefaultResourceProvisioningState. + public readonly partial struct DefaultResourceProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DefaultResourceProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string FailedValue = "Failed"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string SucceededValue = "Succeeded"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + private const string CanceledValue = "Canceled"; + private const string ScalingValue = "Scaling"; + private const string DisabledValue = "Disabled"; + + /// NotStarted. + public static DefaultResourceProvisioningState NotStarted { get; } = new DefaultResourceProvisioningState(NotStartedValue); + /// Failed. + public static DefaultResourceProvisioningState Failed { get; } = new DefaultResourceProvisioningState(FailedValue); + /// Creating. + public static DefaultResourceProvisioningState Creating { get; } = new DefaultResourceProvisioningState(CreatingValue); + /// Updating. + public static DefaultResourceProvisioningState Updating { get; } = new DefaultResourceProvisioningState(UpdatingValue); + /// Succeeded. + public static DefaultResourceProvisioningState Succeeded { get; } = new DefaultResourceProvisioningState(SucceededValue); + /// Deleting. + public static DefaultResourceProvisioningState Deleting { get; } = new DefaultResourceProvisioningState(DeletingValue); + /// Accepted. + public static DefaultResourceProvisioningState Accepted { get; } = new DefaultResourceProvisioningState(AcceptedValue); + /// Canceled. + public static DefaultResourceProvisioningState Canceled { get; } = new DefaultResourceProvisioningState(CanceledValue); + /// Scaling. + public static DefaultResourceProvisioningState Scaling { get; } = new DefaultResourceProvisioningState(ScalingValue); + /// Disabled. + public static DefaultResourceProvisioningState Disabled { get; } = new DefaultResourceProvisioningState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(DefaultResourceProvisioningState left, DefaultResourceProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DefaultResourceProvisioningState left, DefaultResourceProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DefaultResourceProvisioningState(string value) => new DefaultResourceProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DefaultResourceProvisioningState other && Equals(other); + /// + public bool Equals(DefaultResourceProvisioningState 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DeploymentModelVersionUpgradeOption.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DeploymentModelVersionUpgradeOption.cs new file mode 100644 index 0000000000000..71e8365741da1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DeploymentModelVersionUpgradeOption.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Deployment model version upgrade option. + public readonly partial struct DeploymentModelVersionUpgradeOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DeploymentModelVersionUpgradeOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OnceNewDefaultVersionAvailableValue = "OnceNewDefaultVersionAvailable"; + private const string OnceCurrentVersionExpiredValue = "OnceCurrentVersionExpired"; + private const string NoAutoUpgradeValue = "NoAutoUpgrade"; + + /// OnceNewDefaultVersionAvailable. + public static DeploymentModelVersionUpgradeOption OnceNewDefaultVersionAvailable { get; } = new DeploymentModelVersionUpgradeOption(OnceNewDefaultVersionAvailableValue); + /// OnceCurrentVersionExpired. + public static DeploymentModelVersionUpgradeOption OnceCurrentVersionExpired { get; } = new DeploymentModelVersionUpgradeOption(OnceCurrentVersionExpiredValue); + /// NoAutoUpgrade. + public static DeploymentModelVersionUpgradeOption NoAutoUpgrade { get; } = new DeploymentModelVersionUpgradeOption(NoAutoUpgradeValue); + /// Determines if two values are the same. + public static bool operator ==(DeploymentModelVersionUpgradeOption left, DeploymentModelVersionUpgradeOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DeploymentModelVersionUpgradeOption left, DeploymentModelVersionUpgradeOption right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DeploymentModelVersionUpgradeOption(string value) => new DeploymentModelVersionUpgradeOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DeploymentModelVersionUpgradeOption other && Equals(other); + /// + public bool Equals(DeploymentModelVersionUpgradeOption 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessage.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.Serialization.cs similarity index 54% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessage.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.Serialization.cs index 3bc30bf691917..df0e662e5b33b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessage.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.Serialization.cs @@ -13,58 +13,53 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class JobStatusMessage : IUtf8JsonSerializable, IJsonModel + public partial class DestinationAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(JobStatusMessage)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DestinationAsset)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Code)) + if (Optional.IsDefined(DestinationName)) { - if (Code != null) + if (DestinationName != null) { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); + writer.WritePropertyName("destinationName"u8); + writer.WriteStringValue(DestinationName); } else { - writer.WriteNull("code"); + writer.WriteNull("destinationName"); } } - if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + if (Optional.IsDefined(DestinationVersion)) { - if (CreatedOn != null) + if (DestinationVersion != null) { - writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedOn.Value, "O"); + writer.WritePropertyName("destinationVersion"u8); + writer.WriteStringValue(DestinationVersion); } else { - writer.WriteNull("createdDateTime"); + writer.WriteNull("destinationVersion"); } } - if (options.Format != "W" && Optional.IsDefined(Level)) + if (Optional.IsDefined(RegistryName)) { - writer.WritePropertyName("level"u8); - writer.WriteStringValue(Level.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(Message)) - { - if (Message != null) + if (RegistryName != null) { - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); + writer.WritePropertyName("registryName"u8); + writer.WriteStringValue(RegistryName); } else { - writer.WriteNull("message"); + writer.WriteNull("registryName"); } } if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -85,19 +80,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WriteEndObject(); } - JobStatusMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DestinationAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(JobStatusMessage)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DestinationAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeJobStatusMessage(document.RootElement, options); + return DeserializeDestinationAsset(document.RootElement, options); } - internal static JobStatusMessage DeserializeJobStatusMessage(JsonElement element, ModelReaderWriterOptions options = null) + internal static DestinationAsset DeserializeDestinationAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -105,51 +100,41 @@ internal static JobStatusMessage DeserializeJobStatusMessage(JsonElement element { return null; } - string code = default; - DateTimeOffset? createdDateTime = default; - JobStatusMessageLevel? level = default; - string message = default; + string destinationName = default; + string destinationVersion = default; + string registryName = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - code = null; - continue; - } - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) + if (property.NameEquals("destinationName"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - createdDateTime = null; + destinationName = null; continue; } - createdDateTime = property.Value.GetDateTimeOffset("O"); + destinationName = property.Value.GetString(); continue; } - if (property.NameEquals("level"u8)) + if (property.NameEquals("destinationVersion"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + destinationVersion = null; continue; } - level = new JobStatusMessageLevel(property.Value.GetString()); + destinationVersion = property.Value.GetString(); continue; } - if (property.NameEquals("message"u8)) + if (property.NameEquals("registryName"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - message = null; + registryName = null; continue; } - message = property.Value.GetString(); + registryName = property.Value.GetString(); continue; } if (options.Format != "W") @@ -158,38 +143,38 @@ internal static JobStatusMessage DeserializeJobStatusMessage(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new JobStatusMessage(code, createdDateTime, level, message, serializedAdditionalRawData); + return new DestinationAsset(destinationName, destinationVersion, registryName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(JobStatusMessage)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DestinationAsset)} does not support writing '{options.Format}' format."); } } - JobStatusMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DestinationAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeJobStatusMessage(document.RootElement, options); + return DeserializeDestinationAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(JobStatusMessage)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DestinationAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs new file mode 100644 index 0000000000000..bece271ecb213 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Publishing destination registry asset information. + public partial class DestinationAsset + { + /// + /// 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 . + public DestinationAsset() + { + } + + /// Initializes a new instance of . + /// Destination asset name. + /// Destination asset version. + /// Destination registry name. + /// Keeps track of any properties unknown to the library. + internal DestinationAsset(string destinationName, string destinationVersion, string registryName, IDictionary serializedAdditionalRawData) + { + DestinationName = destinationName; + DestinationVersion = destinationVersion; + RegistryName = registryName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Destination asset name. + public string DestinationName { get; set; } + /// Destination asset version. + public string DestinationVersion { get; set; } + /// Destination registry name. + public string RegistryName { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DistributionType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DistributionType.cs index 0cda26ca37d6a..568146f816a64 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DistributionType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DistributionType.cs @@ -25,7 +25,6 @@ public DistributionType(string value) private const string PyTorchValue = "PyTorch"; private const string TensorFlowValue = "TensorFlow"; private const string MpiValue = "Mpi"; - private const string RayValue = "Ray"; /// PyTorch. public static DistributionType PyTorch { get; } = new DistributionType(PyTorchValue); @@ -33,8 +32,6 @@ public DistributionType(string value) public static DistributionType TensorFlow { get; } = new DistributionType(TensorFlowValue); /// Mpi. public static DistributionType Mpi { get; } = new DistributionType(MpiValue); - /// Ray. - public static DistributionType Ray { get; } = new DistributionType(RayValue); /// Determines if two values are the same. public static bool operator ==(DistributionType left, DistributionType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.Serialization.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.Serialization.cs index c41d6df8d6148..7803315daf2e1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.Serialization.cs @@ -13,45 +13,45 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class FileSystemSource : IUtf8JsonSerializable, IJsonModel + public partial class DockerCredential : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(FileSystemSource)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DockerCredential)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Path)) + if (Optional.IsDefined(Password)) { - if (Path != null) + if (Password != null) { - writer.WritePropertyName("path"u8); - writer.WriteStringValue(Path); + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); } else { - writer.WriteNull("path"); + writer.WriteNull("password"); } } - if (Optional.IsDefined(Connection)) + if (Optional.IsDefined(UserName)) { - if (Connection != null) + if (UserName != null) { - writer.WritePropertyName("connection"u8); - writer.WriteStringValue(Connection); + writer.WritePropertyName("userName"u8); + writer.WriteStringValue(UserName); } else { - writer.WriteNull("connection"); + writer.WriteNull("userName"); } } - writer.WritePropertyName("sourceType"u8); - writer.WriteStringValue(SourceType.ToString()); + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -70,19 +70,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WriteEndObject(); } - FileSystemSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DockerCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(FileSystemSource)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DockerCredential)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeFileSystemSource(document.RootElement, options); + return DeserializeDockerCredential(document.RootElement, options); } - internal static FileSystemSource DeserializeFileSystemSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static DockerCredential DeserializeDockerCredential(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -90,36 +90,36 @@ internal static FileSystemSource DeserializeFileSystemSource(JsonElement element { return null; } - string path = default; - string connection = default; - DataImportSourceType sourceType = default; + string password = default; + string userName = default; + DataReferenceCredentialType credentialType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("path"u8)) + if (property.NameEquals("password"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - path = null; + password = null; continue; } - path = property.Value.GetString(); + password = property.Value.GetString(); continue; } - if (property.NameEquals("connection"u8)) + if (property.NameEquals("userName"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - connection = null; + userName = null; continue; } - connection = property.Value.GetString(); + userName = property.Value.GetString(); continue; } - if (property.NameEquals("sourceType"u8)) + if (property.NameEquals("credentialType"u8)) { - sourceType = new DataImportSourceType(property.Value.GetString()); + credentialType = new DataReferenceCredentialType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -128,38 +128,38 @@ internal static FileSystemSource DeserializeFileSystemSource(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new FileSystemSource(connection, sourceType, serializedAdditionalRawData, path); + return new DockerCredential(credentialType, serializedAdditionalRawData, password, userName); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(FileSystemSource)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DockerCredential)} does not support writing '{options.Format}' format."); } } - FileSystemSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DockerCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeFileSystemSource(document.RootElement, options); + return DeserializeDockerCredential(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(FileSystemSource)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DockerCredential)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.cs new file mode 100644 index 0000000000000..6d43ca5bb6c33 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Credential for docker with username and password. + public partial class DockerCredential : DataReferenceCredential + { + /// Initializes a new instance of . + internal DockerCredential() + { + CredentialType = DataReferenceCredentialType.DockerCredentials; + } + + /// Initializes a new instance of . + /// [Required] Credential type used to authentication with storage. + /// Keeps track of any properties unknown to the library. + /// DockerCredential user password. + /// DockerCredential user name. + internal DockerCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData, string password, string userName) : base(credentialType, serializedAdditionalRawData) + { + Password = password; + UserName = userName; + CredentialType = credentialType; + } + + /// DockerCredential user password. + public string Password { get; } + /// DockerCredential user name. + public string UserName { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.Serialization.cs deleted file mode 100644 index 7dad14ba63cb0..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class EmailMonitoringAlertNotificationSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(EmailMonitoringAlertNotificationSettings)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(EmailNotificationSetting)) - { - if (EmailNotificationSetting != null) - { - writer.WritePropertyName("emailNotificationSetting"u8); - writer.WriteObjectValue(EmailNotificationSetting, options); - } - else - { - writer.WriteNull("emailNotificationSetting"); - } - } - writer.WritePropertyName("alertNotificationType"u8); - writer.WriteStringValue(AlertNotificationType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - EmailMonitoringAlertNotificationSettings 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(EmailMonitoringAlertNotificationSettings)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEmailMonitoringAlertNotificationSettings(document.RootElement, options); - } - - internal static EmailMonitoringAlertNotificationSettings DeserializeEmailMonitoringAlertNotificationSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - NotificationSetting emailNotificationSetting = default; - MonitoringAlertNotificationType alertNotificationType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("emailNotificationSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - emailNotificationSetting = null; - continue; - } - emailNotificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); - continue; - } - if (property.NameEquals("alertNotificationType"u8)) - { - alertNotificationType = new MonitoringAlertNotificationType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new EmailMonitoringAlertNotificationSettings(alertNotificationType, serializedAdditionalRawData, emailNotificationSetting); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(EmailMonitoringAlertNotificationSettings)} does not support writing '{options.Format}' format."); - } - } - - EmailMonitoringAlertNotificationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEmailMonitoringAlertNotificationSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(EmailMonitoringAlertNotificationSettings)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.cs deleted file mode 100644 index fe3c912a69315..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The EmailMonitoringAlertNotificationSettings. - public partial class EmailMonitoringAlertNotificationSettings : MonitoringAlertNotificationSettingsBase - { - /// Initializes a new instance of . - public EmailMonitoringAlertNotificationSettings() - { - AlertNotificationType = MonitoringAlertNotificationType.Email; - } - - /// Initializes a new instance of . - /// [Required] Specifies the type of signal to monitor. - /// Keeps track of any properties unknown to the library. - /// Configuration for notification. - internal EmailMonitoringAlertNotificationSettings(MonitoringAlertNotificationType alertNotificationType, IDictionary serializedAdditionalRawData, NotificationSetting emailNotificationSetting) : base(alertNotificationType, serializedAdditionalRawData) - { - EmailNotificationSetting = emailNotificationSetting; - AlertNotificationType = alertNotificationType; - } - - /// Configuration for notification. - public NotificationSetting EmailNotificationSetting { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.Serialization.cs similarity index 53% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.Serialization.cs index 600b2c5d349e6..292c2d1cbcdff 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.Serialization.cs @@ -13,33 +13,39 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class CustomInferencingServer : IUtf8JsonSerializable, IJsonModel + public partial class EndpointDeploymentModel : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CustomInferencingServer)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EndpointDeploymentModel)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(InferenceConfiguration)) + if (Optional.IsDefined(Format)) { - if (InferenceConfiguration != null) - { - writer.WritePropertyName("inferenceConfiguration"u8); - writer.WriteObjectValue(InferenceConfiguration, options); - } - else - { - writer.WriteNull("inferenceConfiguration"); - } + writer.WritePropertyName("format"u8); + writer.WriteStringValue(Format); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); } - writer.WritePropertyName("serverType"u8); - writer.WriteStringValue(ServerType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +64,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndObject(); } - CustomInferencingServer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EndpointDeploymentModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CustomInferencingServer)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EndpointDeploymentModel)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCustomInferencingServer(document.RootElement, options); + return DeserializeEndpointDeploymentModel(document.RootElement, options); } - internal static CustomInferencingServer DeserializeCustomInferencingServer(JsonElement element, ModelReaderWriterOptions options = null) + internal static EndpointDeploymentModel DeserializeEndpointDeploymentModel(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +84,32 @@ internal static CustomInferencingServer DeserializeCustomInferencingServer(JsonE { return null; } - OnlineInferenceConfiguration inferenceConfiguration = default; - InferencingServerType serverType = default; + string format = default; + string name = default; + string source = default; + string version = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("inferenceConfiguration"u8)) + if (property.NameEquals("format"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - inferenceConfiguration = null; - continue; - } - inferenceConfiguration = OnlineInferenceConfiguration.DeserializeOnlineInferenceConfiguration(property.Value, options); + format = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); continue; } - if (property.NameEquals("serverType"u8)) + if (property.NameEquals("version"u8)) { - serverType = new InferencingServerType(property.Value.GetString()); + version = property.Value.GetString(); continue; } if (options.Format != "W") @@ -105,38 +118,38 @@ internal static CustomInferencingServer DeserializeCustomInferencingServer(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new CustomInferencingServer(serverType, serializedAdditionalRawData, inferenceConfiguration); + return new EndpointDeploymentModel(format, name, source, version, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(CustomInferencingServer)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EndpointDeploymentModel)} does not support writing '{options.Format}' format."); } } - CustomInferencingServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EndpointDeploymentModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCustomInferencingServer(document.RootElement, options); + return DeserializeEndpointDeploymentModel(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(CustomInferencingServer)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EndpointDeploymentModel)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.cs new file mode 100644 index 0000000000000..4e1d3dc918e34 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointDeploymentModel. + public partial class EndpointDeploymentModel + { + /// + /// 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 . + public EndpointDeploymentModel() + { + } + + /// Initializes a new instance of . + /// Model format. + /// Model name. + /// Optional. Deployment model source ARM resource ID. + /// Model version. + /// Keeps track of any properties unknown to the library. + internal EndpointDeploymentModel(string format, string name, string source, string version, IDictionary serializedAdditionalRawData) + { + Format = format; + Name = name; + Source = source; + Version = version; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Model format. + public string Format { get; set; } + /// Model name. + public string Name { get; set; } + /// Optional. Deployment model source ARM resource ID. + public string Source { get; set; } + /// Model version. + public string Version { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..e18d89d0b9391 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,123 @@ +// 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.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + [PersistableModelProxy(typeof(UnknownEndpointDeploymentResourceProperties))] + public partial class EndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentResourceProperties 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(EndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static EndpointDeploymentResourceProperties DeserializeEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Azure.ContentSafety": return ContentSafetyEndpointDeploymentResourceProperties.DeserializeContentSafetyEndpointDeploymentResourceProperties(element, options); + case "Azure.OpenAI": return OpenAIEndpointDeploymentResourceProperties.DeserializeOpenAIEndpointDeploymentResourceProperties(element, options); + case "Azure.Speech": return SpeechEndpointDeploymentResourceProperties.DeserializeSpeechEndpointDeploymentResourceProperties(element, options); + case "managedOnlineEndpoint": return ManagedOnlineEndpointDeploymentResourceProperties.DeserializeManagedOnlineEndpointDeploymentResourceProperties(element, options); + } + } + return UnknownEndpointDeploymentResourceProperties.DeserializeUnknownEndpointDeploymentResourceProperties(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); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.cs new file mode 100644 index 0000000000000..15de34853098b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.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; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// + /// 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 EndpointDeploymentResourceProperties + { + /// + /// 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 EndpointDeploymentResourceProperties() + { + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + internal EndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData) + { + FailureReason = failureReason; + ProvisioningState = provisioningState; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The failure reason if the creation failed. + public string FailureReason { get; set; } + /// Read-only provision state status property. + public DefaultResourceProvisioningState? ProvisioningState { get; } + /// Kind of the deployment. + internal string EndpointDeploymentResourcePropertiesType { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 0000000000000..22be7b3575b8b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult 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(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 0000000000000..6dc73af1f1d14 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult. + internal partial class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult + { + /// + /// 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 EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutologgerSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutologgerSettings.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs index 90dc15bb5338b..a8b023c028a57 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutologgerSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class AutologgerSettings : IUtf8JsonSerializable, IJsonModel + public partial class EndpointKeys : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AutologgerSettings)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EndpointKeys)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("mlflowAutologger"u8); - writer.WriteStringValue(MlflowAutologger.ToString()); + if (Optional.IsDefined(Keys)) + { + writer.WritePropertyName("keys"u8); + writer.WriteObjectValue(Keys, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - AutologgerSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EndpointKeys IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AutologgerSettings)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EndpointKeys)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAutologgerSettings(document.RootElement, options); + return DeserializeEndpointKeys(document.RootElement, options); } - internal static AutologgerSettings DeserializeAutologgerSettings(JsonElement element, ModelReaderWriterOptions options = null) + internal static EndpointKeys DeserializeEndpointKeys(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +69,18 @@ internal static AutologgerSettings DeserializeAutologgerSettings(JsonElement ele { return null; } - MachineLearningFlowAutoLoggerState mlflowAutologger = default; + AccountApiKeys keys = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mlflowAutologger"u8)) + if (property.NameEquals("keys"u8)) { - mlflowAutologger = new MachineLearningFlowAutoLoggerState(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keys = AccountApiKeys.DeserializeAccountApiKeys(property.Value, options); continue; } if (options.Format != "W") @@ -82,38 +89,38 @@ internal static AutologgerSettings DeserializeAutologgerSettings(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new AutologgerSettings(mlflowAutologger, serializedAdditionalRawData); + return new EndpointKeys(keys, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AutologgerSettings)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EndpointKeys)} does not support writing '{options.Format}' format."); } } - AutologgerSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EndpointKeys IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAutologgerSettings(document.RootElement, options); + return DeserializeEndpointKeys(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AutologgerSettings)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EndpointKeys)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobInstructions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.cs similarity index 71% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobInstructions.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.cs index c5e34f1bdd178..e4909d100d654 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobInstructions.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Instructions for labeling job. - internal partial class LabelingJobInstructions + /// The EndpointKeys. + public partial class EndpointKeys { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,21 @@ internal partial class LabelingJobInstructions /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public LabelingJobInstructions() + /// Initializes a new instance of . + internal EndpointKeys() { } - /// Initializes a new instance of . - /// The link to a page with detailed labeling instructions for labelers. + /// Initializes a new instance of . + /// Dictionary of Keys for the endpoint. /// Keeps track of any properties unknown to the library. - internal LabelingJobInstructions(Uri uri, IDictionary serializedAdditionalRawData) + internal EndpointKeys(AccountApiKeys keys, IDictionary serializedAdditionalRawData) { - Uri = uri; + Keys = keys; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The link to a page with detailed labeling instructions for labelers. - public Uri Uri { get; set; } + /// Dictionary of Keys for the endpoint. + public AccountApiKeys Keys { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.Serialization.cs new file mode 100644 index 0000000000000..237093c21ec16 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelDeprecationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelDeprecationProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(FineTune)) + { + writer.WritePropertyName("fineTune"u8); + writer.WriteStringValue(FineTune.Value, "O"); + } + if (Optional.IsDefined(Inference)) + { + writer.WritePropertyName("inference"u8); + writer.WriteStringValue(Inference.Value, "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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelDeprecationProperties 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(EndpointModelDeprecationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelDeprecationProperties(document.RootElement, options); + } + + internal static EndpointModelDeprecationProperties DeserializeEndpointModelDeprecationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? fineTune = default; + DateTimeOffset? inference = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fineTune"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fineTune = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("inference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inference = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelDeprecationProperties(fineTune, inference, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelDeprecationProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelDeprecationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelDeprecationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelDeprecationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.cs new file mode 100644 index 0000000000000..dd07142c21de8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelDeprecationProperties. + public partial class EndpointModelDeprecationProperties + { + /// + /// 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 EndpointModelDeprecationProperties() + { + } + + /// Initializes a new instance of . + /// The datetime of deprecation of the fineTune Model. + /// The datetime of deprecation of the inference Model. + /// Keeps track of any properties unknown to the library. + internal EndpointModelDeprecationProperties(DateTimeOffset? fineTune, DateTimeOffset? inference, IDictionary serializedAdditionalRawData) + { + FineTune = fineTune; + Inference = inference; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The datetime of deprecation of the fineTune Model. + public DateTimeOffset? FineTune { get; } + /// The datetime of deprecation of the inference Model. + public DateTimeOffset? Inference { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.Serialization.cs new file mode 100644 index 0000000000000..6b63c91cf7e41 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.Serialization.cs @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Capabilities)) + { + writer.WritePropertyName("capabilities"u8); + writer.WriteStartObject(); + foreach (var item in Capabilities) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Deprecation)) + { + writer.WritePropertyName("deprecation"u8); + writer.WriteObjectValue(Deprecation, options); + } + if (Optional.IsCollectionDefined(FinetuneCapabilities)) + { + writer.WritePropertyName("finetuneCapabilities"u8); + writer.WriteStartObject(); + foreach (var item in FinetuneCapabilities) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Format)) + { + writer.WritePropertyName("format"u8); + writer.WriteStringValue(Format); + } + if (Optional.IsDefined(IsDefaultVersion)) + { + writer.WritePropertyName("isDefaultVersion"u8); + writer.WriteBooleanValue(IsDefaultVersion.Value); + } + if (Optional.IsDefined(LifecycleStatus)) + { + writer.WritePropertyName("lifecycleStatus"u8); + writer.WriteStringValue(LifecycleStatus.Value.ToString()); + } + if (Optional.IsDefined(MaxCapacity)) + { + writer.WritePropertyName("maxCapacity"u8); + writer.WriteNumberValue(MaxCapacity.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(Skus)) + { + writer.WritePropertyName("skus"u8); + writer.WriteStartArray(); + foreach (var item in Skus) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelProperties 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(EndpointModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelProperties(document.RootElement, options); + } + + internal static EndpointModelProperties DeserializeEndpointModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary capabilities = default; + EndpointModelDeprecationProperties deprecation = default; + IReadOnlyDictionary finetuneCapabilities = default; + string format = default; + bool? isDefaultVersion = default; + ModelLifecycleStatus? lifecycleStatus = default; + int? maxCapacity = default; + string name = default; + IReadOnlyList skus = default; + SystemData systemData = default; + string version = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + capabilities = dictionary; + continue; + } + if (property.NameEquals("deprecation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deprecation = EndpointModelDeprecationProperties.DeserializeEndpointModelDeprecationProperties(property.Value, options); + continue; + } + if (property.NameEquals("finetuneCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + finetuneCapabilities = dictionary; + continue; + } + if (property.NameEquals("format"u8)) + { + format = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDefaultVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDefaultVersion = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lifecycleStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleStatus = new ModelLifecycleStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("maxCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxCapacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("skus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelSkuProperties.DeserializeEndpointModelSkuProperties(item, options)); + } + skus = array; + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelProperties( + capabilities ?? new ChangeTrackingDictionary(), + deprecation, + finetuneCapabilities ?? new ChangeTrackingDictionary(), + format, + isDefaultVersion, + lifecycleStatus, + maxCapacity, + name, + skus ?? new ChangeTrackingList(), + systemData, + version, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.cs new file mode 100644 index 0000000000000..a3b90e45318de --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.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 Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Endpoint Model properties. + public partial class EndpointModelProperties + { + /// + /// 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 EndpointModelProperties() + { + Capabilities = new ChangeTrackingDictionary(); + FinetuneCapabilities = new ChangeTrackingDictionary(); + Skus = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The capabilities. + /// + /// The capabilities for finetune models. + /// Deployment model format. + /// If the model is default version. + /// Model lifecycle status. + /// The max capacity. + /// Deployment model name. + /// The list of Model Sku. + /// Metadata pertaining to creation and last modification of the resource. + /// Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version is different for different models and might change when there is new version available for a model. Default version for a model could be found from list models API. + /// Keeps track of any properties unknown to the library. + internal EndpointModelProperties(IReadOnlyDictionary capabilities, EndpointModelDeprecationProperties deprecation, IReadOnlyDictionary finetuneCapabilities, string format, bool? isDefaultVersion, ModelLifecycleStatus? lifecycleStatus, int? maxCapacity, string name, IReadOnlyList skus, SystemData systemData, string version, IDictionary serializedAdditionalRawData) + { + Capabilities = capabilities; + Deprecation = deprecation; + FinetuneCapabilities = finetuneCapabilities; + Format = format; + IsDefaultVersion = isDefaultVersion; + LifecycleStatus = lifecycleStatus; + MaxCapacity = maxCapacity; + Name = name; + Skus = skus; + SystemData = systemData; + Version = version; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The capabilities. + public IReadOnlyDictionary Capabilities { get; } + /// Gets the deprecation. + public EndpointModelDeprecationProperties Deprecation { get; } + /// The capabilities for finetune models. + public IReadOnlyDictionary FinetuneCapabilities { get; } + /// Deployment model format. + public string Format { get; } + /// If the model is default version. + public bool? IsDefaultVersion { get; } + /// Model lifecycle status. + public ModelLifecycleStatus? LifecycleStatus { get; } + /// The max capacity. + public int? MaxCapacity { get; } + /// Deployment model name. + public string Name { get; } + /// The list of Model Sku. + public IReadOnlyList Skus { get; } + /// Metadata pertaining to creation and last modification of the resource. + public SystemData SystemData { get; } + /// Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version is different for different models and might change when there is new version available for a model. Default version for a model could be found from list models API. + public string Version { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.Serialization.cs new file mode 100644 index 0000000000000..f3984d3369c3e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuCapacityProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuCapacityProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Default)) + { + writer.WritePropertyName("default"u8); + writer.WriteNumberValue(Default.Value); + } + if (Optional.IsDefined(Maximum)) + { + writer.WritePropertyName("maximum"u8); + writer.WriteNumberValue(Maximum.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuCapacityProperties 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(EndpointModelSkuCapacityProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuCapacityProperties(document.RootElement, options); + } + + internal static EndpointModelSkuCapacityProperties DeserializeEndpointModelSkuCapacityProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? @default = default; + int? maximum = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("default"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @default = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maximum"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximum = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuCapacityProperties(@default, maximum, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuCapacityProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuCapacityProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuCapacityProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuCapacityProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.cs new file mode 100644 index 0000000000000..acdc267a87f2d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelSkuCapacityProperties. + public partial class EndpointModelSkuCapacityProperties + { + /// + /// 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 EndpointModelSkuCapacityProperties() + { + } + + /// Initializes a new instance of . + /// The default capacity. + /// The maximum capacity. + /// Keeps track of any properties unknown to the library. + internal EndpointModelSkuCapacityProperties(int? @default, int? maximum, IDictionary serializedAdditionalRawData) + { + Default = @default; + Maximum = maximum; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The default capacity. + public int? Default { get; } + /// The maximum capacity. + public int? Maximum { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.Serialization.cs new file mode 100644 index 0000000000000..64bd30a6de0ed --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.Serialization.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteObjectValue(Capacity, options); + } + if (Optional.IsCollectionDefined(ConnectionIds)) + { + writer.WritePropertyName("connectionIds"u8); + writer.WriteStartArray(); + foreach (var item in ConnectionIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DeprecationOn)) + { + writer.WritePropertyName("deprecationDate"u8); + writer.WriteStringValue(DeprecationOn.Value, "O"); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(RateLimits)) + { + writer.WritePropertyName("rateLimits"u8); + writer.WriteStartArray(); + foreach (var item in RateLimits) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(UsageName)) + { + writer.WritePropertyName("usageName"u8); + writer.WriteStringValue(UsageName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuProperties 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(EndpointModelSkuProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuProperties(document.RootElement, options); + } + + internal static EndpointModelSkuProperties DeserializeEndpointModelSkuProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointModelSkuCapacityProperties capacity = default; + IReadOnlyList connectionIds = default; + DateTimeOffset? deprecationDate = default; + string name = default; + IReadOnlyList rateLimits = default; + string usageName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = EndpointModelSkuCapacityProperties.DeserializeEndpointModelSkuCapacityProperties(property.Value, options); + continue; + } + if (property.NameEquals("connectionIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + connectionIds = array; + continue; + } + if (property.NameEquals("deprecationDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deprecationDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("rateLimits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelSkuRateLimitProperties.DeserializeEndpointModelSkuRateLimitProperties(item, options)); + } + rateLimits = array; + continue; + } + if (property.NameEquals("usageName"u8)) + { + usageName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuProperties( + capacity, + connectionIds ?? new ChangeTrackingList(), + deprecationDate, + name, + rateLimits ?? new ChangeTrackingList(), + usageName, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.cs new file mode 100644 index 0000000000000..a66d13356c5e5 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.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; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelSkuProperties. + public partial class EndpointModelSkuProperties + { + /// + /// 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 EndpointModelSkuProperties() + { + ConnectionIds = new ChangeTrackingList(); + RateLimits = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The list of ARM id for the connection support this SKU. + /// The datetime of deprecation of the model SKU. + /// The name of the model SKU. + /// + /// The usage name of the model SKU. + /// Keeps track of any properties unknown to the library. + internal EndpointModelSkuProperties(EndpointModelSkuCapacityProperties capacity, IReadOnlyList connectionIds, DateTimeOffset? deprecationOn, string name, IReadOnlyList rateLimits, string usageName, IDictionary serializedAdditionalRawData) + { + Capacity = capacity; + ConnectionIds = connectionIds; + DeprecationOn = deprecationOn; + Name = name; + RateLimits = rateLimits; + UsageName = usageName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the capacity. + public EndpointModelSkuCapacityProperties Capacity { get; } + /// The list of ARM id for the connection support this SKU. + public IReadOnlyList ConnectionIds { get; } + /// The datetime of deprecation of the model SKU. + public DateTimeOffset? DeprecationOn { get; } + /// The name of the model SKU. + public string Name { get; } + /// Gets the rate limits. + public IReadOnlyList RateLimits { get; } + /// The usage name of the model SKU. + public string UsageName { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.Serialization.cs new file mode 100644 index 0000000000000..c5881ffcc7cdb --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.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.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuRateLimitProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(RenewalPeriod)) + { + writer.WritePropertyName("renewalPeriod"u8); + writer.WriteNumberValue(RenewalPeriod.Value); + } + if (Optional.IsCollectionDefined(Rules)) + { + writer.WritePropertyName("rules"u8); + writer.WriteStartArray(); + foreach (var item in Rules) + { + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuRateLimitProperties 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(EndpointModelSkuRateLimitProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuRateLimitProperties(document.RootElement, options); + } + + internal static EndpointModelSkuRateLimitProperties DeserializeEndpointModelSkuRateLimitProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float? count = default; + float? renewalPeriod = default; + IReadOnlyList rules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("renewalPeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + renewalPeriod = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("rules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelSkuRateLimitRuleProperties.DeserializeEndpointModelSkuRateLimitRuleProperties(item, options)); + } + rules = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuRateLimitProperties(count, renewalPeriod, rules ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuRateLimitProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuRateLimitProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.cs index fa2a427ad0a8a..2d3c8862689ae 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Label category definition. - public partial class LabelCategory + /// The EndpointModelSkuRateLimitProperties. + public partial class EndpointModelSkuRateLimitProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,30 +45,30 @@ public partial class LabelCategory /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public LabelCategory() + /// Initializes a new instance of . + internal EndpointModelSkuRateLimitProperties() { - Classes = new ChangeTrackingDictionary(); + Rules = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Dictionary of label classes in this category. - /// Display name of the label category. - /// Indicates whether it is allowed to select multiple classes in this category. + /// Initializes a new instance of . + /// The count value of Call Rate Limit. + /// The renewal period in seconds of Call Rate Limit. + /// The call rate limit for the model. /// Keeps track of any properties unknown to the library. - internal LabelCategory(IDictionary classes, string displayName, LabelCategoryMultiSelect? multiSelect, IDictionary serializedAdditionalRawData) + internal EndpointModelSkuRateLimitProperties(float? count, float? renewalPeriod, IReadOnlyList rules, IDictionary serializedAdditionalRawData) { - Classes = classes; - DisplayName = displayName; - MultiSelect = multiSelect; + Count = count; + RenewalPeriod = renewalPeriod; + Rules = rules; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Dictionary of label classes in this category. - public IDictionary Classes { get; set; } - /// Display name of the label category. - public string DisplayName { get; set; } - /// Indicates whether it is allowed to select multiple classes in this category. - public LabelCategoryMultiSelect? MultiSelect { get; set; } + /// The count value of Call Rate Limit. + public float? Count { get; } + /// The renewal period in seconds of Call Rate Limit. + public float? RenewalPeriod { get; } + /// The call rate limit for the model. + public IReadOnlyList Rules { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.Serialization.cs new file mode 100644 index 0000000000000..ee3fd37ac487a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuRateLimitRulePatternProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRulePatternProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Method)) + { + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method); + } + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuRateLimitRulePatternProperties 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(EndpointModelSkuRateLimitRulePatternProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuRateLimitRulePatternProperties(document.RootElement, options); + } + + internal static EndpointModelSkuRateLimitRulePatternProperties DeserializeEndpointModelSkuRateLimitRulePatternProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string method = default; + string path = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = property.Value.GetString(); + continue; + } + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuRateLimitRulePatternProperties(method, path, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRulePatternProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuRateLimitRulePatternProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuRateLimitRulePatternProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRulePatternProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelClass.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs similarity index 65% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelClass.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs index 57575cf8e1115..d29360a98c739 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelClass.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Label class definition. - public partial class LabelClass + /// The EndpointModelSkuRateLimitRulePatternProperties. + public partial class EndpointModelSkuRateLimitRulePatternProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,25 @@ public partial class LabelClass /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public LabelClass() + /// Initializes a new instance of . + internal EndpointModelSkuRateLimitRulePatternProperties() { - Subclasses = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . - /// Display name of the label class. - /// Dictionary of subclasses of the label class. + /// Initializes a new instance of . + /// + /// /// Keeps track of any properties unknown to the library. - internal LabelClass(string displayName, IDictionary subclasses, IDictionary serializedAdditionalRawData) + internal EndpointModelSkuRateLimitRulePatternProperties(string method, string path, IDictionary serializedAdditionalRawData) { - DisplayName = displayName; - Subclasses = subclasses; + Method = method; + Path = path; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Display name of the label class. - public string DisplayName { get; set; } - /// Dictionary of subclasses of the label class. - public IDictionary Subclasses { get; set; } + /// Gets the method. + public string Method { get; } + /// Gets the path. + public string Path { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.Serialization.cs new file mode 100644 index 0000000000000..7c8109967e7e6 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuRateLimitRuleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRuleProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(DynamicThrottlingEnabled)) + { + writer.WritePropertyName("dynamicThrottlingEnabled"u8); + writer.WriteBooleanValue(DynamicThrottlingEnabled.Value); + } + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + if (Optional.IsCollectionDefined(MatchPatterns)) + { + writer.WritePropertyName("matchPatterns"u8); + writer.WriteStartArray(); + foreach (var item in MatchPatterns) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(MinCount)) + { + writer.WritePropertyName("minCount"u8); + writer.WriteNumberValue(MinCount.Value); + } + if (Optional.IsDefined(RenewalPeriod)) + { + writer.WritePropertyName("renewalPeriod"u8); + writer.WriteNumberValue(RenewalPeriod.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuRateLimitRuleProperties 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(EndpointModelSkuRateLimitRuleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuRateLimitRuleProperties(document.RootElement, options); + } + + internal static EndpointModelSkuRateLimitRuleProperties DeserializeEndpointModelSkuRateLimitRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float? count = default; + bool? dynamicThrottlingEnabled = default; + string key = default; + IReadOnlyList matchPatterns = default; + float? minCount = default; + float? renewalPeriod = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("dynamicThrottlingEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicThrottlingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("matchPatterns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelSkuRateLimitRulePatternProperties.DeserializeEndpointModelSkuRateLimitRulePatternProperties(item, options)); + } + matchPatterns = array; + continue; + } + if (property.NameEquals("minCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("renewalPeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + renewalPeriod = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuRateLimitRuleProperties( + count, + dynamicThrottlingEnabled, + key, + matchPatterns ?? new ChangeTrackingList(), + minCount, + renewalPeriod, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRuleProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuRateLimitRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuRateLimitRuleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRuleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.cs new file mode 100644 index 0000000000000..7e849da74a33e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelSkuRateLimitRuleProperties. + public partial class EndpointModelSkuRateLimitRuleProperties + { + /// + /// 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 EndpointModelSkuRateLimitRuleProperties() + { + MatchPatterns = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// If the dynamic throttling is enabled. + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal EndpointModelSkuRateLimitRuleProperties(float? count, bool? dynamicThrottlingEnabled, string key, IReadOnlyList matchPatterns, float? minCount, float? renewalPeriod, IDictionary serializedAdditionalRawData) + { + Count = count; + DynamicThrottlingEnabled = dynamicThrottlingEnabled; + Key = key; + MatchPatterns = matchPatterns; + MinCount = minCount; + RenewalPeriod = renewalPeriod; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the count. + public float? Count { get; } + /// If the dynamic throttling is enabled. + public bool? DynamicThrottlingEnabled { get; } + /// Gets the key. + public string Key { get; } + /// Gets the match patterns. + public IReadOnlyList MatchPatterns { get; } + /// Gets the min count. + public float? MinCount { get; } + /// Gets the renewal period. + public float? RenewalPeriod { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetJobArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs similarity index 61% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetJobArmPaginatedResult.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs index 030e656ed4382..7ae88a9ca51f0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetJobArmPaginatedResult.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class FeaturesetJobArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + internal partial class EndpointModels : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(FeaturesetJobArmPaginatedResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EndpointModels)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -59,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteEndObject(); } - FeaturesetJobArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EndpointModels IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(FeaturesetJobArmPaginatedResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EndpointModels)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeFeaturesetJobArmPaginatedResult(document.RootElement, options); + return DeserializeEndpointModels(document.RootElement, options); } - internal static FeaturesetJobArmPaginatedResult DeserializeFeaturesetJobArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static EndpointModels DeserializeEndpointModels(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -80,7 +80,7 @@ internal static FeaturesetJobArmPaginatedResult DeserializeFeaturesetJobArmPagin return null; } string nextLink = default; - IReadOnlyList value = default; + IReadOnlyList value = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -96,10 +96,10 @@ internal static FeaturesetJobArmPaginatedResult DeserializeFeaturesetJobArmPagin { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(MachineLearningFeatureSetJob.DeserializeMachineLearningFeatureSetJob(item, options)); + array.Add(EndpointModelProperties.DeserializeEndpointModelProperties(item, options)); } value = array; continue; @@ -110,38 +110,38 @@ internal static FeaturesetJobArmPaginatedResult DeserializeFeaturesetJobArmPagin } } serializedAdditionalRawData = rawDataDictionary; - return new FeaturesetJobArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new EndpointModels(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(FeaturesetJobArmPaginatedResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EndpointModels)} does not support writing '{options.Format}' format."); } } - FeaturesetJobArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EndpointModels IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeFeaturesetJobArmPaginatedResult(document.RootElement, options); + return DeserializeEndpointModels(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(FeaturesetJobArmPaginatedResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EndpointModels)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.cs new file mode 100644 index 0000000000000..2cf98fe420c23 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModels. + internal partial class EndpointModels + { + /// + /// 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 EndpointModels() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The link to the next page constructed using the continuationToken. If null, there are no additional pages. + /// List of models. + /// Keeps track of any properties unknown to the library. + internal EndpointModels(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The link to the next page constructed using the continuationToken. If null, there are no additional pages. + public string NextLink { get; } + /// List of models. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..4ceab833aebad --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.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.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + [PersistableModelProxy(typeof(UnknownEndpointResourceProperties))] + public partial class EndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointResourceProperties 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(EndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointResourceProperties(document.RootElement, options); + } + + internal static EndpointResourceProperties DeserializeEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("endpointType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Azure.ContentSafety": return ContentSafetyEndpointResourceProperties.DeserializeContentSafetyEndpointResourceProperties(element, options); + case "Azure.OpenAI": return OpenAIEndpointResourceProperties.DeserializeOpenAIEndpointResourceProperties(element, options); + case "Azure.Speech": return SpeechEndpointResourceProperties.DeserializeSpeechEndpointResourceProperties(element, options); + case "managedOnlineEndpoint": return ManagedOnlineEndpointResourceProperties.DeserializeManagedOnlineEndpointResourceProperties(element, options); + case "serverlessEndpoint": return ServerlessEndpointResourceProperties.DeserializeServerlessEndpointResourceProperties(element, options); + } + } + return UnknownEndpointResourceProperties.DeserializeUnknownEndpointResourceProperties(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); + default: + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.cs new file mode 100644 index 0000000000000..3c637ddc48a0d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// + /// 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 EndpointResourceProperties + { + /// + /// 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 EndpointResourceProperties() + { + Deployments = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal EndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) + { + AssociatedResourceId = associatedResourceId; + Deployments = deployments; + EndpointType = endpointType; + EndpointUri = endpointUri; + FailureReason = failureReason; + Location = location; + Name = name; + ProvisioningState = provisioningState; + ShouldCreateAiServicesEndpoint = shouldCreateAiServicesEndpoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Byo resource id for creating the built-in model service endpoints. + public ResourceIdentifier AssociatedResourceId { get; set; } + /// Deployments info. + public IList Deployments { get; } + /// Type of the endpoint. + internal EndpointType EndpointType { get; set; } + /// Uri of the endpoint. + public Uri EndpointUri { get; set; } + /// The failure reason if the creation failed. + public string FailureReason { get; set; } + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + public AzureLocation? Location { get; set; } + /// Name of the endpoint. + public string Name { get; set; } + /// Read-only provision state status property. + public DefaultResourceProvisioningState? ProvisioningState { get; } + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + public bool? ShouldCreateAiServicesEndpoint { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 0000000000000..243169e08d6da --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class EndpointResourcePropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointResourcePropertiesBasicResourceArmPaginatedResult 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(EndpointResourcePropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static EndpointResourcePropertiesBasicResourceArmPaginatedResult DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointResourcePropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + EndpointResourcePropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 0000000000000..a5c86ae427eee --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointResourcePropertiesBasicResourceArmPaginatedResult. + internal partial class EndpointResourcePropertiesBasicResourceArmPaginatedResult + { + /// + /// 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 EndpointResourcePropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal EndpointResourcePropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointType.cs new file mode 100644 index 0000000000000..d021f7f1d0906 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointType.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 Azure.ResourceManager.MachineLearning.Models +{ + /// Type of the endpoint. + public readonly partial struct EndpointType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EndpointType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureOpenAIValue = "Azure.OpenAI"; + private const string AzureSpeechValue = "Azure.Speech"; + private const string AzureContentSafetyValue = "Azure.ContentSafety"; + private const string AzureLlamaValue = "Azure.Llama"; + private const string ManagedOnlineEndpointValue = "managedOnlineEndpoint"; + private const string ServerlessEndpointValue = "serverlessEndpoint"; + + /// Azure.OpenAI. + public static EndpointType AzureOpenAI { get; } = new EndpointType(AzureOpenAIValue); + /// Azure.Speech. + public static EndpointType AzureSpeech { get; } = new EndpointType(AzureSpeechValue); + /// Azure.ContentSafety. + public static EndpointType AzureContentSafety { get; } = new EndpointType(AzureContentSafetyValue); + /// Azure.Llama. + public static EndpointType AzureLlama { get; } = new EndpointType(AzureLlamaValue); + /// managedOnlineEndpoint. + public static EndpointType ManagedOnlineEndpoint { get; } = new EndpointType(ManagedOnlineEndpointValue); + /// serverlessEndpoint. + public static EndpointType ServerlessEndpoint { get; } = new EndpointType(ServerlessEndpointValue); + /// Determines if two values are the same. + public static bool operator ==(EndpointType left, EndpointType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EndpointType left, EndpointType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator EndpointType(string value) => new EndpointType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EndpointType other && Equals(other); + /// + public bool Equals(EndpointType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportFormatType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportFormatType.cs deleted file mode 100644 index 6ad3f8896c29c..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportFormatType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The format of exported labels. - internal readonly partial struct ExportFormatType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ExportFormatType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DatasetValue = "Dataset"; - private const string CocoValue = "Coco"; - private const string CSVValue = "CSV"; - - /// Dataset. - public static ExportFormatType Dataset { get; } = new ExportFormatType(DatasetValue); - /// Coco. - public static ExportFormatType Coco { get; } = new ExportFormatType(CocoValue); - /// CSV. - public static ExportFormatType CSV { get; } = new ExportFormatType(CSVValue); - /// Determines if two values are the same. - public static bool operator ==(ExportFormatType left, ExportFormatType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ExportFormatType left, ExportFormatType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ExportFormatType(string value) => new ExportFormatType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ExportFormatType other && Equals(other); - /// - public bool Equals(ExportFormatType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.Serialization.cs deleted file mode 100644 index 699f8ceaf438b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.Serialization.cs +++ /dev/null @@ -1,160 +0,0 @@ -// 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.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownExportSummary))] - public partial class ExportSummary : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ExportSummary)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(EndOn)) - { - if (EndOn != null) - { - writer.WritePropertyName("endDateTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - else - { - writer.WriteNull("endDateTime"); - } - } - if (options.Format != "W" && Optional.IsDefined(ExportedRowCount)) - { - if (ExportedRowCount != null) - { - writer.WritePropertyName("exportedRowCount"u8); - writer.WriteNumberValue(ExportedRowCount.Value); - } - else - { - writer.WriteNull("exportedRowCount"); - } - } - writer.WritePropertyName("format"u8); - writer.WriteStringValue(Format.ToString()); - if (options.Format != "W" && Optional.IsDefined(LabelingJobId)) - { - if (LabelingJobId != null) - { - writer.WritePropertyName("labelingJobId"u8); - writer.WriteStringValue(LabelingJobId); - } - else - { - writer.WriteNull("labelingJobId"); - } - } - if (options.Format != "W" && Optional.IsDefined(StartOn)) - { - if (StartOn != null) - { - writer.WritePropertyName("startDateTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - else - { - writer.WriteNull("startDateTime"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ExportSummary 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(ExportSummary)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportSummary(document.RootElement, options); - } - - internal static ExportSummary DeserializeExportSummary(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("format", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "Coco": return CocoExportSummary.DeserializeCocoExportSummary(element, options); - case "CSV": return CsvExportSummary.DeserializeCsvExportSummary(element, options); - case "Dataset": return DatasetExportSummary.DeserializeDatasetExportSummary(element, options); - } - } - return UnknownExportSummary.DeserializeUnknownExportSummary(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); - default: - throw new FormatException($"The model {nameof(ExportSummary)} does not support writing '{options.Format}' format."); - } - } - - ExportSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportSummary(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ExportSummary)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.cs deleted file mode 100644 index 39a0528891d87..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// - /// 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 ExportSummary - { - /// - /// 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 ExportSummary() - { - } - - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// [Required] The format of exported labels, also as the discriminator. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// Keeps track of any properties unknown to the library. - internal ExportSummary(DateTimeOffset? endOn, long? exportedRowCount, ExportFormatType format, string labelingJobId, DateTimeOffset? startOn, IDictionary serializedAdditionalRawData) - { - EndOn = endOn; - ExportedRowCount = exportedRowCount; - Format = format; - LabelingJobId = labelingJobId; - StartOn = startOn; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The time when the export was completed. - public DateTimeOffset? EndOn { get; } - /// The total number of labeled datapoints exported. - public long? ExportedRowCount { get; } - /// [Required] The format of exported labels, also as the discriminator. - internal ExportFormatType Format { get; set; } - /// Name and identifier of the job containing exported labels. - public string LabelingJobId { get; } - /// The time when the export was requested. - public DateTimeOffset? StartOn { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.Serialization.cs index eb98effddb376..23340100c00bd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.Serialization.cs @@ -26,6 +26,26 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); + if (Optional.IsCollectionDefined(FeatureDataTypeOverride)) + { + if (FeatureDataTypeOverride != null) + { + writer.WritePropertyName("featureDataTypeOverride"u8); + writer.WriteStartObject(); + foreach (var item in FeatureDataTypeOverride) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value.ToString()); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("featureDataTypeOverride"); + } + } + writer.WritePropertyName("featureImportanceSettings"u8); + writer.WriteObjectValue(FeatureImportanceSettings, options); writer.WritePropertyName("metricThreshold"u8); writer.WriteObjectValue(MetricThreshold, options); writer.WritePropertyName("productionData"u8); @@ -37,10 +57,22 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteEndArray(); writer.WritePropertyName("referenceData"u8); writer.WriteObjectValue(ReferenceData, options); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -100,16 +132,38 @@ internal static FeatureAttributionDriftMonitoringSignal DeserializeFeatureAttrib { return null; } + IDictionary featureDataTypeOverride = default; + FeatureImportanceSettings featureImportanceSettings = default; FeatureAttributionMetricThreshold metricThreshold = default; IList productionData = default; MonitoringInputDataBase referenceData = default; - MonitoringNotificationMode? mode = default; + IList notificationTypes = default; IDictionary properties = default; MonitoringSignalType signalType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("featureDataTypeOverride"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureDataTypeOverride = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, new MonitoringFeatureDataType(property0.Value.GetString())); + } + featureDataTypeOverride = dictionary; + continue; + } + if (property.NameEquals("featureImportanceSettings"u8)) + { + featureImportanceSettings = FeatureImportanceSettings.DeserializeFeatureImportanceSettings(property.Value, options); + continue; + } if (property.NameEquals("metricThreshold"u8)) { metricThreshold = FeatureAttributionMetricThreshold.DeserializeFeatureAttributionMetricThreshold(property.Value, options); @@ -130,13 +184,19 @@ internal static FeatureAttributionDriftMonitoringSignal DeserializeFeatureAttrib referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); continue; } - if (property.NameEquals("mode"u8)) + if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + notificationTypes = null; continue; } - mode = new MonitoringNotificationMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MonitoringNotificationType(item.GetString())); + } + notificationTypes = array; continue; } if (property.NameEquals("properties"u8)) @@ -166,10 +226,12 @@ internal static FeatureAttributionDriftMonitoringSignal DeserializeFeatureAttrib } serializedAdditionalRawData = rawDataDictionary; return new FeatureAttributionDriftMonitoringSignal( - mode, + notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData, + featureDataTypeOverride ?? new ChangeTrackingDictionary(), + featureImportanceSettings, metricThreshold, productionData, referenceData); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.cs index 154b1dc047da9..dcb53dc2ddd02 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.cs @@ -15,24 +15,28 @@ namespace Azure.ResourceManager.MachineLearning.Models public partial class FeatureAttributionDriftMonitoringSignal : MonitoringSignalBase { /// Initializes a new instance of . + /// [Required] The settings for computing feature importance. /// [Required] A list of metrics to calculate and their associated thresholds. /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// - /// , or is null. - public FeatureAttributionDriftMonitoringSignal(FeatureAttributionMetricThreshold metricThreshold, IEnumerable productionData, MonitoringInputDataBase referenceData) + /// , , or is null. + public FeatureAttributionDriftMonitoringSignal(FeatureImportanceSettings featureImportanceSettings, FeatureAttributionMetricThreshold metricThreshold, IEnumerable productionData, MonitoringInputDataBase referenceData) { + Argument.AssertNotNull(featureImportanceSettings, nameof(featureImportanceSettings)); Argument.AssertNotNull(metricThreshold, nameof(metricThreshold)); Argument.AssertNotNull(productionData, nameof(productionData)); Argument.AssertNotNull(referenceData, nameof(referenceData)); + FeatureDataTypeOverride = new ChangeTrackingDictionary(); + FeatureImportanceSettings = featureImportanceSettings; MetricThreshold = metricThreshold; ProductionData = productionData.ToList(); ReferenceData = referenceData; @@ -40,23 +44,27 @@ public FeatureAttributionDriftMonitoringSignal(FeatureAttributionMetricThreshold } /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. + /// A dictionary that maps feature names to their respective data types. + /// [Required] The settings for computing feature importance. /// [Required] A list of metrics to calculate and their associated thresholds. /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// - internal FeatureAttributionDriftMonitoringSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, FeatureAttributionMetricThreshold metricThreshold, IList productionData, MonitoringInputDataBase referenceData) : base(mode, properties, signalType, serializedAdditionalRawData) + internal FeatureAttributionDriftMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, FeatureImportanceSettings featureImportanceSettings, FeatureAttributionMetricThreshold metricThreshold, IList productionData, MonitoringInputDataBase referenceData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) { + FeatureDataTypeOverride = featureDataTypeOverride; + FeatureImportanceSettings = featureImportanceSettings; MetricThreshold = metricThreshold; ProductionData = productionData; ReferenceData = referenceData; @@ -68,18 +76,22 @@ internal FeatureAttributionDriftMonitoringSignal() { } + /// A dictionary that maps feature names to their respective data types. + public IDictionary FeatureDataTypeOverride { get; set; } + /// [Required] The settings for computing feature importance. + public FeatureImportanceSettings FeatureImportanceSettings { get; set; } /// [Required] A list of metrics to calculate and their associated thresholds. public FeatureAttributionMetricThreshold MetricThreshold { get; set; } /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public IList ProductionData { get; } /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ReferenceData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceMode.cs new file mode 100644 index 0000000000000..b840b6d136074 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The mode of operation for computing feature importance. + public readonly partial struct FeatureImportanceMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FeatureImportanceMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DisabledValue = "Disabled"; + private const string EnabledValue = "Enabled"; + + /// Disables computing feature importance within a signal. + public static FeatureImportanceMode Disabled { get; } = new FeatureImportanceMode(DisabledValue); + /// Enables computing feature importance within a signal. + public static FeatureImportanceMode Enabled { get; } = new FeatureImportanceMode(EnabledValue); + /// Determines if two values are the same. + public static bool operator ==(FeatureImportanceMode left, FeatureImportanceMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FeatureImportanceMode left, FeatureImportanceMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FeatureImportanceMode(string value) => new FeatureImportanceMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FeatureImportanceMode other && Equals(other); + /// + public bool Equals(FeatureImportanceMode 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingDataConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceSettings.Serialization.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingDataConfiguration.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceSettings.Serialization.cs index 969a550a7413e..4a144c8d5e565 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingDataConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceSettings.Serialization.cs @@ -13,36 +13,36 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class LabelingDataConfiguration : IUtf8JsonSerializable, IJsonModel + public partial class FeatureImportanceSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingDataConfiguration)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FeatureImportanceSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(DataId)) + if (Optional.IsDefined(Mode)) { - if (DataId != null) + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsDefined(TargetColumn)) + { + if (TargetColumn != null) { - writer.WritePropertyName("dataId"u8); - writer.WriteStringValue(DataId); + writer.WritePropertyName("targetColumn"u8); + writer.WriteStringValue(TargetColumn); } else { - writer.WriteNull("dataId"); + writer.WriteNull("targetColumn"); } } - if (Optional.IsDefined(IncrementalDataRefresh)) - { - writer.WritePropertyName("incrementalDataRefresh"u8); - writer.WriteStringValue(IncrementalDataRefresh.Value.ToString()); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -61,19 +61,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteEndObject(); } - LabelingDataConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FeatureImportanceSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingDataConfiguration)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FeatureImportanceSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingDataConfiguration(document.RootElement, options); + return DeserializeFeatureImportanceSettings(document.RootElement, options); } - internal static LabelingDataConfiguration DeserializeLabelingDataConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + internal static FeatureImportanceSettings DeserializeFeatureImportanceSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -81,29 +81,29 @@ internal static LabelingDataConfiguration DeserializeLabelingDataConfiguration(J { return null; } - string dataId = default; - IncrementalDataRefresh? incrementalDataRefresh = default; + FeatureImportanceMode? mode = default; + string targetColumn = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("dataId"u8)) + if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - dataId = null; continue; } - dataId = property.Value.GetString(); + mode = new FeatureImportanceMode(property.Value.GetString()); continue; } - if (property.NameEquals("incrementalDataRefresh"u8)) + if (property.NameEquals("targetColumn"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + targetColumn = null; continue; } - incrementalDataRefresh = new IncrementalDataRefresh(property.Value.GetString()); + targetColumn = property.Value.GetString(); continue; } if (options.Format != "W") @@ -112,38 +112,38 @@ internal static LabelingDataConfiguration DeserializeLabelingDataConfiguration(J } } serializedAdditionalRawData = rawDataDictionary; - return new LabelingDataConfiguration(dataId, incrementalDataRefresh, serializedAdditionalRawData); + return new FeatureImportanceSettings(mode, targetColumn, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingDataConfiguration)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FeatureImportanceSettings)} does not support writing '{options.Format}' format."); } } - LabelingDataConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FeatureImportanceSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingDataConfiguration(document.RootElement, options); + return DeserializeFeatureImportanceSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingDataConfiguration)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FeatureImportanceSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetJobArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceSettings.cs similarity index 63% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetJobArmPaginatedResult.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceSettings.cs index b45f10eaa078c..85b46a3e04a4c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetJobArmPaginatedResult.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceSettings.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// A paginated list of FeaturesetJob entities. - internal partial class FeaturesetJobArmPaginatedResult + /// The FeatureImportanceSettings. + public partial class FeatureImportanceSettings { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,25 @@ internal partial class FeaturesetJobArmPaginatedResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal FeaturesetJobArmPaginatedResult() + /// Initializes a new instance of . + public FeatureImportanceSettings() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The link to the next page of FeaturesetJob objects. If null, there are no additional pages. - /// An array of objects of type FeaturesetJob. + /// Initializes a new instance of . + /// The mode of operation for computing feature importance. + /// The name of the target column within the input data asset. /// Keeps track of any properties unknown to the library. - internal FeaturesetJobArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal FeatureImportanceSettings(FeatureImportanceMode? mode, string targetColumn, IDictionary serializedAdditionalRawData) { - NextLink = nextLink; - Value = value; + Mode = mode; + TargetColumn = targetColumn; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The link to the next page of FeaturesetJob objects. If null, there are no additional pages. - public string NextLink { get; } - /// An array of objects of type FeaturesetJob. - public IReadOnlyList Value { get; } + /// The mode of operation for computing feature importance. + public FeatureImportanceMode? Mode { get; set; } + /// The name of the target column within the input data asset. + public string TargetColumn { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.Serialization.cs index 0d6ec75135901..7c0410b0d6063 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.Serialization.cs @@ -26,6 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteStartObject(); + if (Optional.IsCollectionDefined(DataAvailabilityStatus)) + { + writer.WritePropertyName("dataAvailabilityStatus"u8); + writer.WriteStartArray(); + foreach (var item in DataAvailabilityStatus) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Description)) { writer.WritePropertyName("description"u8); @@ -48,6 +58,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteNull("featureWindow"); } } + if (Optional.IsDefined(JobId)) + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + foreach (var item in Properties) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } if (Optional.IsDefined(Resource)) { writer.WritePropertyName("resource"u8); @@ -113,9 +139,12 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac { return null; } + IList dataAvailabilityStatus = default; string description = default; string displayName = default; FeatureWindow featureWindow = default; + string jobId = default; + IDictionary properties = default; MaterializationComputeResource resource = default; IDictionary sparkConfiguration = default; IDictionary tags = default; @@ -123,6 +152,20 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("dataAvailabilityStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new DataAvailabilityStatus(item.GetString())); + } + dataAvailabilityStatus = array; + continue; + } if (property.NameEquals("description"u8)) { description = property.Value.GetString(); @@ -143,6 +186,25 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac featureWindow = FeatureWindow.DeserializeFeatureWindow(property.Value, options); continue; } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + properties = dictionary; + continue; + } if (property.NameEquals("resource"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -187,9 +249,12 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac } serializedAdditionalRawData = rawDataDictionary; return new FeatureSetVersionBackfillContent( + dataAvailabilityStatus ?? new ChangeTrackingList(), description, displayName, featureWindow, + jobId, + properties ?? new ChangeTrackingDictionary(), resource, sparkConfiguration ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.cs index c597a4276467a..fcc75358704ff 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.cs @@ -48,35 +48,49 @@ public partial class FeatureSetVersionBackfillContent /// Initializes a new instance of . public FeatureSetVersionBackfillContent() { + DataAvailabilityStatus = new ChangeTrackingList(); + Properties = new ChangeTrackingDictionary(); SparkConfiguration = new ChangeTrackingDictionary(); Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . + /// Specified the data availability status that you want to backfill. /// Specifies description. /// Specifies description. /// Specifies the backfill feature window to be materialized. + /// Specify the jobId to retry the failed materialization. + /// Specifies the properties. /// Specifies the compute resource settings. /// Specifies the spark compute settings. /// Specifies the tags. /// Keeps track of any properties unknown to the library. - internal FeatureSetVersionBackfillContent(string description, string displayName, FeatureWindow featureWindow, MaterializationComputeResource resource, IDictionary sparkConfiguration, IDictionary tags, IDictionary serializedAdditionalRawData) + internal FeatureSetVersionBackfillContent(IList dataAvailabilityStatus, string description, string displayName, FeatureWindow featureWindow, string jobId, IDictionary properties, MaterializationComputeResource resource, IDictionary sparkConfiguration, IDictionary tags, IDictionary serializedAdditionalRawData) { + DataAvailabilityStatus = dataAvailabilityStatus; Description = description; DisplayName = displayName; FeatureWindow = featureWindow; + JobId = jobId; + Properties = properties; Resource = resource; SparkConfiguration = sparkConfiguration; Tags = tags; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Specified the data availability status that you want to backfill. + public IList DataAvailabilityStatus { get; } /// Specifies description. public string Description { get; set; } /// Specifies description. public string DisplayName { get; set; } /// Specifies the backfill feature window to be materialized. public FeatureWindow FeatureWindow { get; set; } + /// Specify the jobId to retry the failed materialization. + public string JobId { get; set; } + /// Specifies the properties. + public IDictionary Properties { get; } /// Specifies the compute resource settings. internal MaterializationComputeResource Resource { get; set; } /// Specifies the instance type. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureStoreJobType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureStoreJobType.cs deleted file mode 100644 index 9c259b82a03d2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureStoreJobType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The FeatureStoreJobType. - public readonly partial struct FeatureStoreJobType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public FeatureStoreJobType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RecurrentMaterializationValue = "RecurrentMaterialization"; - private const string BackfillMaterializationValue = "BackfillMaterialization"; - - /// RecurrentMaterialization. - public static FeatureStoreJobType RecurrentMaterialization { get; } = new FeatureStoreJobType(RecurrentMaterializationValue); - /// BackfillMaterialization. - public static FeatureStoreJobType BackfillMaterialization { get; } = new FeatureStoreJobType(BackfillMaterializationValue); - /// Determines if two values are the same. - public static bool operator ==(FeatureStoreJobType left, FeatureStoreJobType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(FeatureStoreJobType left, FeatureStoreJobType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator FeatureStoreJobType(string value) => new FeatureStoreJobType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is FeatureStoreJobType other && Equals(other); - /// - public bool Equals(FeatureStoreJobType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetSpecification.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetSpecification.cs index 31e98f69af0a8..9a6e09d8b65c6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetSpecification.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetSpecification.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing specification. + /// DTO object representing specification. internal partial class FeaturesetSpecification { /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs similarity index 51% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs index 5a50d95cf2763..43bf1bb0259d0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs @@ -13,33 +13,36 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class KerberosKeytabSecrets : IUtf8JsonSerializable, IJsonModel + public partial class FeaturesetVersionBackfillResponse : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KerberosKeytabSecrets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FeaturesetVersionBackfillResponse)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(KerberosKeytab)) + if (Optional.IsCollectionDefined(JobIds)) { - if (KerberosKeytab != null) + if (JobIds != null) { - writer.WritePropertyName("kerberosKeytab"u8); - writer.WriteStringValue(KerberosKeytab); + writer.WritePropertyName("jobIds"u8); + writer.WriteStartArray(); + foreach (var item in JobIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } else { - writer.WriteNull("kerberosKeytab"); + writer.WriteNull("jobIds"); } } - writer.WritePropertyName("secretsType"u8); - writer.WriteStringValue(SecretsType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +61,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteEndObject(); } - KerberosKeytabSecrets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FeaturesetVersionBackfillResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KerberosKeytabSecrets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FeaturesetVersionBackfillResponse)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKerberosKeytabSecrets(document.RootElement, options); + return DeserializeFeaturesetVersionBackfillResponse(document.RootElement, options); } - internal static KerberosKeytabSecrets DeserializeKerberosKeytabSecrets(JsonElement element, ModelReaderWriterOptions options = null) + internal static FeaturesetVersionBackfillResponse DeserializeFeaturesetVersionBackfillResponse(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +81,24 @@ internal static KerberosKeytabSecrets DeserializeKerberosKeytabSecrets(JsonEleme { return null; } - string kerberosKeytab = default; - SecretsType secretsType = default; + IReadOnlyList jobIds = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("kerberosKeytab"u8)) + if (property.NameEquals("jobIds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - kerberosKeytab = null; + jobIds = null; continue; } - kerberosKeytab = property.Value.GetString(); - continue; - } - if (property.NameEquals("secretsType"u8)) - { - secretsType = new SecretsType(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + jobIds = array; continue; } if (options.Format != "W") @@ -105,38 +107,38 @@ internal static KerberosKeytabSecrets DeserializeKerberosKeytabSecrets(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new KerberosKeytabSecrets(secretsType, serializedAdditionalRawData, kerberosKeytab); + return new FeaturesetVersionBackfillResponse(jobIds ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(KerberosKeytabSecrets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FeaturesetVersionBackfillResponse)} does not support writing '{options.Format}' format."); } } - KerberosKeytabSecrets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FeaturesetVersionBackfillResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKerberosKeytabSecrets(document.RootElement, options); + return DeserializeFeaturesetVersionBackfillResponse(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(KerberosKeytabSecrets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FeaturesetVersionBackfillResponse)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs new file mode 100644 index 0000000000000..11e2aad38a10b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Response payload for creating a backfill request for a given feature set version. + public partial class FeaturesetVersionBackfillResponse + { + /// + /// 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 FeaturesetVersionBackfillResponse() + { + JobIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of jobs submitted as part of the backfill request. + /// Keeps track of any properties unknown to the library. + internal FeaturesetVersionBackfillResponse(IReadOnlyList jobIds, IDictionary serializedAdditionalRawData) + { + JobIds = jobIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of jobs submitted as part of the backfill request. + public IReadOnlyList JobIds { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.cs deleted file mode 100644 index f831cc1ff61af..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The FileSystemSource. - public partial class FileSystemSource : DataImportSource - { - /// Initializes a new instance of . - public FileSystemSource() - { - SourceType = DataImportSourceType.FileSystem; - } - - /// Initializes a new instance of . - /// Workspace connection for data import source storage. - /// [Required] Specifies the type of data. - /// Keeps track of any properties unknown to the library. - /// Path on data import FileSystem source. - internal FileSystemSource(string connection, DataImportSourceType sourceType, IDictionary serializedAdditionalRawData, string path) : base(connection, sourceType, serializedAdditionalRawData) - { - Path = path; - SourceType = sourceType; - } - - /// Path on data import FileSystem source. - public string Path { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.Serialization.cs similarity index 55% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.Serialization.cs index ffaeba6ecbf2d..82961ef25abaf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.Serialization.cs @@ -13,129 +13,46 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class LabelingJobProperties : IUtf8JsonSerializable, IJsonModel + public partial class FineTuningJob : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FineTuningJob)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + writer.WritePropertyName("fineTuningDetails"u8); + writer.WriteObjectValue(FineTuningDetails, options); + if (Optional.IsDefined(Resources)) { - if (CreatedOn != null) - { - writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedOn.Value, "O"); - } - else - { - writer.WriteNull("createdDateTime"); - } + writer.WritePropertyName("resources"u8); + writer.WriteObjectValue(Resources, options); } - if (Optional.IsDefined(DataConfiguration)) + if (Optional.IsDefined(QueueSettings)) { - if (DataConfiguration != null) + if (QueueSettings != null) { - writer.WritePropertyName("dataConfiguration"u8); - writer.WriteObjectValue(DataConfiguration, options); + writer.WritePropertyName("queueSettings"u8); + writer.WriteObjectValue(QueueSettings, options); } else { - writer.WriteNull("dataConfiguration"); + writer.WriteNull("queueSettings"); } } - if (Optional.IsDefined(JobInstructions)) - { - if (JobInstructions != null) - { - writer.WritePropertyName("jobInstructions"u8); - writer.WriteObjectValue(JobInstructions, options); - } - else - { - writer.WriteNull("jobInstructions"); - } - } - if (Optional.IsCollectionDefined(LabelCategories)) - { - if (LabelCategories != null) - { - writer.WritePropertyName("labelCategories"u8); - writer.WriteStartObject(); - foreach (var item in LabelCategories) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("labelCategories"); - } - } - if (Optional.IsDefined(LabelingJobMediaProperties)) - { - if (LabelingJobMediaProperties != null) - { - writer.WritePropertyName("labelingJobMediaProperties"u8); - writer.WriteObjectValue(LabelingJobMediaProperties, options); - } - else - { - writer.WriteNull("labelingJobMediaProperties"); - } - } - if (Optional.IsDefined(MlAssistConfiguration)) - { - writer.WritePropertyName("mlAssistConfiguration"u8); - writer.WriteObjectValue(MlAssistConfiguration, options); - } - if (options.Format != "W" && Optional.IsDefined(ProgressMetrics)) - { - if (ProgressMetrics != null) - { - writer.WritePropertyName("progressMetrics"u8); - writer.WriteObjectValue(ProgressMetrics, options); - } - else - { - writer.WriteNull("progressMetrics"); - } - } - if (options.Format != "W" && Optional.IsDefined(ProjectId)) - { - writer.WritePropertyName("projectId"u8); - writer.WriteStringValue(ProjectId.Value); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsCollectionDefined(StatusMessages)) + writer.WritePropertyName("outputs"u8); + writer.WriteStartObject(); + foreach (var item in Outputs) { - if (StatusMessages != null) - { - writer.WritePropertyName("statusMessages"u8); - writer.WriteStartArray(); - foreach (var item in StatusMessages) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("statusMessages"); - } + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); } + writer.WriteEndObject(); if (Optional.IsDefined(ComponentId)) { if (ComponentId != null) @@ -208,24 +125,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -315,19 +214,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteEndObject(); } - LabelingJobProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FineTuningJob IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FineTuningJob)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobProperties(document.RootElement, options); + return DeserializeFineTuningJob(document.RootElement, options); } - internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static FineTuningJob DeserializeFineTuningJob(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -335,16 +234,10 @@ internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonEleme { return null; } - DateTimeOffset? createdDateTime = default; - LabelingDataConfiguration dataConfiguration = default; - LabelingJobInstructions jobInstructions = default; - IDictionary labelCategories = default; - LabelingJobMediaProperties labelingJobMediaProperties = default; - MachineLearningAssistConfiguration mlAssistConfiguration = default; - ProgressMetrics progressMetrics = default; - Guid? projectId = default; - JobProvisioningState? provisioningState = default; - IReadOnlyList statusMessages = default; + FineTuningVertical fineTuningDetails = default; + JobResources resources = default; + JobQueueSettings queueSettings = default; + IDictionary outputs = default; ResourceIdentifier componentId = default; ResourceIdentifier computeId = default; string displayName = default; @@ -353,7 +246,6 @@ internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonEleme bool? isArchived = default; JobType jobType = default; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -363,111 +255,38 @@ internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonEleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("createdDateTime"u8)) + if (property.NameEquals("fineTuningDetails"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - createdDateTime = null; - continue; - } - createdDateTime = property.Value.GetDateTimeOffset("O"); + fineTuningDetails = FineTuningVertical.DeserializeFineTuningVertical(property.Value, options); continue; } - if (property.NameEquals("dataConfiguration"u8)) + if (property.NameEquals("resources"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - dataConfiguration = null; continue; } - dataConfiguration = LabelingDataConfiguration.DeserializeLabelingDataConfiguration(property.Value, options); + resources = JobResources.DeserializeJobResources(property.Value, options); continue; } - if (property.NameEquals("jobInstructions"u8)) + if (property.NameEquals("queueSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - jobInstructions = null; + queueSettings = null; continue; } - jobInstructions = LabelingJobInstructions.DeserializeLabelingJobInstructions(property.Value, options); + queueSettings = JobQueueSettings.DeserializeJobQueueSettings(property.Value, options); continue; } - if (property.NameEquals("labelCategories"u8)) + if (property.NameEquals("outputs"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labelCategories = null; - continue; - } - Dictionary dictionary = new Dictionary(); + Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { - dictionary.Add(property0.Name, LabelCategory.DeserializeLabelCategory(property0.Value, options)); - } - labelCategories = dictionary; - continue; - } - if (property.NameEquals("labelingJobMediaProperties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labelingJobMediaProperties = null; - continue; - } - labelingJobMediaProperties = LabelingJobMediaProperties.DeserializeLabelingJobMediaProperties(property.Value, options); - continue; - } - if (property.NameEquals("mlAssistConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mlAssistConfiguration = MachineLearningAssistConfiguration.DeserializeMachineLearningAssistConfiguration(property.Value, options); - continue; - } - if (property.NameEquals("progressMetrics"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - progressMetrics = null; - continue; - } - progressMetrics = ProgressMetrics.DeserializeProgressMetrics(property.Value, options); - continue; - } - if (property.NameEquals("projectId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - projectId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new JobProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("statusMessages"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - statusMessages = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JobStatusMessage.DeserializeJobStatusMessage(item, options)); + dictionary.Add(property0.Name, MachineLearningJobOutput.DeserializeMachineLearningJobOutput(property0.Value, options)); } - statusMessages = array; + outputs = dictionary; continue; } if (property.NameEquals("componentId"u8)) @@ -539,21 +358,6 @@ internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonEleme notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -624,7 +428,7 @@ internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new LabelingJobProperties( + return new FineTuningJob( description, properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), @@ -637,50 +441,43 @@ internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonEleme isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status, - createdDateTime, - dataConfiguration, - jobInstructions, - labelCategories ?? new ChangeTrackingDictionary(), - labelingJobMediaProperties, - mlAssistConfiguration, - progressMetrics, - projectId, - provisioningState, - statusMessages ?? new ChangeTrackingList()); + fineTuningDetails, + resources, + queueSettings, + outputs); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingJobProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FineTuningJob)} does not support writing '{options.Format}' format."); } } - LabelingJobProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FineTuningJob IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobProperties(document.RootElement, options); + return DeserializeFineTuningJob(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingJobProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FineTuningJob)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.cs new file mode 100644 index 0000000000000..f18a5f65c7684 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// FineTuning Job definition. + public partial class FineTuningJob : MachineLearningJobProperties + { + /// Initializes a new instance of . + /// + /// [Required] + /// 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 . + /// + /// + /// [Required] + /// 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 . + /// + /// or is null. + public FineTuningJob(FineTuningVertical fineTuningDetails, IDictionary outputs) + { + Argument.AssertNotNull(fineTuningDetails, nameof(fineTuningDetails)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + FineTuningDetails = fineTuningDetails; + Outputs = outputs; + JobType = JobType.FineTuning; + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// Keeps track of any properties unknown to the library. + /// ARM resource ID of the component resource. + /// ARM resource ID of the compute resource. + /// Display name of job. + /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + /// + /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. + /// Defaults to AmlToken if null. + /// 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 . + /// + /// Is the asset archived?. + /// [Required] Specifies the type of job. + /// Notification setting for the job. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// + /// [Required] + /// 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 . + /// + /// Instance types and other resources for the job. + /// Queue settings for the job. + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + internal FineTuningJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, FineTuningVertical fineTuningDetails, JobResources resources, JobQueueSettings queueSettings, IDictionary outputs) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) + { + FineTuningDetails = fineTuningDetails; + Resources = resources; + QueueSettings = queueSettings; + Outputs = outputs; + JobType = jobType; + } + + /// Initializes a new instance of for deserialization. + internal FineTuningJob() + { + } + + /// + /// [Required] + /// 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 FineTuningVertical FineTuningDetails { get; set; } + /// Instance types and other resources for the job. + internal JobResources Resources { get; set; } + /// List of instance types to choose from. + public IList ResourcesInstanceTypes + { + get + { + if (Resources is null) + Resources = new JobResources(); + return Resources.InstanceTypes; + } + } + + /// Queue settings for the job. + internal JobQueueSettings QueueSettings { get; set; } + /// Controls the compute job tier. + public JobTier? QueueJobTier + { + get => QueueSettings is null ? default : QueueSettings.JobTier; + set + { + if (QueueSettings is null) + QueueSettings = new JobQueueSettings(); + QueueSettings.JobTier = value; + } + } + + /// + /// [Required] + /// 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 IDictionary Outputs { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningTaskType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningTaskType.cs new file mode 100644 index 0000000000000..d4dea3c5db188 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningTaskType.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The FineTuningTaskType. + public readonly partial struct FineTuningTaskType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FineTuningTaskType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ChatCompletionValue = "ChatCompletion"; + private const string TextCompletionValue = "TextCompletion"; + private const string TextClassificationValue = "TextClassification"; + private const string QuestionAnsweringValue = "QuestionAnswering"; + private const string TextSummarizationValue = "TextSummarization"; + private const string TokenClassificationValue = "TokenClassification"; + private const string TextTranslationValue = "TextTranslation"; + private const string ImageClassificationValue = "ImageClassification"; + private const string ImageInstanceSegmentationValue = "ImageInstanceSegmentation"; + private const string ImageObjectDetectionValue = "ImageObjectDetection"; + private const string VideoMultiObjectTrackingValue = "VideoMultiObjectTracking"; + + /// ChatCompletion. + public static FineTuningTaskType ChatCompletion { get; } = new FineTuningTaskType(ChatCompletionValue); + /// TextCompletion. + public static FineTuningTaskType TextCompletion { get; } = new FineTuningTaskType(TextCompletionValue); + /// TextClassification. + public static FineTuningTaskType TextClassification { get; } = new FineTuningTaskType(TextClassificationValue); + /// QuestionAnswering. + public static FineTuningTaskType QuestionAnswering { get; } = new FineTuningTaskType(QuestionAnsweringValue); + /// TextSummarization. + public static FineTuningTaskType TextSummarization { get; } = new FineTuningTaskType(TextSummarizationValue); + /// TokenClassification. + public static FineTuningTaskType TokenClassification { get; } = new FineTuningTaskType(TokenClassificationValue); + /// TextTranslation. + public static FineTuningTaskType TextTranslation { get; } = new FineTuningTaskType(TextTranslationValue); + /// ImageClassification. + public static FineTuningTaskType ImageClassification { get; } = new FineTuningTaskType(ImageClassificationValue); + /// ImageInstanceSegmentation. + public static FineTuningTaskType ImageInstanceSegmentation { get; } = new FineTuningTaskType(ImageInstanceSegmentationValue); + /// ImageObjectDetection. + public static FineTuningTaskType ImageObjectDetection { get; } = new FineTuningTaskType(ImageObjectDetectionValue); + /// VideoMultiObjectTracking. + public static FineTuningTaskType VideoMultiObjectTracking { get; } = new FineTuningTaskType(VideoMultiObjectTrackingValue); + /// Determines if two values are the same. + public static bool operator ==(FineTuningTaskType left, FineTuningTaskType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FineTuningTaskType left, FineTuningTaskType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FineTuningTaskType(string value) => new FineTuningTaskType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FineTuningTaskType other && Equals(other); + /// + public bool Equals(FineTuningTaskType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.Serialization.cs new file mode 100644 index 0000000000000..eea74c37f607b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.Serialization.cs @@ -0,0 +1,129 @@ +// 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.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + [PersistableModelProxy(typeof(UnknownFineTuningVertical))] + public partial class FineTuningVertical : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelProvider"u8); + writer.WriteStringValue(ModelProvider.ToString()); + writer.WritePropertyName("taskType"u8); + writer.WriteStringValue(TaskType.ToString()); + writer.WritePropertyName("trainingData"u8); + writer.WriteObjectValue(TrainingData, options); + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FineTuningVertical 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(FineTuningVertical)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFineTuningVertical(document.RootElement, options); + } + + internal static FineTuningVertical DeserializeFineTuningVertical(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("modelProvider", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "AzureOpenAI": return AzureOpenAiFineTuning.DeserializeAzureOpenAiFineTuning(element, options); + case "Custom": return CustomModelFineTuning.DeserializeCustomModelFineTuning(element, options); + } + } + return UnknownFineTuningVertical.DeserializeUnknownFineTuningVertical(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); + default: + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support writing '{options.Format}' format."); + } + } + + FineTuningVertical IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFineTuningVertical(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.cs new file mode 100644 index 0000000000000..1e159dda8452b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// + /// 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 FineTuningVertical + { + /// + /// 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 . + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// 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 . + /// + /// [Required] Input model for fine tuning. + /// or is null. + protected FineTuningVertical(FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningFlowModelJobInput model) + { + Argument.AssertNotNull(trainingData, nameof(trainingData)); + Argument.AssertNotNull(model, nameof(model)); + + TaskType = taskType; + TrainingData = trainingData; + Model = model; + } + + /// Initializes a new instance of . + /// [Required] Enum to determine the type of fine tuning. + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// 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 . + /// + /// + /// Validation data for fine tuning. + /// 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 . + /// + /// [Required] Input model for fine tuning. + /// Keeps track of any properties unknown to the library. + internal FineTuningVertical(ModelProvider modelProvider, FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningJobInput validationData, MachineLearningFlowModelJobInput model, IDictionary serializedAdditionalRawData) + { + ModelProvider = modelProvider; + TaskType = taskType; + TrainingData = trainingData; + ValidationData = validationData; + Model = model; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FineTuningVertical() + { + } + + /// [Required] Enum to determine the type of fine tuning. + internal ModelProvider ModelProvider { get; set; } + /// [Required] Fine tuning task type. + public FineTuningTaskType TaskType { get; set; } + /// + /// [Required] Training data for fine tuning. + /// 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 MachineLearningJobInput TrainingData { get; set; } + /// + /// Validation data for fine tuning. + /// 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 MachineLearningJobInput ValidationData { get; set; } + /// [Required] Input model for fine tuning. + public MachineLearningFlowModelJobInput Model { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingModel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingModel.cs index 813b2f098fa16..3c796cd0ff8d8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingModel.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingModel.cs @@ -93,7 +93,7 @@ public ForecastingModel(string value) public static ForecastingModel SGD { get; } = new ForecastingModel(SGDValue); /// /// Random forest is a supervised learning algorithm. - /// The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging method. + /// The "forest" it builds, is an ensemble of decision trees, usually trained with the “bagging” method. /// The general idea of the bagging method is that a combination of learning models increases the overall result. /// public static ForecastingModel RandomForest { get; } = new ForecastingModel(RandomForestValue); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.Serialization.cs index 452c9bf4c13a2..63d4631f965de 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.Serialization.cs @@ -55,23 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("featureLags"u8); writer.WriteStringValue(FeatureLags.Value.ToString()); } - if (Optional.IsCollectionDefined(FeaturesUnknownAtForecastTime)) - { - if (FeaturesUnknownAtForecastTime != null) - { - writer.WritePropertyName("featuresUnknownAtForecastTime"u8); - writer.WriteStartArray(); - foreach (var item in FeaturesUnknownAtForecastTime) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("featuresUnknownAtForecastTime"); - } - } if (Optional.IsDefined(ForecastHorizon)) { writer.WritePropertyName("forecastHorizon"u8); @@ -203,7 +186,6 @@ internal static ForecastingSettings DeserializeForecastingSettings(JsonElement e string countryOrRegionForHolidays = default; int? cvStepSize = default; MachineLearningFeatureLag? featureLags = default; - IList featuresUnknownAtForecastTime = default; ForecastHorizon forecastHorizon = default; string frequency = default; ForecastingSeasonality seasonality = default; @@ -247,21 +229,6 @@ internal static ForecastingSettings DeserializeForecastingSettings(JsonElement e featureLags = new MachineLearningFeatureLag(property.Value.GetString()); continue; } - if (property.NameEquals("featuresUnknownAtForecastTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - featuresUnknownAtForecastTime = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - featuresUnknownAtForecastTime = array; - continue; - } if (property.NameEquals("forecastHorizon"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -372,7 +339,6 @@ internal static ForecastingSettings DeserializeForecastingSettings(JsonElement e countryOrRegionForHolidays, cvStepSize, featureLags, - featuresUnknownAtForecastTime ?? new ChangeTrackingList(), forecastHorizon, frequency, seasonality, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.cs index 0b02dffa468d3..27a0f5bc4046f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.cs @@ -48,7 +48,6 @@ public partial class ForecastingSettings /// Initializes a new instance of . public ForecastingSettings() { - FeaturesUnknownAtForecastTime = new ChangeTrackingList(); TimeSeriesIdColumnNames = new ChangeTrackingList(); } @@ -63,10 +62,6 @@ public ForecastingSettings() /// three days apart. /// /// Flag for generating lags for the numeric features with 'auto' or null. - /// - /// The feature columns that are available for training but unknown at the time of forecast/inference. - /// If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in the dataset are known at inference time. - /// /// /// The desired maximum forecast horizon in units of time-series frequency. /// 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. @@ -101,12 +96,11 @@ public ForecastingSettings() /// /// Configure STL Decomposition of the time-series target column. /// Keeps track of any properties unknown to the library. - internal ForecastingSettings(string countryOrRegionForHolidays, int? cvStepSize, MachineLearningFeatureLag? featureLags, IList featuresUnknownAtForecastTime, ForecastHorizon forecastHorizon, string frequency, ForecastingSeasonality seasonality, MachineLearningShortSeriesHandlingConfiguration? shortSeriesHandlingConfig, TargetAggregationFunction? targetAggregateFunction, TargetLags targetLags, TargetRollingWindowSize targetRollingWindowSize, string timeColumnName, IList timeSeriesIdColumnNames, MachineLearningUseStl? useStl, IDictionary serializedAdditionalRawData) + internal ForecastingSettings(string countryOrRegionForHolidays, int? cvStepSize, MachineLearningFeatureLag? featureLags, ForecastHorizon forecastHorizon, string frequency, ForecastingSeasonality seasonality, MachineLearningShortSeriesHandlingConfiguration? shortSeriesHandlingConfig, TargetAggregationFunction? targetAggregateFunction, TargetLags targetLags, TargetRollingWindowSize targetRollingWindowSize, string timeColumnName, IList timeSeriesIdColumnNames, MachineLearningUseStl? useStl, IDictionary serializedAdditionalRawData) { CountryOrRegionForHolidays = countryOrRegionForHolidays; CvStepSize = cvStepSize; FeatureLags = featureLags; - FeaturesUnknownAtForecastTime = featuresUnknownAtForecastTime; ForecastHorizon = forecastHorizon; Frequency = frequency; Seasonality = seasonality; @@ -134,11 +128,6 @@ internal ForecastingSettings(string countryOrRegionForHolidays, int? cvStepSize, /// Flag for generating lags for the numeric features with 'auto' or null. public MachineLearningFeatureLag? FeatureLags { get; set; } /// - /// The feature columns that are available for training but unknown at the time of forecast/inference. - /// If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in the dataset are known at inference time. - /// - public IList FeaturesUnknownAtForecastTime { get; set; } - /// /// The desired maximum forecast horizon in units of time-series frequency. /// 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 . diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.Serialization.cs index a9cfe765a311c..dd2012704c136 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.Serialization.cs @@ -102,11 +102,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteNull("stackEnsembleSettings"); } } - if (Optional.IsDefined(TrainingMode)) - { - writer.WritePropertyName("trainingMode"u8); - writer.WriteStringValue(TrainingMode.Value.ToString()); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -154,7 +149,6 @@ internal static ForecastingTrainingSettings DeserializeForecastingTrainingSettin bool? enableVoteEnsemble = default; TimeSpan? ensembleModelDownloadTimeout = default; MachineLearningStackEnsembleSettings stackEnsembleSettings = default; - TrainingMode? trainingMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -253,15 +247,6 @@ internal static ForecastingTrainingSettings DeserializeForecastingTrainingSettin stackEnsembleSettings = MachineLearningStackEnsembleSettings.DeserializeMachineLearningStackEnsembleSettings(property.Value, options); continue; } - if (property.NameEquals("trainingMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - trainingMode = new TrainingMode(property.Value.GetString()); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -276,7 +261,6 @@ internal static ForecastingTrainingSettings DeserializeForecastingTrainingSettin enableVoteEnsemble, ensembleModelDownloadTimeout, stackEnsembleSettings, - trainingMode, serializedAdditionalRawData, allowedTrainingAlgorithms ?? new ChangeTrackingList(), blockedTrainingAlgorithms ?? new ChangeTrackingList()); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.cs index b38e7abaced17..54164528aa3f9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.cs @@ -31,15 +31,10 @@ public ForecastingTrainingSettings() /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// /// Stack ensemble settings for stack ensemble run. - /// - /// TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' for now, however in the future may result in mixed mode or heuristics based mode selection. Default is 'auto'. - /// If 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. - /// If 'NonDistributed' then only non distributed algorithms are chosen. - /// /// Keeps track of any properties unknown to the library. /// Allowed models for forecasting task. /// Blocked models for forecasting task. - internal ForecastingTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, TrainingMode? trainingMode, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, trainingMode, serializedAdditionalRawData) + internal ForecastingTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, serializedAdditionalRawData) { AllowedTrainingAlgorithms = allowedTrainingAlgorithms; BlockedTrainingAlgorithms = blockedTrainingAlgorithms; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.Serialization.cs index 140c0f591f36e..092782e3911c1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.Serialization.cs @@ -36,6 +36,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -83,6 +93,7 @@ internal static FqdnOutboundRule DeserializeFqdnOutboundRule(JsonElement element } string destination = default; OutboundRuleCategory? category = default; + IReadOnlyList parentRuleNames = default; OutboundRuleStatus? status = default; OutboundRuleType type = default; IDictionary serializedAdditionalRawData = default; @@ -103,6 +114,20 @@ internal static FqdnOutboundRule DeserializeFqdnOutboundRule(JsonElement element category = new OutboundRuleCategory(property.Value.GetString()); continue; } + if (property.NameEquals("parentRuleNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parentRuleNames = array; + continue; + } if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -123,7 +148,13 @@ internal static FqdnOutboundRule DeserializeFqdnOutboundRule(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new FqdnOutboundRule(category, status, type, serializedAdditionalRawData, destination); + return new FqdnOutboundRule( + category, + parentRuleNames ?? new ChangeTrackingList(), + status, + type, + serializedAdditionalRawData, + destination); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.cs index 77d3b297e501c..2e894cb2e3b49 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.cs @@ -21,11 +21,12 @@ public FqdnOutboundRule() /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. /// - internal FqdnOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, string destination) : base(category, status, outboundRuleType, serializedAdditionalRawData) + internal FqdnOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, string destination) : base(category, parentRuleNames, status, outboundRuleType, serializedAdditionalRawData) { Destination = destination; OutboundRuleType = outboundRuleType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetric.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetric.cs deleted file mode 100644 index b3c88274f1403..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetric.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Generation safety quality metric enum. - public readonly partial struct GenerationSafetyQualityMetric : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public GenerationSafetyQualityMetric(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AcceptableGroundednessScorePerInstanceValue = "AcceptableGroundednessScorePerInstance"; - private const string AggregatedGroundednessPassRateValue = "AggregatedGroundednessPassRate"; - private const string AcceptableCoherenceScorePerInstanceValue = "AcceptableCoherenceScorePerInstance"; - private const string AggregatedCoherencePassRateValue = "AggregatedCoherencePassRate"; - private const string AcceptableFluencyScorePerInstanceValue = "AcceptableFluencyScorePerInstance"; - private const string AggregatedFluencyPassRateValue = "AggregatedFluencyPassRate"; - private const string AcceptableSimilarityScorePerInstanceValue = "AcceptableSimilarityScorePerInstance"; - private const string AggregatedSimilarityPassRateValue = "AggregatedSimilarityPassRate"; - private const string AcceptableRelevanceScorePerInstanceValue = "AcceptableRelevanceScorePerInstance"; - private const string AggregatedRelevancePassRateValue = "AggregatedRelevancePassRate"; - - /// AcceptableGroundednessScorePerInstance. - public static GenerationSafetyQualityMetric AcceptableGroundednessScorePerInstance { get; } = new GenerationSafetyQualityMetric(AcceptableGroundednessScorePerInstanceValue); - /// AggregatedGroundednessPassRate. - public static GenerationSafetyQualityMetric AggregatedGroundednessPassRate { get; } = new GenerationSafetyQualityMetric(AggregatedGroundednessPassRateValue); - /// AcceptableCoherenceScorePerInstance. - public static GenerationSafetyQualityMetric AcceptableCoherenceScorePerInstance { get; } = new GenerationSafetyQualityMetric(AcceptableCoherenceScorePerInstanceValue); - /// AggregatedCoherencePassRate. - public static GenerationSafetyQualityMetric AggregatedCoherencePassRate { get; } = new GenerationSafetyQualityMetric(AggregatedCoherencePassRateValue); - /// AcceptableFluencyScorePerInstance. - public static GenerationSafetyQualityMetric AcceptableFluencyScorePerInstance { get; } = new GenerationSafetyQualityMetric(AcceptableFluencyScorePerInstanceValue); - /// AggregatedFluencyPassRate. - public static GenerationSafetyQualityMetric AggregatedFluencyPassRate { get; } = new GenerationSafetyQualityMetric(AggregatedFluencyPassRateValue); - /// AcceptableSimilarityScorePerInstance. - public static GenerationSafetyQualityMetric AcceptableSimilarityScorePerInstance { get; } = new GenerationSafetyQualityMetric(AcceptableSimilarityScorePerInstanceValue); - /// AggregatedSimilarityPassRate. - public static GenerationSafetyQualityMetric AggregatedSimilarityPassRate { get; } = new GenerationSafetyQualityMetric(AggregatedSimilarityPassRateValue); - /// AcceptableRelevanceScorePerInstance. - public static GenerationSafetyQualityMetric AcceptableRelevanceScorePerInstance { get; } = new GenerationSafetyQualityMetric(AcceptableRelevanceScorePerInstanceValue); - /// AggregatedRelevancePassRate. - public static GenerationSafetyQualityMetric AggregatedRelevancePassRate { get; } = new GenerationSafetyQualityMetric(AggregatedRelevancePassRateValue); - /// Determines if two values are the same. - public static bool operator ==(GenerationSafetyQualityMetric left, GenerationSafetyQualityMetric right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(GenerationSafetyQualityMetric left, GenerationSafetyQualityMetric right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator GenerationSafetyQualityMetric(string value) => new GenerationSafetyQualityMetric(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is GenerationSafetyQualityMetric other && Equals(other); - /// - public bool Equals(GenerationSafetyQualityMetric 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.cs deleted file mode 100644 index 19cb3eb195c70..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Generation safety quality metric threshold definition. - public partial class GenerationSafetyQualityMetricThreshold - { - /// - /// 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 . - /// [Required] Gets or sets the feature attribution metric to calculate. - public GenerationSafetyQualityMetricThreshold(GenerationSafetyQualityMetric metric) - { - Metric = metric; - } - - /// Initializes a new instance of . - /// [Required] Gets or sets the feature attribution metric to calculate. - /// - /// Gets or sets the threshold value. - /// If null, a default value will be set depending on the selected metric. - /// - /// Keeps track of any properties unknown to the library. - internal GenerationSafetyQualityMetricThreshold(GenerationSafetyQualityMetric metric, MonitoringThreshold threshold, IDictionary serializedAdditionalRawData) - { - Metric = metric; - Threshold = threshold; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GenerationSafetyQualityMetricThreshold() - { - } - - /// [Required] Gets or sets the feature attribution metric to calculate. - public GenerationSafetyQualityMetric Metric { get; set; } - /// - /// Gets or sets the threshold value. - /// If null, a default value will be set depending on the selected metric. - /// - internal MonitoringThreshold Threshold { get; set; } - /// The threshold value. If null, the set default is dependent on the metric type. - public double? ThresholdValue - { - get => Threshold is null ? default : Threshold.Value; - set - { - if (Threshold is null) - Threshold = new MonitoringThreshold(); - Threshold.Value = value; - } - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.Serialization.cs deleted file mode 100644 index 4bf3c28900b30..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.Serialization.cs +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class GenerationSafetyQualityMonitoringSignal : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GenerationSafetyQualityMonitoringSignal)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("metricThresholds"u8); - writer.WriteStartArray(); - foreach (var item in MetricThresholds) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsCollectionDefined(ProductionData)) - { - if (ProductionData != null) - { - writer.WritePropertyName("productionData"u8); - writer.WriteStartArray(); - foreach (var item in ProductionData) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("productionData"); - } - } - writer.WritePropertyName("samplingRate"u8); - writer.WriteNumberValue(SamplingRate); - if (Optional.IsDefined(WorkspaceConnectionId)) - { - if (WorkspaceConnectionId != null) - { - writer.WritePropertyName("workspaceConnectionId"u8); - writer.WriteStringValue(WorkspaceConnectionId); - } - else - { - writer.WriteNull("workspaceConnectionId"); - } - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsCollectionDefined(Properties)) - { - if (Properties != null) - { - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("properties"); - } - } - writer.WritePropertyName("signalType"u8); - writer.WriteStringValue(SignalType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GenerationSafetyQualityMonitoringSignal 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(GenerationSafetyQualityMonitoringSignal)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGenerationSafetyQualityMonitoringSignal(document.RootElement, options); - } - - internal static GenerationSafetyQualityMonitoringSignal DeserializeGenerationSafetyQualityMonitoringSignal(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList metricThresholds = default; - IList productionData = default; - double samplingRate = default; - string workspaceConnectionId = default; - MonitoringNotificationMode? mode = default; - IDictionary properties = default; - MonitoringSignalType signalType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metricThresholds"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(GenerationSafetyQualityMetricThreshold.DeserializeGenerationSafetyQualityMetricThreshold(item, options)); - } - metricThresholds = array; - continue; - } - if (property.NameEquals("productionData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - productionData = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MonitoringInputDataBase.DeserializeMonitoringInputDataBase(item, options)); - } - productionData = array; - continue; - } - if (property.NameEquals("samplingRate"u8)) - { - samplingRate = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("workspaceConnectionId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - workspaceConnectionId = null; - continue; - } - workspaceConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new MonitoringNotificationMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - properties = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - properties = dictionary; - continue; - } - if (property.NameEquals("signalType"u8)) - { - signalType = new MonitoringSignalType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GenerationSafetyQualityMonitoringSignal( - mode, - properties ?? new ChangeTrackingDictionary(), - signalType, - serializedAdditionalRawData, - metricThresholds, - productionData ?? new ChangeTrackingList(), - samplingRate, - workspaceConnectionId); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(GenerationSafetyQualityMonitoringSignal)} does not support writing '{options.Format}' format."); - } - } - - GenerationSafetyQualityMonitoringSignal IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGenerationSafetyQualityMonitoringSignal(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GenerationSafetyQualityMonitoringSignal)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.cs deleted file mode 100644 index 5b4d82ae80a19..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Generation safety quality monitoring signal definition. - public partial class GenerationSafetyQualityMonitoringSignal : MonitoringSignalBase - { - /// Initializes a new instance of . - /// [Required] Gets or sets the metrics to calculate and the corresponding thresholds. - /// [Required] The sample rate of the target data, should be greater than 0 and at most 1. - /// is null. - public GenerationSafetyQualityMonitoringSignal(IEnumerable metricThresholds, double samplingRate) - { - Argument.AssertNotNull(metricThresholds, nameof(metricThresholds)); - - MetricThresholds = metricThresholds.ToList(); - ProductionData = new ChangeTrackingList(); - SamplingRate = samplingRate; - SignalType = MonitoringSignalType.GenerationSafetyQuality; - } - - /// Initializes a new instance of . - /// The current notification mode for this signal. - /// Property dictionary. Properties can be added, but not removed or altered. - /// [Required] Specifies the type of signal to monitor. - /// Keeps track of any properties unknown to the library. - /// [Required] Gets or sets the metrics to calculate and the corresponding thresholds. - /// - /// Gets or sets the target data for computing metrics. - /// 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 . - /// - /// [Required] The sample rate of the target data, should be greater than 0 and at most 1. - /// Gets or sets the workspace connection ID used to connect to the content generation endpoint. - internal GenerationSafetyQualityMonitoringSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IList metricThresholds, IList productionData, double samplingRate, string workspaceConnectionId) : base(mode, properties, signalType, serializedAdditionalRawData) - { - MetricThresholds = metricThresholds; - ProductionData = productionData; - SamplingRate = samplingRate; - WorkspaceConnectionId = workspaceConnectionId; - SignalType = signalType; - } - - /// Initializes a new instance of for deserialization. - internal GenerationSafetyQualityMonitoringSignal() - { - } - - /// [Required] Gets or sets the metrics to calculate and the corresponding thresholds. - public IList MetricThresholds { get; } - /// - /// Gets or sets the target data for computing metrics. - /// 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 ProductionData { get; set; } - /// [Required] The sample rate of the target data, should be greater than 0 and at most 1. - public double SamplingRate { get; set; } - /// Gets or sets the workspace connection ID used to connect to the content generation endpoint. - public string WorkspaceConnectionId { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetric.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetric.cs deleted file mode 100644 index 37ec80c7df375..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetric.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Generation token statistics metric enum. - public readonly partial struct GenerationTokenStatisticsMetric : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public GenerationTokenStatisticsMetric(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string TotalTokenCountValue = "TotalTokenCount"; - private const string TotalTokenCountPerGroupValue = "TotalTokenCountPerGroup"; - - /// TotalTokenCount. - public static GenerationTokenStatisticsMetric TotalTokenCount { get; } = new GenerationTokenStatisticsMetric(TotalTokenCountValue); - /// TotalTokenCountPerGroup. - public static GenerationTokenStatisticsMetric TotalTokenCountPerGroup { get; } = new GenerationTokenStatisticsMetric(TotalTokenCountPerGroupValue); - /// Determines if two values are the same. - public static bool operator ==(GenerationTokenStatisticsMetric left, GenerationTokenStatisticsMetric right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(GenerationTokenStatisticsMetric left, GenerationTokenStatisticsMetric right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator GenerationTokenStatisticsMetric(string value) => new GenerationTokenStatisticsMetric(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is GenerationTokenStatisticsMetric other && Equals(other); - /// - public bool Equals(GenerationTokenStatisticsMetric 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.Serialization.cs deleted file mode 100644 index 1a0905704cfea..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class GenerationTokenStatisticsMetricThreshold : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GenerationTokenStatisticsMetricThreshold)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("metric"u8); - writer.WriteStringValue(Metric.ToString()); - if (Optional.IsDefined(Threshold)) - { - if (Threshold != null) - { - writer.WritePropertyName("threshold"u8); - writer.WriteObjectValue(Threshold, options); - } - else - { - writer.WriteNull("threshold"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GenerationTokenStatisticsMetricThreshold 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(GenerationTokenStatisticsMetricThreshold)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGenerationTokenStatisticsMetricThreshold(document.RootElement, options); - } - - internal static GenerationTokenStatisticsMetricThreshold DeserializeGenerationTokenStatisticsMetricThreshold(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - GenerationTokenStatisticsMetric metric = default; - MonitoringThreshold threshold = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metric"u8)) - { - metric = new GenerationTokenStatisticsMetric(property.Value.GetString()); - continue; - } - if (property.NameEquals("threshold"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - threshold = null; - continue; - } - threshold = MonitoringThreshold.DeserializeMonitoringThreshold(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GenerationTokenStatisticsMetricThreshold(metric, threshold, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(GenerationTokenStatisticsMetricThreshold)} does not support writing '{options.Format}' format."); - } - } - - GenerationTokenStatisticsMetricThreshold IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGenerationTokenStatisticsMetricThreshold(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GenerationTokenStatisticsMetricThreshold)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.cs deleted file mode 100644 index 47f20f0b16ce3..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Generation token statistics metric threshold definition. - public partial class GenerationTokenStatisticsMetricThreshold - { - /// - /// 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 . - /// [Required] Gets or sets the feature attribution metric to calculate. - public GenerationTokenStatisticsMetricThreshold(GenerationTokenStatisticsMetric metric) - { - Metric = metric; - } - - /// Initializes a new instance of . - /// [Required] Gets or sets the feature attribution metric to calculate. - /// - /// Gets or sets the threshold value. - /// If null, a default value will be set depending on the selected metric. - /// - /// Keeps track of any properties unknown to the library. - internal GenerationTokenStatisticsMetricThreshold(GenerationTokenStatisticsMetric metric, MonitoringThreshold threshold, IDictionary serializedAdditionalRawData) - { - Metric = metric; - Threshold = threshold; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GenerationTokenStatisticsMetricThreshold() - { - } - - /// [Required] Gets or sets the feature attribution metric to calculate. - public GenerationTokenStatisticsMetric Metric { get; set; } - /// - /// Gets or sets the threshold value. - /// If null, a default value will be set depending on the selected metric. - /// - internal MonitoringThreshold Threshold { get; set; } - /// The threshold value. If null, the set default is dependent on the metric type. - public double? ThresholdValue - { - get => Threshold is null ? default : Threshold.Value; - set - { - if (Threshold is null) - Threshold = new MonitoringThreshold(); - Threshold.Value = value; - } - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.Serialization.cs deleted file mode 100644 index 08d92c3ff00f5..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.Serialization.cs +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class GenerationTokenStatisticsSignal : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GenerationTokenStatisticsSignal)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("metricThresholds"u8); - writer.WriteStartArray(); - foreach (var item in MetricThresholds) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsDefined(ProductionData)) - { - if (ProductionData != null) - { - writer.WritePropertyName("productionData"u8); - writer.WriteObjectValue(ProductionData, options); - } - else - { - writer.WriteNull("productionData"); - } - } - writer.WritePropertyName("samplingRate"u8); - writer.WriteNumberValue(SamplingRate); - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsCollectionDefined(Properties)) - { - if (Properties != null) - { - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("properties"); - } - } - writer.WritePropertyName("signalType"u8); - writer.WriteStringValue(SignalType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GenerationTokenStatisticsSignal 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(GenerationTokenStatisticsSignal)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGenerationTokenStatisticsSignal(document.RootElement, options); - } - - internal static GenerationTokenStatisticsSignal DeserializeGenerationTokenStatisticsSignal(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList metricThresholds = default; - MonitoringInputDataBase productionData = default; - double samplingRate = default; - MonitoringNotificationMode? mode = default; - IDictionary properties = default; - MonitoringSignalType signalType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metricThresholds"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(GenerationTokenStatisticsMetricThreshold.DeserializeGenerationTokenStatisticsMetricThreshold(item, options)); - } - metricThresholds = array; - continue; - } - if (property.NameEquals("productionData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - productionData = null; - continue; - } - productionData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); - continue; - } - if (property.NameEquals("samplingRate"u8)) - { - samplingRate = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new MonitoringNotificationMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - properties = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - properties = dictionary; - continue; - } - if (property.NameEquals("signalType"u8)) - { - signalType = new MonitoringSignalType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GenerationTokenStatisticsSignal( - mode, - properties ?? new ChangeTrackingDictionary(), - signalType, - serializedAdditionalRawData, - metricThresholds, - productionData, - samplingRate); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(GenerationTokenStatisticsSignal)} does not support writing '{options.Format}' format."); - } - } - - GenerationTokenStatisticsSignal IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGenerationTokenStatisticsSignal(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GenerationTokenStatisticsSignal)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.cs deleted file mode 100644 index 1f379fb0c217d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Generation token statistics signal definition. - public partial class GenerationTokenStatisticsSignal : MonitoringSignalBase - { - /// Initializes a new instance of . - /// [Required] Gets or sets the metrics to calculate and the corresponding thresholds. - /// [Required] The sample rate of the target data, should be greater than 0 and at most 1. - /// is null. - public GenerationTokenStatisticsSignal(IEnumerable metricThresholds, double samplingRate) - { - Argument.AssertNotNull(metricThresholds, nameof(metricThresholds)); - - MetricThresholds = metricThresholds.ToList(); - SamplingRate = samplingRate; - SignalType = MonitoringSignalType.GenerationTokenStatistics; - } - - /// Initializes a new instance of . - /// The current notification mode for this signal. - /// Property dictionary. Properties can be added, but not removed or altered. - /// [Required] Specifies the type of signal to monitor. - /// Keeps track of any properties unknown to the library. - /// [Required] Gets or sets the metrics to calculate and the corresponding thresholds. - /// - /// Gets or sets the target data for computing metrics. - /// 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 . - /// - /// [Required] The sample rate of the target data, should be greater than 0 and at most 1. - internal GenerationTokenStatisticsSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IList metricThresholds, MonitoringInputDataBase productionData, double samplingRate) : base(mode, properties, signalType, serializedAdditionalRawData) - { - MetricThresholds = metricThresholds; - ProductionData = productionData; - SamplingRate = samplingRate; - SignalType = signalType; - } - - /// Initializes a new instance of for deserialization. - internal GenerationTokenStatisticsSignal() - { - } - - /// [Required] Gets or sets the metrics to calculate and the corresponding thresholds. - public IList MetricThresholds { get; } - /// - /// Gets or sets the target data for computing metrics. - /// 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 MonitoringInputDataBase ProductionData { get; set; } - /// [Required] The sample rate of the target data, should be greater than 0 and at most 1. - public double SamplingRate { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.Serialization.cs new file mode 100644 index 0000000000000..3d9887f1f8464 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class GetBlobReferenceForConsumptionDto : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetBlobReferenceForConsumptionDto)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(BlobUri)) + { + if (BlobUri != null) + { + writer.WritePropertyName("blobUri"u8); + writer.WriteStringValue(BlobUri.AbsoluteUri); + } + else + { + writer.WriteNull("blobUri"); + } + } + if (Optional.IsDefined(Credential)) + { + if (Credential != null) + { + writer.WritePropertyName("credential"u8); + writer.WriteObjectValue(Credential, options); + } + else + { + writer.WriteNull("credential"); + } + } + if (Optional.IsDefined(StorageAccountArmId)) + { + if (StorageAccountArmId != null) + { + writer.WritePropertyName("storageAccountArmId"u8); + writer.WriteStringValue(StorageAccountArmId); + } + else + { + writer.WriteNull("storageAccountArmId"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetBlobReferenceForConsumptionDto 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(GetBlobReferenceForConsumptionDto)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetBlobReferenceForConsumptionDto(document.RootElement, options); + } + + internal static GetBlobReferenceForConsumptionDto DeserializeGetBlobReferenceForConsumptionDto(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri blobUri = default; + DataReferenceCredential credential = default; + string storageAccountArmId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("blobUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + blobUri = null; + continue; + } + blobUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("credential"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + credential = null; + continue; + } + credential = DataReferenceCredential.DeserializeDataReferenceCredential(property.Value, options); + continue; + } + if (property.NameEquals("storageAccountArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + storageAccountArmId = null; + continue; + } + storageAccountArmId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetBlobReferenceForConsumptionDto(blobUri, credential, storageAccountArmId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetBlobReferenceForConsumptionDto)} does not support writing '{options.Format}' format."); + } + } + + GetBlobReferenceForConsumptionDto IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetBlobReferenceForConsumptionDto(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetBlobReferenceForConsumptionDto)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.cs new file mode 100644 index 0000000000000..8ccc893decb10 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.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 Azure.ResourceManager.MachineLearning.Models +{ + /// The GetBlobReferenceForConsumptionDto. + public partial class GetBlobReferenceForConsumptionDto + { + /// + /// 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 GetBlobReferenceForConsumptionDto() + { + } + + /// Initializes a new instance of . + /// Blob uri, example: https://blob.windows.core.net/Container/Path. + /// + /// Credential info to access storage account + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// The ARM id of the storage account. + /// Keeps track of any properties unknown to the library. + internal GetBlobReferenceForConsumptionDto(Uri blobUri, DataReferenceCredential credential, string storageAccountArmId, IDictionary serializedAdditionalRawData) + { + BlobUri = blobUri; + Credential = credential; + StorageAccountArmId = storageAccountArmId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Blob uri, example: https://blob.windows.core.net/Container/Path. + public Uri BlobUri { get; } + /// + /// Credential info to access storage account + /// 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 DataReferenceCredential Credential { get; } + /// The ARM id of the storage account. + public string StorageAccountArmId { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.Serialization.cs index 53e18169a1f49..e0cfa7d426680 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.Serialization.cs @@ -13,33 +13,43 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class AzureMLBatchInferencingServer : IUtf8JsonSerializable, IJsonModel + public partial class GetBlobReferenceSasRequestDto : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureMLBatchInferencingServer)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasRequestDto)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(CodeConfiguration)) + if (Optional.IsDefined(AssetId)) { - if (CodeConfiguration != null) + if (AssetId != null) { - writer.WritePropertyName("codeConfiguration"u8); - writer.WriteObjectValue(CodeConfiguration, options); + writer.WritePropertyName("assetId"u8); + writer.WriteStringValue(AssetId); } else { - writer.WriteNull("codeConfiguration"); + writer.WriteNull("assetId"); + } + } + if (Optional.IsDefined(BlobUri)) + { + if (BlobUri != null) + { + writer.WritePropertyName("blobUri"u8); + writer.WriteStringValue(BlobUri.AbsoluteUri); + } + else + { + writer.WriteNull("blobUri"); } } - writer.WritePropertyName("serverType"u8); - writer.WriteStringValue(ServerType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +68,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteEndObject(); } - AzureMLBatchInferencingServer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + GetBlobReferenceSasRequestDto IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureMLBatchInferencingServer)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasRequestDto)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureMLBatchInferencingServer(document.RootElement, options); + return DeserializeGetBlobReferenceSasRequestDto(document.RootElement, options); } - internal static AzureMLBatchInferencingServer DeserializeAzureMLBatchInferencingServer(JsonElement element, ModelReaderWriterOptions options = null) + internal static GetBlobReferenceSasRequestDto DeserializeGetBlobReferenceSasRequestDto(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +88,30 @@ internal static AzureMLBatchInferencingServer DeserializeAzureMLBatchInferencing { return null; } - MachineLearningCodeConfiguration codeConfiguration = default; - InferencingServerType serverType = default; + string assetId = default; + Uri blobUri = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("codeConfiguration"u8)) + if (property.NameEquals("assetId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - codeConfiguration = null; + assetId = null; continue; } - codeConfiguration = MachineLearningCodeConfiguration.DeserializeMachineLearningCodeConfiguration(property.Value, options); + assetId = property.Value.GetString(); continue; } - if (property.NameEquals("serverType"u8)) + if (property.NameEquals("blobUri"u8)) { - serverType = new InferencingServerType(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + blobUri = null; + continue; + } + blobUri = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -105,38 +120,38 @@ internal static AzureMLBatchInferencingServer DeserializeAzureMLBatchInferencing } } serializedAdditionalRawData = rawDataDictionary; - return new AzureMLBatchInferencingServer(serverType, serializedAdditionalRawData, codeConfiguration); + return new GetBlobReferenceSasRequestDto(assetId, blobUri, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AzureMLBatchInferencingServer)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasRequestDto)} does not support writing '{options.Format}' format."); } } - AzureMLBatchInferencingServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + GetBlobReferenceSasRequestDto IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureMLBatchInferencingServer(document.RootElement, options); + return DeserializeGetBlobReferenceSasRequestDto(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AzureMLBatchInferencingServer)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasRequestDto)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs new file mode 100644 index 0000000000000..c860522e59fa8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// BlobReferenceSASRequest for getBlobReferenceSAS API. + public partial class GetBlobReferenceSasRequestDto + { + /// + /// 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 . + public GetBlobReferenceSasRequestDto() + { + } + + /// Initializes a new instance of . + /// Id of the asset to be accessed. + /// Blob uri of the asset to be accessed. + /// Keeps track of any properties unknown to the library. + internal GetBlobReferenceSasRequestDto(string assetId, Uri blobUri, IDictionary serializedAdditionalRawData) + { + AssetId = assetId; + BlobUri = blobUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Id of the asset to be accessed. + public string AssetId { get; set; } + /// Blob uri of the asset to be accessed. + public Uri BlobUri { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.Serialization.cs index 8dbb9f086d9f6..3ee870a9c3a78 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.Serialization.cs @@ -13,33 +13,31 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class AzureMLOnlineInferencingServer : IUtf8JsonSerializable, IJsonModel + public partial class GetBlobReferenceSasResponseDto : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureMLOnlineInferencingServer)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasResponseDto)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(CodeConfiguration)) + if (Optional.IsDefined(BlobReferenceForConsumption)) { - if (CodeConfiguration != null) + if (BlobReferenceForConsumption != null) { - writer.WritePropertyName("codeConfiguration"u8); - writer.WriteObjectValue(CodeConfiguration, options); + writer.WritePropertyName("blobReferenceForConsumption"u8); + writer.WriteObjectValue(BlobReferenceForConsumption, options); } else { - writer.WriteNull("codeConfiguration"); + writer.WriteNull("blobReferenceForConsumption"); } } - writer.WritePropertyName("serverType"u8); - writer.WriteStringValue(ServerType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +56,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WriteEndObject(); } - AzureMLOnlineInferencingServer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + GetBlobReferenceSasResponseDto IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureMLOnlineInferencingServer)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasResponseDto)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureMLOnlineInferencingServer(document.RootElement, options); + return DeserializeGetBlobReferenceSasResponseDto(document.RootElement, options); } - internal static AzureMLOnlineInferencingServer DeserializeAzureMLOnlineInferencingServer(JsonElement element, ModelReaderWriterOptions options = null) + internal static GetBlobReferenceSasResponseDto DeserializeGetBlobReferenceSasResponseDto(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +76,19 @@ internal static AzureMLOnlineInferencingServer DeserializeAzureMLOnlineInferenci { return null; } - MachineLearningCodeConfiguration codeConfiguration = default; - InferencingServerType serverType = default; + GetBlobReferenceForConsumptionDto blobReferenceForConsumption = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("codeConfiguration"u8)) + if (property.NameEquals("blobReferenceForConsumption"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - codeConfiguration = null; + blobReferenceForConsumption = null; continue; } - codeConfiguration = MachineLearningCodeConfiguration.DeserializeMachineLearningCodeConfiguration(property.Value, options); - continue; - } - if (property.NameEquals("serverType"u8)) - { - serverType = new InferencingServerType(property.Value.GetString()); + blobReferenceForConsumption = GetBlobReferenceForConsumptionDto.DeserializeGetBlobReferenceForConsumptionDto(property.Value, options); continue; } if (options.Format != "W") @@ -105,38 +97,38 @@ internal static AzureMLOnlineInferencingServer DeserializeAzureMLOnlineInferenci } } serializedAdditionalRawData = rawDataDictionary; - return new AzureMLOnlineInferencingServer(serverType, serializedAdditionalRawData, codeConfiguration); + return new GetBlobReferenceSasResponseDto(blobReferenceForConsumption, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AzureMLOnlineInferencingServer)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasResponseDto)} does not support writing '{options.Format}' format."); } } - AzureMLOnlineInferencingServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + GetBlobReferenceSasResponseDto IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureMLOnlineInferencingServer(document.RootElement, options); + return DeserializeGetBlobReferenceSasResponseDto(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AzureMLOnlineInferencingServer)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasResponseDto)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.cs new file mode 100644 index 0000000000000..b5f0725cb8d29 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// BlobReferenceSASResponse for getBlobReferenceSAS API. + public partial class GetBlobReferenceSasResponseDto + { + /// + /// 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 GetBlobReferenceSasResponseDto() + { + } + + /// Initializes a new instance of . + /// Blob reference for consumption details. + /// Keeps track of any properties unknown to the library. + internal GetBlobReferenceSasResponseDto(GetBlobReferenceForConsumptionDto blobReferenceForConsumption, IDictionary serializedAdditionalRawData) + { + BlobReferenceForConsumption = blobReferenceForConsumption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Blob reference for consumption details. + public GetBlobReferenceForConsumptionDto BlobReferenceForConsumption { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.Serialization.cs deleted file mode 100644 index ec5494c0cf0e1..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.Serialization.cs +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class HdfsDatastore : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(HdfsDatastore)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(HdfsServerCertificate)) - { - if (HdfsServerCertificate != null) - { - writer.WritePropertyName("hdfsServerCertificate"u8); - writer.WriteStringValue(HdfsServerCertificate); - } - else - { - writer.WriteNull("hdfsServerCertificate"); - } - } - writer.WritePropertyName("nameNodeAddress"u8); - writer.WriteStringValue(NameNodeAddress); - if (Optional.IsDefined(Protocol)) - { - writer.WritePropertyName("protocol"u8); - writer.WriteStringValue(Protocol); - } - writer.WritePropertyName("credentials"u8); - writer.WriteObjectValue(Credentials, options); - writer.WritePropertyName("datastoreType"u8); - writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (options.Format != "W" && Optional.IsDefined(IsDefault)) - { - writer.WritePropertyName("isDefault"u8); - writer.WriteBooleanValue(IsDefault.Value); - } - if (Optional.IsDefined(Description)) - { - if (Description != null) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - else - { - writer.WriteNull("description"); - } - } - if (Optional.IsCollectionDefined(Properties)) - { - if (Properties != null) - { - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("properties"); - } - } - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags != null) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("tags"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - HdfsDatastore 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(HdfsDatastore)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeHdfsDatastore(document.RootElement, options); - } - - internal static HdfsDatastore DeserializeHdfsDatastore(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string hdfsServerCertificate = default; - string nameNodeAddress = default; - string protocol = default; - MachineLearningDatastoreCredentials credentials = default; - DatastoreType datastoreType = default; - IntellectualProperty intellectualProperty = default; - bool? isDefault = default; - string description = default; - IDictionary properties = default; - IDictionary tags = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("hdfsServerCertificate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - hdfsServerCertificate = null; - continue; - } - hdfsServerCertificate = property.Value.GetString(); - continue; - } - if (property.NameEquals("nameNodeAddress"u8)) - { - nameNodeAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("protocol"u8)) - { - protocol = property.Value.GetString(); - continue; - } - if (property.NameEquals("credentials"u8)) - { - credentials = MachineLearningDatastoreCredentials.DeserializeMachineLearningDatastoreCredentials(property.Value, options); - continue; - } - if (property.NameEquals("datastoreType"u8)) - { - datastoreType = new DatastoreType(property.Value.GetString()); - continue; - } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } - if (property.NameEquals("isDefault"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isDefault = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("description"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - description = null; - continue; - } - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - properties = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - properties = dictionary; - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tags = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new HdfsDatastore( - description, - properties ?? new ChangeTrackingDictionary(), - tags ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData, - credentials, - datastoreType, - intellectualProperty, - isDefault, - hdfsServerCertificate, - nameNodeAddress, - protocol); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(HdfsDatastore)} does not support writing '{options.Format}' format."); - } - } - - HdfsDatastore IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeHdfsDatastore(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(HdfsDatastore)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.cs deleted file mode 100644 index e999a88598d99..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The HdfsDatastore. - public partial class HdfsDatastore : MachineLearningDatastoreProperties - { - /// Initializes a new instance of . - /// - /// [Required] Account credentials. - /// 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 . - /// - /// [Required] IP Address or DNS HostName. - /// or is null. - public HdfsDatastore(MachineLearningDatastoreCredentials credentials, string nameNodeAddress) : base(credentials) - { - Argument.AssertNotNull(credentials, nameof(credentials)); - Argument.AssertNotNull(nameNodeAddress, nameof(nameNodeAddress)); - - NameNodeAddress = nameNodeAddress; - DatastoreType = DatastoreType.Hdfs; - } - - /// Initializes a new instance of . - /// The asset description text. - /// The asset property dictionary. - /// Tag dictionary. Tags can be added, removed, and updated. - /// Keeps track of any properties unknown to the library. - /// - /// [Required] Account credentials. - /// 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 . - /// - /// [Required] Storage type backing the datastore. - /// Intellectual Property details. - /// Readonly property to indicate if datastore is the workspace default datastore. - /// The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if "Https" protocol is selected. - /// [Required] IP Address or DNS HostName. - /// Protocol used to communicate with the storage account (Https/Http). - internal HdfsDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault, string hdfsServerCertificate, string nameNodeAddress, string protocol) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) - { - HdfsServerCertificate = hdfsServerCertificate; - NameNodeAddress = nameNodeAddress; - Protocol = protocol; - DatastoreType = datastoreType; - } - - /// Initializes a new instance of for deserialization. - internal HdfsDatastore() - { - } - - /// The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if "Https" protocol is selected. - public string HdfsServerCertificate { get; set; } - /// [Required] IP Address or DNS HostName. - public string NameNodeAddress { get; set; } - /// Protocol used to communicate with the storage account (Https/Http). - public string Protocol { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageAnnotationType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageAnnotationType.cs deleted file mode 100644 index 1ebf527ae9aa3..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageAnnotationType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Annotation type of image data. - public readonly partial struct ImageAnnotationType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ImageAnnotationType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ClassificationValue = "Classification"; - private const string BoundingBoxValue = "BoundingBox"; - private const string InstanceSegmentationValue = "InstanceSegmentation"; - - /// Classification. - public static ImageAnnotationType Classification { get; } = new ImageAnnotationType(ClassificationValue); - /// BoundingBox. - public static ImageAnnotationType BoundingBox { get; } = new ImageAnnotationType(BoundingBoxValue); - /// InstanceSegmentation. - public static ImageAnnotationType InstanceSegmentation { get; } = new ImageAnnotationType(InstanceSegmentationValue); - /// Determines if two values are the same. - public static bool operator ==(ImageAnnotationType left, ImageAnnotationType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ImageAnnotationType left, ImageAnnotationType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ImageAnnotationType(string value) => new ImageAnnotationType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ImageAnnotationType other && Equals(other); - /// - public bool Equals(ImageAnnotationType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.Serialization.cs index b92f504003c2a..be73136069480 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.Serialization.cs @@ -41,6 +41,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt writer.WritePropertyName("isLatestOsImageVersion"u8); writer.WriteBooleanValue(IsLatestOSImageVersion.Value); } + if (options.Format != "W" && Optional.IsDefined(OSPatchingStatus)) + { + writer.WritePropertyName("osPatchingStatus"u8); + writer.WriteObjectValue(OSPatchingStatus, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -82,6 +87,7 @@ internal static ImageMetadata DeserializeImageMetadata(JsonElement element, Mode string currentImageVersion = default; string latestImageVersion = default; bool? isLatestOSImageVersion = default; + OSPatchingStatus osPatchingStatus = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -105,13 +111,22 @@ internal static ImageMetadata DeserializeImageMetadata(JsonElement element, Mode isLatestOSImageVersion = property.Value.GetBoolean(); continue; } + if (property.NameEquals("osPatchingStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osPatchingStatus = OSPatchingStatus.DeserializeOSPatchingStatus(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ImageMetadata(currentImageVersion, latestImageVersion, isLatestOSImageVersion, serializedAdditionalRawData); + return new ImageMetadata(currentImageVersion, latestImageVersion, isLatestOSImageVersion, osPatchingStatus, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.cs index 8ce59c4080654..b469c7188effa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.cs @@ -54,12 +54,14 @@ internal ImageMetadata() /// Specifies the current operating system image version this compute instance is running on. /// Specifies the latest available operating system image version. /// Specifies whether this compute instance is running on the latest operating system image. + /// Metadata about the os patching. /// Keeps track of any properties unknown to the library. - internal ImageMetadata(string currentImageVersion, string latestImageVersion, bool? isLatestOSImageVersion, IDictionary serializedAdditionalRawData) + internal ImageMetadata(string currentImageVersion, string latestImageVersion, bool? isLatestOSImageVersion, OSPatchingStatus osPatchingStatus, IDictionary serializedAdditionalRawData) { CurrentImageVersion = currentImageVersion; LatestImageVersion = latestImageVersion; IsLatestOSImageVersion = isLatestOSImageVersion; + OSPatchingStatus = osPatchingStatus; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -69,5 +71,7 @@ internal ImageMetadata(string currentImageVersion, string latestImageVersion, bo public string LatestImageVersion { get; } /// Specifies whether this compute instance is running on the latest operating system image. public bool? IsLatestOSImageVersion { get; } + /// Metadata about the os patching. + public OSPatchingStatus OSPatchingStatus { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.Serialization.cs index 12a14798d215e..cf9df54411cbf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.Serialization.cs @@ -62,16 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteNull("imageSize"); } } - if (Optional.IsDefined(LogTrainingMetrics)) - { - writer.WritePropertyName("logTrainingMetrics"u8); - writer.WriteStringValue(LogTrainingMetrics.Value.ToString()); - } - if (Optional.IsDefined(LogValidationLoss)) - { - writer.WritePropertyName("logValidationLoss"u8); - writer.WriteStringValue(LogValidationLoss.Value.ToString()); - } if (Optional.IsDefined(MaxSize)) { if (MaxSize != null) @@ -589,8 +579,6 @@ internal static ImageModelSettingsObjectDetection DeserializeImageModelSettingsO int? boxDetectionsPerImage = default; float? boxScoreThreshold = default; int? imageSize = default; - LogTrainingMetric? logTrainingMetrics = default; - LogValidationLoss? logValidationLoss = default; int? maxSize = default; int? minSize = default; MachineLearningModelSize? modelSize = default; @@ -667,24 +655,6 @@ internal static ImageModelSettingsObjectDetection DeserializeImageModelSettingsO imageSize = property.Value.GetInt32(); continue; } - if (property.NameEquals("logTrainingMetrics"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - logTrainingMetrics = new LogTrainingMetric(property.Value.GetString()); - continue; - } - if (property.NameEquals("logValidationLoss"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - logValidationLoss = new LogValidationLoss(property.Value.GetString()); - continue; - } if (property.NameEquals("maxSize"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -1144,8 +1114,6 @@ internal static ImageModelSettingsObjectDetection DeserializeImageModelSettingsO boxDetectionsPerImage, boxScoreThreshold, imageSize, - logTrainingMetrics, - logValidationLoss, maxSize, minSize, modelSize, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.cs index 28369c404f2db..8c7361f6720ab 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.cs @@ -88,8 +88,6 @@ public ImageModelSettingsObjectDetection() /// Note: The training run may get into CUDA OOM if the size is too big. /// Note: This settings is only supported for the 'yolov5' algorithm. /// - /// Enable computing and logging training metrics. - /// Enable computing and logging validation loss. /// /// Maximum size of the image to be rescaled before feeding it to the backbone. /// Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. @@ -127,13 +125,11 @@ public ImageModelSettingsObjectDetection() /// /// IOU threshold to use when computing validation metric. Must be float in the range [0, 1]. /// Metric computation method to use for validation metrics. - internal ImageModelSettingsObjectDetection(string advancedSettings, bool? amsGradient, string augmentations, float? beta1, float? beta2, int? checkpointFrequency, MachineLearningFlowModelJobInput checkpointModel, string checkpointRunId, bool? distributed, bool? earlyStopping, int? earlyStoppingDelay, int? earlyStoppingPatience, bool? enableOnnxNormalization, int? evaluationFrequency, int? gradientAccumulationStep, int? layersToFreeze, float? learningRate, LearningRateScheduler? learningRateScheduler, string modelName, float? momentum, bool? nesterov, int? numberOfEpochs, int? numberOfWorkers, StochasticOptimizer? optimizer, int? randomSeed, float? stepLRGamma, int? stepLRStepSize, int? trainingBatchSize, int? validationBatchSize, float? warmupCosineLRCycles, int? warmupCosineLRWarmupEpochs, float? weightDecay, IDictionary serializedAdditionalRawData, int? boxDetectionsPerImage, float? boxScoreThreshold, int? imageSize, LogTrainingMetric? logTrainingMetrics, LogValidationLoss? logValidationLoss, int? maxSize, int? minSize, MachineLearningModelSize? modelSize, bool? multiScale, float? nmsIouThreshold, string tileGridSize, float? tileOverlapRatio, float? tilePredictionsNmsThreshold, float? validationIouThreshold, ValidationMetricType? validationMetricType) : base(advancedSettings, amsGradient, augmentations, beta1, beta2, checkpointFrequency, checkpointModel, checkpointRunId, distributed, earlyStopping, earlyStoppingDelay, earlyStoppingPatience, enableOnnxNormalization, evaluationFrequency, gradientAccumulationStep, layersToFreeze, learningRate, learningRateScheduler, modelName, momentum, nesterov, numberOfEpochs, numberOfWorkers, optimizer, randomSeed, stepLRGamma, stepLRStepSize, trainingBatchSize, validationBatchSize, warmupCosineLRCycles, warmupCosineLRWarmupEpochs, weightDecay, serializedAdditionalRawData) + internal ImageModelSettingsObjectDetection(string advancedSettings, bool? amsGradient, string augmentations, float? beta1, float? beta2, int? checkpointFrequency, MachineLearningFlowModelJobInput checkpointModel, string checkpointRunId, bool? distributed, bool? earlyStopping, int? earlyStoppingDelay, int? earlyStoppingPatience, bool? enableOnnxNormalization, int? evaluationFrequency, int? gradientAccumulationStep, int? layersToFreeze, float? learningRate, LearningRateScheduler? learningRateScheduler, string modelName, float? momentum, bool? nesterov, int? numberOfEpochs, int? numberOfWorkers, StochasticOptimizer? optimizer, int? randomSeed, float? stepLRGamma, int? stepLRStepSize, int? trainingBatchSize, int? validationBatchSize, float? warmupCosineLRCycles, int? warmupCosineLRWarmupEpochs, float? weightDecay, IDictionary serializedAdditionalRawData, int? boxDetectionsPerImage, float? boxScoreThreshold, int? imageSize, int? maxSize, int? minSize, MachineLearningModelSize? modelSize, bool? multiScale, float? nmsIouThreshold, string tileGridSize, float? tileOverlapRatio, float? tilePredictionsNmsThreshold, float? validationIouThreshold, ValidationMetricType? validationMetricType) : base(advancedSettings, amsGradient, augmentations, beta1, beta2, checkpointFrequency, checkpointModel, checkpointRunId, distributed, earlyStopping, earlyStoppingDelay, earlyStoppingPatience, enableOnnxNormalization, evaluationFrequency, gradientAccumulationStep, layersToFreeze, learningRate, learningRateScheduler, modelName, momentum, nesterov, numberOfEpochs, numberOfWorkers, optimizer, randomSeed, stepLRGamma, stepLRStepSize, trainingBatchSize, validationBatchSize, warmupCosineLRCycles, warmupCosineLRWarmupEpochs, weightDecay, serializedAdditionalRawData) { BoxDetectionsPerImage = boxDetectionsPerImage; BoxScoreThreshold = boxScoreThreshold; ImageSize = imageSize; - LogTrainingMetrics = logTrainingMetrics; - LogValidationLoss = logValidationLoss; MaxSize = maxSize; MinSize = minSize; ModelSize = modelSize; @@ -162,10 +158,6 @@ internal ImageModelSettingsObjectDetection(string advancedSettings, bool? amsGra /// Note: This settings is only supported for the 'yolov5' algorithm. /// public int? ImageSize { get; set; } - /// Enable computing and logging training metrics. - public LogTrainingMetric? LogTrainingMetrics { get; set; } - /// Enable computing and logging validation loss. - public LogValidationLoss? LogValidationLoss { get; set; } /// /// Maximum size of the image to be rescaled before feeding it to the backbone. /// Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.Serialization.cs index 8b0b6b9dfe696..b3d8dbe0babe5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.Serialization.cs @@ -36,6 +36,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti writer.WritePropertyName("reference"u8); writer.WriteStringValue(Reference); } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } foreach (var item in AdditionalProperties) { writer.WritePropertyName(item.Key); @@ -73,6 +78,7 @@ internal static ImageSetting DeserializeImageSetting(JsonElement element, ModelR } ImageType? type = default; string reference = default; + string version = default; IDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -91,10 +97,15 @@ internal static ImageSetting DeserializeImageSetting(JsonElement element, ModelR reference = property.Value.GetString(); continue; } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; - return new ImageSetting(type, reference, additionalProperties); + return new ImageSetting(type, reference, version, additionalProperties); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.cs index 00ef5ac2fa0ba..8a86ab8a2086f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.cs @@ -20,20 +20,24 @@ public ImageSetting() } /// Initializes a new instance of . - /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. - /// Image reference URL. + /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML Environment images (custom and curated). + /// Image reference URL if type is docker. Environment name if type is azureml. + /// Version of image being used. If latest then skip this field. /// Additional Properties. - internal ImageSetting(ImageType? imageType, string reference, IDictionary additionalProperties) + internal ImageSetting(ImageType? imageType, string reference, string version, IDictionary additionalProperties) { ImageType = imageType; Reference = reference; + Version = version; AdditionalProperties = additionalProperties; } - /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. + /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML Environment images (custom and curated). public ImageType? ImageType { get; set; } - /// Image reference URL. + /// Image reference URL if type is docker. Environment name if type is azureml. public string Reference { get; set; } + /// Version of image being used. If latest then skip this field. + public string Version { get; set; } /// /// Additional Properties /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageType.cs index 921a3729b3b09..55108f7d762d6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. + /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML Environment images (custom and curated). public readonly partial struct ImageType : IEquatable { private readonly string _value; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.Serialization.cs deleted file mode 100644 index c1dd1a54b14da..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ImportDataAction : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ImportDataAction)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("dataImportDefinition"u8); - writer.WriteObjectValue(DataImportDefinition, options); - writer.WritePropertyName("actionType"u8); - writer.WriteStringValue(ActionType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ImportDataAction 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(ImportDataAction)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeImportDataAction(document.RootElement, options); - } - - internal static ImportDataAction DeserializeImportDataAction(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DataImport dataImportDefinition = default; - ScheduleActionType actionType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("dataImportDefinition"u8)) - { - dataImportDefinition = DataImport.DeserializeDataImport(property.Value, options); - continue; - } - if (property.NameEquals("actionType"u8)) - { - actionType = new ScheduleActionType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ImportDataAction(actionType, serializedAdditionalRawData, dataImportDefinition); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ImportDataAction)} does not support writing '{options.Format}' format."); - } - } - - ImportDataAction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeImportDataAction(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ImportDataAction)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.cs deleted file mode 100644 index e2c041d7741bc..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The ImportDataAction. - public partial class ImportDataAction : MachineLearningScheduleAction - { - /// Initializes a new instance of . - /// [Required] Defines Schedule action definition details. - /// is null. - public ImportDataAction(DataImport dataImportDefinition) - { - Argument.AssertNotNull(dataImportDefinition, nameof(dataImportDefinition)); - - DataImportDefinition = dataImportDefinition; - ActionType = ScheduleActionType.ImportData; - } - - /// Initializes a new instance of . - /// [Required] Specifies the action type of the schedule. - /// Keeps track of any properties unknown to the library. - /// [Required] Defines Schedule action definition details. - internal ImportDataAction(ScheduleActionType actionType, IDictionary serializedAdditionalRawData, DataImport dataImportDefinition) : base(actionType, serializedAdditionalRawData) - { - DataImportDefinition = dataImportDefinition; - ActionType = actionType; - } - - /// Initializes a new instance of for deserialization. - internal ImportDataAction() - { - } - - /// [Required] Defines Schedule action definition details. - public DataImport DataImportDefinition { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IncrementalDataRefresh.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IncrementalDataRefresh.cs deleted file mode 100644 index 600516bf43093..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IncrementalDataRefresh.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Whether IncrementalDataRefresh is enabled. - public readonly partial struct IncrementalDataRefresh : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IncrementalDataRefresh(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static IncrementalDataRefresh Enabled { get; } = new IncrementalDataRefresh(EnabledValue); - /// Disabled. - public static IncrementalDataRefresh Disabled { get; } = new IncrementalDataRefresh(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(IncrementalDataRefresh left, IncrementalDataRefresh right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IncrementalDataRefresh left, IncrementalDataRefresh right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IncrementalDataRefresh(string value) => new IncrementalDataRefresh(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IncrementalDataRefresh other && Equals(other); - /// - public bool Equals(IncrementalDataRefresh 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IndexColumn.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IndexColumn.cs index e50bb72ffd355..6943530eba792 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IndexColumn.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IndexColumn.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing index column. + /// DTO object representing index column. public partial class IndexColumn { /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.Serialization.cs deleted file mode 100644 index 45bde9204ed58..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.Serialization.cs +++ /dev/null @@ -1,113 +0,0 @@ -// 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.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownInferencingServer))] - public partial class InferencingServer : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InferencingServer)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("serverType"u8); - writer.WriteStringValue(ServerType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InferencingServer 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(InferencingServer)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInferencingServer(document.RootElement, options); - } - - internal static InferencingServer DeserializeInferencingServer(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("serverType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AzureMLBatch": return AzureMLBatchInferencingServer.DeserializeAzureMLBatchInferencingServer(element, options); - case "AzureMLOnline": return AzureMLOnlineInferencingServer.DeserializeAzureMLOnlineInferencingServer(element, options); - case "Custom": return CustomInferencingServer.DeserializeCustomInferencingServer(element, options); - case "Triton": return TritonInferencingServer.DeserializeTritonInferencingServer(element, options); - } - } - return UnknownInferencingServer.DeserializeUnknownInferencingServer(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); - default: - throw new FormatException($"The model {nameof(InferencingServer)} does not support writing '{options.Format}' format."); - } - } - - InferencingServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInferencingServer(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InferencingServer)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.cs deleted file mode 100644 index 4618bed24d110..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// - /// 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 InferencingServer - { - /// - /// 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 InferencingServer() - { - } - - /// Initializes a new instance of . - /// [Required] Inferencing server type for various targets. - /// Keeps track of any properties unknown to the library. - internal InferencingServer(InferencingServerType serverType, IDictionary serializedAdditionalRawData) - { - ServerType = serverType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// [Required] Inferencing server type for various targets. - internal InferencingServerType ServerType { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServerType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServerType.cs deleted file mode 100644 index 17bd6dafc12af..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServerType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Inferencing server type for various targets. - internal readonly partial struct InferencingServerType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public InferencingServerType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureMLOnlineValue = "AzureMLOnline"; - private const string AzureMLBatchValue = "AzureMLBatch"; - private const string TritonValue = "Triton"; - private const string CustomValue = "Custom"; - - /// AzureMLOnline. - public static InferencingServerType AzureMLOnline { get; } = new InferencingServerType(AzureMLOnlineValue); - /// AzureMLBatch. - public static InferencingServerType AzureMLBatch { get; } = new InferencingServerType(AzureMLBatchValue); - /// Triton. - public static InferencingServerType Triton { get; } = new InferencingServerType(TritonValue); - /// Custom. - public static InferencingServerType Custom { get; } = new InferencingServerType(CustomValue); - /// Determines if two values are the same. - public static bool operator ==(InferencingServerType left, InferencingServerType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(InferencingServerType left, InferencingServerType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator InferencingServerType(string value) => new InferencingServerType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is InferencingServerType other && Equals(other); - /// - public bool Equals(InferencingServerType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InputPathType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InputPathType.cs deleted file mode 100644 index 7ad2cbbb9b24c..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InputPathType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Input path type for package inputs. - internal readonly partial struct InputPathType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public InputPathType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UrlValue = "Url"; - private const string PathIdValue = "PathId"; - private const string PathVersionValue = "PathVersion"; - - /// Url. - public static InputPathType Url { get; } = new InputPathType(UrlValue); - /// PathId. - public static InputPathType PathId { get; } = new InputPathType(PathIdValue); - /// PathVersion. - public static InputPathType PathVersion { get; } = new InputPathType(PathVersionValue); - /// Determines if two values are the same. - public static bool operator ==(InputPathType left, InputPathType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(InputPathType left, InputPathType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator InputPathType(string value) => new InputPathType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is InputPathType other && Equals(other); - /// - public bool Equals(InputPathType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProtectionLevel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProtectionLevel.cs deleted file mode 100644 index 4119c0a17ed6e..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProtectionLevel.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Protection level associated with the Intellectual Property. - public readonly partial struct IntellectualProtectionLevel : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IntellectualProtectionLevel(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AllValue = "All"; - private const string NoneValue = "None"; - - /// All means Intellectual Property is fully protected. - public static IntellectualProtectionLevel All { get; } = new IntellectualProtectionLevel(AllValue); - /// None means it is not an Intellectual Property. - public static IntellectualProtectionLevel None { get; } = new IntellectualProtectionLevel(NoneValue); - /// Determines if two values are the same. - public static bool operator ==(IntellectualProtectionLevel left, IntellectualProtectionLevel right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IntellectualProtectionLevel left, IntellectualProtectionLevel right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IntellectualProtectionLevel(string value) => new IntellectualProtectionLevel(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IntellectualProtectionLevel other && Equals(other); - /// - public bool Equals(IntellectualProtectionLevel 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobProvisioningState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobProvisioningState.cs deleted file mode 100644 index 79f3cbb6290d5..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobProvisioningState.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Enum to determine the job provisioning state. - public readonly partial struct JobProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public JobProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; - private const string InProgressValue = "InProgress"; - - /// Succeeded. - public static JobProvisioningState Succeeded { get; } = new JobProvisioningState(SucceededValue); - /// Failed. - public static JobProvisioningState Failed { get; } = new JobProvisioningState(FailedValue); - /// Canceled. - public static JobProvisioningState Canceled { get; } = new JobProvisioningState(CanceledValue); - /// InProgress. - public static JobProvisioningState InProgress { get; } = new JobProvisioningState(InProgressValue); - /// Determines if two values are the same. - public static bool operator ==(JobProvisioningState left, JobProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(JobProvisioningState left, JobProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator JobProvisioningState(string value) => new JobProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is JobProvisioningState other && Equals(other); - /// - public bool Equals(JobProvisioningState 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.Serialization.cs index a64e8cb7236f2..346cceeb85de9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class JobQueueSettings : IUtf8JsonSerializable, IJsonModel + internal partial class JobQueueSettings : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -31,18 +31,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WritePropertyName("jobTier"u8); writer.WriteStringValue(JobTier.Value.ToString()); } - if (Optional.IsDefined(Priority)) - { - if (Priority != null) - { - writer.WritePropertyName("priority"u8); - writer.WriteNumberValue(Priority.Value); - } - else - { - writer.WriteNull("priority"); - } - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -82,7 +70,6 @@ internal static JobQueueSettings DeserializeJobQueueSettings(JsonElement element return null; } JobTier? jobTier = default; - int? priority = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -96,23 +83,13 @@ internal static JobQueueSettings DeserializeJobQueueSettings(JsonElement element jobTier = new JobTier(property.Value.GetString()); continue; } - if (property.NameEquals("priority"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - priority = null; - continue; - } - priority = property.Value.GetInt32(); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new JobQueueSettings(jobTier, priority, serializedAdditionalRawData); + return new JobQueueSettings(jobTier, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.cs index 7687041aa01c4..80e6ee11db463 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { /// The JobQueueSettings. - public partial class JobQueueSettings + internal partial class JobQueueSettings { /// /// Keeps track of any properties unknown to the library. @@ -52,18 +52,14 @@ public JobQueueSettings() /// Initializes a new instance of . /// Controls the compute job tier. - /// Controls the priority of the job on a compute. /// Keeps track of any properties unknown to the library. - internal JobQueueSettings(JobTier? jobTier, int? priority, IDictionary serializedAdditionalRawData) + internal JobQueueSettings(JobTier? jobTier, IDictionary serializedAdditionalRawData) { JobTier = jobTier; - Priority = priority; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Controls the compute job tier. public JobTier? JobTier { get; set; } - /// Controls the priority of the job on a compute. - public int? Priority { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.Serialization.cs new file mode 100644 index 0000000000000..de945e485cd9e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class JobResources : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobResources)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(InstanceTypes)) + { + writer.WritePropertyName("instanceTypes"u8); + writer.WriteStartArray(); + foreach (var item in InstanceTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + JobResources 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(JobResources)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobResources(document.RootElement, options); + } + + internal static JobResources DeserializeJobResources(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList instanceTypes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + instanceTypes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new JobResources(instanceTypes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(JobResources)} does not support writing '{options.Format}' format."); + } + } + + JobResources IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeJobResources(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobResources)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.cs new file mode 100644 index 0000000000000..679716f254b4f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The JobResources. + internal partial class JobResources + { + /// + /// 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 . + public JobResources() + { + InstanceTypes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of instance types to choose from. + /// Keeps track of any properties unknown to the library. + internal JobResources(IList instanceTypes, IDictionary serializedAdditionalRawData) + { + InstanceTypes = instanceTypes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of instance types to choose from. + public IList InstanceTypes { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessageLevel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessageLevel.cs deleted file mode 100644 index 54a0f01911a2b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessageLevel.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The JobStatusMessageLevel. - public readonly partial struct JobStatusMessageLevel : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public JobStatusMessageLevel(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ErrorValue = "Error"; - private const string InformationValue = "Information"; - private const string WarningValue = "Warning"; - - /// Error. - public static JobStatusMessageLevel Error { get; } = new JobStatusMessageLevel(ErrorValue); - /// Information. - public static JobStatusMessageLevel Information { get; } = new JobStatusMessageLevel(InformationValue); - /// Warning. - public static JobStatusMessageLevel Warning { get; } = new JobStatusMessageLevel(WarningValue); - /// Determines if two values are the same. - public static bool operator ==(JobStatusMessageLevel left, JobStatusMessageLevel right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(JobStatusMessageLevel left, JobStatusMessageLevel right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator JobStatusMessageLevel(string value) => new JobStatusMessageLevel(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is JobStatusMessageLevel other && Equals(other); - /// - public bool Equals(JobStatusMessageLevel 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobType.cs index 0962389dee3d7..8c54c4277960c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobType.cs @@ -24,23 +24,23 @@ public JobType(string value) private const string AutoMLValue = "AutoML"; private const string CommandValue = "Command"; - private const string LabelingValue = "Labeling"; private const string SweepValue = "Sweep"; private const string PipelineValue = "Pipeline"; private const string SparkValue = "Spark"; + private const string FineTuningValue = "FineTuning"; /// AutoML. public static JobType AutoML { get; } = new JobType(AutoMLValue); /// Command. public static JobType Command { get; } = new JobType(CommandValue); - /// Labeling. - public static JobType Labeling { get; } = new JobType(LabelingValue); /// Sweep. public static JobType Sweep { get; } = new JobType(SweepValue); /// Pipeline. public static JobType Pipeline { get; } = new JobType(PipelineValue); /// Spark. public static JobType Spark { get; } = new JobType(SparkValue); + /// FineTuning. + public static JobType FineTuning { get; } = new JobType(FineTuningValue); /// Determines if two values are the same. public static bool operator ==(JobType left, JobType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretConfiguration.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs index 224f4981ec9bb..d89bab0267277 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs @@ -13,42 +13,38 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class SecretConfiguration : IUtf8JsonSerializable, IJsonModel + public partial class JupyterKernelConfig : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SecretConfiguration)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Uri)) + if (Optional.IsCollectionDefined(Argv)) { - if (Uri != null) + writer.WritePropertyName("argv"u8); + writer.WriteStartArray(); + foreach (var item in Argv) { - writer.WritePropertyName("uri"u8); - writer.WriteStringValue(Uri.AbsoluteUri); - } - else - { - writer.WriteNull("uri"); + writer.WriteStringValue(item); } + writer.WriteEndArray(); } - if (Optional.IsDefined(WorkspaceSecretName)) + if (Optional.IsDefined(DisplayName)) { - if (WorkspaceSecretName != null) - { - writer.WritePropertyName("workspaceSecretName"u8); - writer.WriteStringValue(WorkspaceSecretName); - } - else - { - writer.WriteNull("workspaceSecretName"); - } + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -68,19 +64,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - SecretConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + JupyterKernelConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SecretConfiguration)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSecretConfiguration(document.RootElement, options); + return DeserializeJupyterKernelConfig(document.RootElement, options); } - internal static SecretConfiguration DeserializeSecretConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + internal static JupyterKernelConfig DeserializeJupyterKernelConfig(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -88,30 +84,35 @@ internal static SecretConfiguration DeserializeSecretConfiguration(JsonElement e { return null; } - Uri uri = default; - string workspaceSecretName = default; + IList argv = default; + string displayName = default; + string language = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("uri"u8)) + if (property.NameEquals("argv"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - uri = null; continue; } - uri = new Uri(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + argv = array; continue; } - if (property.NameEquals("workspaceSecretName"u8)) + if (property.NameEquals("displayName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - workspaceSecretName = null; - continue; - } - workspaceSecretName = property.Value.GetString(); + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); continue; } if (options.Format != "W") @@ -120,38 +121,38 @@ internal static SecretConfiguration DeserializeSecretConfiguration(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new SecretConfiguration(uri, workspaceSecretName, serializedAdditionalRawData); + return new JupyterKernelConfig(argv ?? new ChangeTrackingList(), displayName, language, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(SecretConfiguration)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support writing '{options.Format}' format."); } } - SecretConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + JupyterKernelConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSecretConfiguration(document.RootElement, options); + return DeserializeJupyterKernelConfig(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(SecretConfiguration)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessage.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.cs similarity index 60% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessage.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.cs index 796c609008be6..5c65ae7b9990d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessage.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Active message associated with project. - public partial class JobStatusMessage + /// Jupyter kernel configuration. + public partial class JupyterKernelConfig { /// /// Keeps track of any properties unknown to the library. @@ -45,33 +45,30 @@ public partial class JobStatusMessage /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal JobStatusMessage() + /// Initializes a new instance of . + public JupyterKernelConfig() { + Argv = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Service-defined message code. - /// Time in UTC at which the message was created. - /// Severity level of message. - /// A human-readable representation of the message code. + /// Initializes a new instance of . + /// Argument to the the runtime. + /// Display name of the kernel. + /// Language of the kernel [Example value: python]. /// Keeps track of any properties unknown to the library. - internal JobStatusMessage(string code, DateTimeOffset? createdOn, JobStatusMessageLevel? level, string message, IDictionary serializedAdditionalRawData) + internal JupyterKernelConfig(IList argv, string displayName, string language, IDictionary serializedAdditionalRawData) { - Code = code; - CreatedOn = createdOn; - Level = level; - Message = message; + Argv = argv; + DisplayName = displayName; + Language = language; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Service-defined message code. - public string Code { get; } - /// Time in UTC at which the message was created. - public DateTimeOffset? CreatedOn { get; } - /// Severity level of message. - public JobStatusMessageLevel? Level { get; } - /// A human-readable representation of the message code. - public string Message { get; } + /// Argument to the the runtime. + public IList Argv { get; } + /// Display name of the kernel. + public string DisplayName { get; set; } + /// Language of the kernel [Example value: python]. + public string Language { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.Serialization.cs deleted file mode 100644 index a3fcfb7d7467d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.Serialization.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class KerberosKeytabCredentials : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KerberosKeytabCredentials)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("secrets"u8); - writer.WriteObjectValue(Secrets, options); - writer.WritePropertyName("kerberosKdcAddress"u8); - writer.WriteStringValue(KerberosKdcAddress); - writer.WritePropertyName("kerberosPrincipal"u8); - writer.WriteStringValue(KerberosPrincipal); - writer.WritePropertyName("kerberosRealm"u8); - writer.WriteStringValue(KerberosRealm); - writer.WritePropertyName("credentialsType"u8); - writer.WriteStringValue(CredentialsType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - KerberosKeytabCredentials 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(KerberosKeytabCredentials)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKerberosKeytabCredentials(document.RootElement, options); - } - - internal static KerberosKeytabCredentials DeserializeKerberosKeytabCredentials(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - KerberosKeytabSecrets secrets = default; - string kerberosKdcAddress = default; - string kerberosPrincipal = default; - string kerberosRealm = default; - CredentialsType credentialsType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("secrets"u8)) - { - secrets = KerberosKeytabSecrets.DeserializeKerberosKeytabSecrets(property.Value, options); - continue; - } - if (property.NameEquals("kerberosKdcAddress"u8)) - { - kerberosKdcAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("kerberosPrincipal"u8)) - { - kerberosPrincipal = property.Value.GetString(); - continue; - } - if (property.NameEquals("kerberosRealm"u8)) - { - kerberosRealm = property.Value.GetString(); - continue; - } - if (property.NameEquals("credentialsType"u8)) - { - credentialsType = new CredentialsType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new KerberosKeytabCredentials( - credentialsType, - serializedAdditionalRawData, - secrets, - kerberosKdcAddress, - kerberosPrincipal, - kerberosRealm); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(KerberosKeytabCredentials)} does not support writing '{options.Format}' format."); - } - } - - KerberosKeytabCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKerberosKeytabCredentials(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(KerberosKeytabCredentials)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.cs deleted file mode 100644 index 78c2cbf8e7572..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The KerberosKeytabCredentials. - public partial class KerberosKeytabCredentials : MachineLearningDatastoreCredentials - { - /// Initializes a new instance of . - /// [Required] Keytab secrets. - /// [Required] IP Address or DNS HostName. - /// [Required] Kerberos Username. - /// [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. - /// , , or is null. - public KerberosKeytabCredentials(KerberosKeytabSecrets secrets, string kerberosKdcAddress, string kerberosPrincipal, string kerberosRealm) - { - Argument.AssertNotNull(secrets, nameof(secrets)); - Argument.AssertNotNull(kerberosKdcAddress, nameof(kerberosKdcAddress)); - Argument.AssertNotNull(kerberosPrincipal, nameof(kerberosPrincipal)); - Argument.AssertNotNull(kerberosRealm, nameof(kerberosRealm)); - - Secrets = secrets; - KerberosKdcAddress = kerberosKdcAddress; - KerberosPrincipal = kerberosPrincipal; - KerberosRealm = kerberosRealm; - CredentialsType = CredentialsType.KerberosKeytab; - } - - /// Initializes a new instance of . - /// [Required] Credential type used to authentication with storage. - /// Keeps track of any properties unknown to the library. - /// [Required] Keytab secrets. - /// [Required] IP Address or DNS HostName. - /// [Required] Kerberos Username. - /// [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. - internal KerberosKeytabCredentials(CredentialsType credentialsType, IDictionary serializedAdditionalRawData, KerberosKeytabSecrets secrets, string kerberosKdcAddress, string kerberosPrincipal, string kerberosRealm) : base(credentialsType, serializedAdditionalRawData) - { - Secrets = secrets; - KerberosKdcAddress = kerberosKdcAddress; - KerberosPrincipal = kerberosPrincipal; - KerberosRealm = kerberosRealm; - CredentialsType = credentialsType; - } - - /// Initializes a new instance of for deserialization. - internal KerberosKeytabCredentials() - { - } - - /// [Required] Keytab secrets. - public KerberosKeytabSecrets Secrets { get; set; } - /// [Required] IP Address or DNS HostName. - public string KerberosKdcAddress { get; set; } - /// [Required] Kerberos Username. - public string KerberosPrincipal { get; set; } - /// [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. - public string KerberosRealm { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.cs deleted file mode 100644 index 8724364431935..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The KerberosKeytabSecrets. - public partial class KerberosKeytabSecrets : MachineLearningDatastoreSecrets - { - /// Initializes a new instance of . - public KerberosKeytabSecrets() - { - SecretsType = SecretsType.KerberosKeytab; - } - - /// Initializes a new instance of . - /// [Required] Credential type used to authentication with storage. - /// Keeps track of any properties unknown to the library. - /// Kerberos keytab secret. - internal KerberosKeytabSecrets(SecretsType secretsType, IDictionary serializedAdditionalRawData, string kerberosKeytab) : base(secretsType, serializedAdditionalRawData) - { - KerberosKeytab = kerberosKeytab; - SecretsType = secretsType; - } - - /// Kerberos keytab secret. - public string KerberosKeytab { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.Serialization.cs deleted file mode 100644 index 4687f18e42ebb..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.Serialization.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class KerberosPasswordCredentials : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KerberosPasswordCredentials)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("secrets"u8); - writer.WriteObjectValue(Secrets, options); - writer.WritePropertyName("kerberosKdcAddress"u8); - writer.WriteStringValue(KerberosKdcAddress); - writer.WritePropertyName("kerberosPrincipal"u8); - writer.WriteStringValue(KerberosPrincipal); - writer.WritePropertyName("kerberosRealm"u8); - writer.WriteStringValue(KerberosRealm); - writer.WritePropertyName("credentialsType"u8); - writer.WriteStringValue(CredentialsType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - KerberosPasswordCredentials 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(KerberosPasswordCredentials)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKerberosPasswordCredentials(document.RootElement, options); - } - - internal static KerberosPasswordCredentials DeserializeKerberosPasswordCredentials(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - KerberosPasswordSecrets secrets = default; - string kerberosKdcAddress = default; - string kerberosPrincipal = default; - string kerberosRealm = default; - CredentialsType credentialsType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("secrets"u8)) - { - secrets = KerberosPasswordSecrets.DeserializeKerberosPasswordSecrets(property.Value, options); - continue; - } - if (property.NameEquals("kerberosKdcAddress"u8)) - { - kerberosKdcAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("kerberosPrincipal"u8)) - { - kerberosPrincipal = property.Value.GetString(); - continue; - } - if (property.NameEquals("kerberosRealm"u8)) - { - kerberosRealm = property.Value.GetString(); - continue; - } - if (property.NameEquals("credentialsType"u8)) - { - credentialsType = new CredentialsType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new KerberosPasswordCredentials( - credentialsType, - serializedAdditionalRawData, - secrets, - kerberosKdcAddress, - kerberosPrincipal, - kerberosRealm); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(KerberosPasswordCredentials)} does not support writing '{options.Format}' format."); - } - } - - KerberosPasswordCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKerberosPasswordCredentials(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(KerberosPasswordCredentials)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.cs deleted file mode 100644 index 453c346546686..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The KerberosPasswordCredentials. - public partial class KerberosPasswordCredentials : MachineLearningDatastoreCredentials - { - /// Initializes a new instance of . - /// [Required] Kerberos password secrets. - /// [Required] IP Address or DNS HostName. - /// [Required] Kerberos Username. - /// [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. - /// , , or is null. - public KerberosPasswordCredentials(KerberosPasswordSecrets secrets, string kerberosKdcAddress, string kerberosPrincipal, string kerberosRealm) - { - Argument.AssertNotNull(secrets, nameof(secrets)); - Argument.AssertNotNull(kerberosKdcAddress, nameof(kerberosKdcAddress)); - Argument.AssertNotNull(kerberosPrincipal, nameof(kerberosPrincipal)); - Argument.AssertNotNull(kerberosRealm, nameof(kerberosRealm)); - - Secrets = secrets; - KerberosKdcAddress = kerberosKdcAddress; - KerberosPrincipal = kerberosPrincipal; - KerberosRealm = kerberosRealm; - CredentialsType = CredentialsType.KerberosPassword; - } - - /// Initializes a new instance of . - /// [Required] Credential type used to authentication with storage. - /// Keeps track of any properties unknown to the library. - /// [Required] Kerberos password secrets. - /// [Required] IP Address or DNS HostName. - /// [Required] Kerberos Username. - /// [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. - internal KerberosPasswordCredentials(CredentialsType credentialsType, IDictionary serializedAdditionalRawData, KerberosPasswordSecrets secrets, string kerberosKdcAddress, string kerberosPrincipal, string kerberosRealm) : base(credentialsType, serializedAdditionalRawData) - { - Secrets = secrets; - KerberosKdcAddress = kerberosKdcAddress; - KerberosPrincipal = kerberosPrincipal; - KerberosRealm = kerberosRealm; - CredentialsType = credentialsType; - } - - /// Initializes a new instance of for deserialization. - internal KerberosPasswordCredentials() - { - } - - /// [Required] Kerberos password secrets. - public KerberosPasswordSecrets Secrets { get; set; } - /// [Required] IP Address or DNS HostName. - public string KerberosKdcAddress { get; set; } - /// [Required] Kerberos Username. - public string KerberosPrincipal { get; set; } - /// [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. - public string KerberosRealm { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.Serialization.cs deleted file mode 100644 index cb64bd7a046f2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class KerberosPasswordSecrets : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KerberosPasswordSecrets)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(KerberosPassword)) - { - if (KerberosPassword != null) - { - writer.WritePropertyName("kerberosPassword"u8); - writer.WriteStringValue(KerberosPassword); - } - else - { - writer.WriteNull("kerberosPassword"); - } - } - writer.WritePropertyName("secretsType"u8); - writer.WriteStringValue(SecretsType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - KerberosPasswordSecrets 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(KerberosPasswordSecrets)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKerberosPasswordSecrets(document.RootElement, options); - } - - internal static KerberosPasswordSecrets DeserializeKerberosPasswordSecrets(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string kerberosPassword = default; - SecretsType secretsType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kerberosPassword"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - kerberosPassword = null; - continue; - } - kerberosPassword = property.Value.GetString(); - continue; - } - if (property.NameEquals("secretsType"u8)) - { - secretsType = new SecretsType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new KerberosPasswordSecrets(secretsType, serializedAdditionalRawData, kerberosPassword); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(KerberosPasswordSecrets)} does not support writing '{options.Format}' format."); - } - } - - KerberosPasswordSecrets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKerberosPasswordSecrets(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(KerberosPasswordSecrets)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.cs deleted file mode 100644 index 1ee397a9f8d81..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The KerberosPasswordSecrets. - public partial class KerberosPasswordSecrets : MachineLearningDatastoreSecrets - { - /// Initializes a new instance of . - public KerberosPasswordSecrets() - { - SecretsType = SecretsType.KerberosPassword; - } - - /// Initializes a new instance of . - /// [Required] Credential type used to authentication with storage. - /// Keeps track of any properties unknown to the library. - /// Kerberos password secret. - internal KerberosPasswordSecrets(SecretsType secretsType, IDictionary serializedAdditionalRawData, string kerberosPassword) : base(secretsType, serializedAdditionalRawData) - { - KerberosPassword = kerberosPassword; - SecretsType = secretsType; - } - - /// Kerberos password secret. - public string KerberosPassword { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.Serialization.cs deleted file mode 100644 index e60bcbbc4c1db..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.Serialization.cs +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class LabelCategory : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(LabelCategory)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Classes)) - { - if (Classes != null) - { - writer.WritePropertyName("classes"u8); - writer.WriteStartObject(); - foreach (var item in Classes) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("classes"); - } - } - if (Optional.IsDefined(DisplayName)) - { - if (DisplayName != null) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - else - { - writer.WriteNull("displayName"); - } - } - if (Optional.IsDefined(MultiSelect)) - { - writer.WritePropertyName("multiSelect"u8); - writer.WriteStringValue(MultiSelect.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - LabelCategory 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(LabelCategory)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelCategory(document.RootElement, options); - } - - internal static LabelCategory DeserializeLabelCategory(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary classes = default; - string displayName = default; - LabelCategoryMultiSelect? multiSelect = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("classes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - classes = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, LabelClass.DeserializeLabelClass(property0.Value, options)); - } - classes = dictionary; - continue; - } - if (property.NameEquals("displayName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - displayName = null; - continue; - } - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("multiSelect"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - multiSelect = new LabelCategoryMultiSelect(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new LabelCategory(classes ?? new ChangeTrackingDictionary(), displayName, multiSelect, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(LabelCategory)} does not support writing '{options.Format}' format."); - } - } - - LabelCategory IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelCategory(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(LabelCategory)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategoryMultiSelect.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategoryMultiSelect.cs deleted file mode 100644 index d224ba93ab538..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategoryMultiSelect.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Whether multiSelect is enabled. - public readonly partial struct LabelCategoryMultiSelect : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public LabelCategoryMultiSelect(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static LabelCategoryMultiSelect Enabled { get; } = new LabelCategoryMultiSelect(EnabledValue); - /// Disabled. - public static LabelCategoryMultiSelect Disabled { get; } = new LabelCategoryMultiSelect(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(LabelCategoryMultiSelect left, LabelCategoryMultiSelect right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(LabelCategoryMultiSelect left, LabelCategoryMultiSelect right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator LabelCategoryMultiSelect(string value) => new LabelCategoryMultiSelect(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is LabelCategoryMultiSelect other && Equals(other); - /// - public bool Equals(LabelCategoryMultiSelect 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.cs deleted file mode 100644 index 35c47dcbb512d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Properties of a labeling job for image data. - public partial class LabelingJobImageProperties : LabelingJobMediaProperties - { - /// Initializes a new instance of . - public LabelingJobImageProperties() - { - MediaType = MediaType.Image; - } - - /// Initializes a new instance of . - /// [Required] Media type of the job. - /// Keeps track of any properties unknown to the library. - /// Annotation type of image labeling job. - internal LabelingJobImageProperties(MediaType mediaType, IDictionary serializedAdditionalRawData, ImageAnnotationType? annotationType) : base(mediaType, serializedAdditionalRawData) - { - AnnotationType = annotationType; - MediaType = mediaType; - } - - /// Annotation type of image labeling job. - public ImageAnnotationType? AnnotationType { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.Serialization.cs deleted file mode 100644 index 1666fe72a4242..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// 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.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownLabelingJobMediaProperties))] - public partial class LabelingJobMediaProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("mediaType"u8); - writer.WriteStringValue(MediaType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - LabelingJobMediaProperties 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(LabelingJobMediaProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobMediaProperties(document.RootElement, options); - } - - internal static LabelingJobMediaProperties DeserializeLabelingJobMediaProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("mediaType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "Image": return LabelingJobImageProperties.DeserializeLabelingJobImageProperties(element, options); - case "Text": return LabelingJobTextProperties.DeserializeLabelingJobTextProperties(element, options); - } - } - return UnknownLabelingJobMediaProperties.DeserializeUnknownLabelingJobMediaProperties(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); - default: - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support writing '{options.Format}' format."); - } - } - - LabelingJobMediaProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobMediaProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.cs deleted file mode 100644 index 719007a4923bf..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// - /// Properties of a labeling job - /// 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 LabelingJobMediaProperties - { - /// - /// 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 LabelingJobMediaProperties() - { - } - - /// Initializes a new instance of . - /// [Required] Media type of the job. - /// Keeps track of any properties unknown to the library. - internal LabelingJobMediaProperties(MediaType mediaType, IDictionary serializedAdditionalRawData) - { - MediaType = mediaType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// [Required] Media type of the job. - internal MediaType MediaType { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.cs deleted file mode 100644 index 84a82cf2dd8f4..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Labeling job definition. - public partial class LabelingJobProperties : MachineLearningJobProperties - { - /// Initializes a new instance of . - public LabelingJobProperties() - { - LabelCategories = new ChangeTrackingDictionary(); - StatusMessages = new ChangeTrackingList(); - JobType = JobType.Labeling; - } - - /// Initializes a new instance of . - /// The asset description text. - /// The asset property dictionary. - /// Tag dictionary. Tags can be added, removed, and updated. - /// Keeps track of any properties unknown to the library. - /// ARM resource ID of the component resource. - /// ARM resource ID of the compute resource. - /// Display name of job. - /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. - /// - /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. - /// Defaults to AmlToken if null. - /// 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 . - /// - /// Is the asset archived?. - /// [Required] Specifies the type of job. - /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. - /// - /// List of JobEndpoints. - /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - /// - /// Status of the job. - /// Created time of the job in UTC timezone. - /// Configuration of data used in the job. - /// Labeling instructions of the job. - /// Label categories of the job. - /// - /// Media type specific properties in the job. - /// 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 . - /// - /// - /// Configuration of MLAssist feature in the job. - /// 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 . - /// - /// Progress metrics of the job. - /// Internal id of the job(Previously called project). - /// Specifies the labeling job provisioning state. - /// Status messages of the job. - internal LabelingJobProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status, DateTimeOffset? createdOn, LabelingDataConfiguration dataConfiguration, LabelingJobInstructions jobInstructions, IDictionary labelCategories, LabelingJobMediaProperties labelingJobMediaProperties, MachineLearningAssistConfiguration mlAssistConfiguration, ProgressMetrics progressMetrics, Guid? projectId, JobProvisioningState? provisioningState, IReadOnlyList statusMessages) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) - { - CreatedOn = createdOn; - DataConfiguration = dataConfiguration; - JobInstructions = jobInstructions; - LabelCategories = labelCategories; - LabelingJobMediaProperties = labelingJobMediaProperties; - MlAssistConfiguration = mlAssistConfiguration; - ProgressMetrics = progressMetrics; - ProjectId = projectId; - ProvisioningState = provisioningState; - StatusMessages = statusMessages; - JobType = jobType; - } - - /// Created time of the job in UTC timezone. - public DateTimeOffset? CreatedOn { get; } - /// Configuration of data used in the job. - public LabelingDataConfiguration DataConfiguration { get; set; } - /// Labeling instructions of the job. - internal LabelingJobInstructions JobInstructions { get; set; } - /// The link to a page with detailed labeling instructions for labelers. - public Uri JobInstructionsUri - { - get => JobInstructions is null ? default : JobInstructions.Uri; - set - { - if (JobInstructions is null) - JobInstructions = new LabelingJobInstructions(); - JobInstructions.Uri = value; - } - } - - /// Label categories of the job. - public IDictionary LabelCategories { get; set; } - /// - /// Media type specific properties in the job. - /// 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 LabelingJobMediaProperties LabelingJobMediaProperties { get; set; } - /// - /// Configuration of MLAssist feature in the job. - /// 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 MachineLearningAssistConfiguration MlAssistConfiguration { get; set; } - /// Progress metrics of the job. - public ProgressMetrics ProgressMetrics { get; } - /// Internal id of the job(Previously called project). - public Guid? ProjectId { get; } - /// Specifies the labeling job provisioning state. - public JobProvisioningState? ProvisioningState { get; } - /// Status messages of the job. - public IReadOnlyList StatusMessages { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.cs deleted file mode 100644 index e1aa8f0f2770e..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Properties of a labeling job for text data. - public partial class LabelingJobTextProperties : LabelingJobMediaProperties - { - /// Initializes a new instance of . - public LabelingJobTextProperties() - { - MediaType = MediaType.Text; - } - - /// Initializes a new instance of . - /// [Required] Media type of the job. - /// Keeps track of any properties unknown to the library. - /// Annotation type of text labeling job. - internal LabelingJobTextProperties(MediaType mediaType, IDictionary serializedAdditionalRawData, TextAnnotationType? annotationType) : base(mediaType, serializedAdditionalRawData) - { - AnnotationType = annotationType; - MediaType = mediaType; - } - - /// Annotation type of text labeling job. - public TextAnnotationType? AnnotationType { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogTrainingMetric.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogTrainingMetric.cs deleted file mode 100644 index 37e8377741f17..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogTrainingMetric.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The LogTrainingMetric. - public readonly partial struct LogTrainingMetric : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public LogTrainingMetric(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnableValue = "Enable"; - private const string DisableValue = "Disable"; - - /// Enable compute and log training metrics. - public static LogTrainingMetric Enable { get; } = new LogTrainingMetric(EnableValue); - /// Disable compute and log training metrics. - public static LogTrainingMetric Disable { get; } = new LogTrainingMetric(DisableValue); - /// Determines if two values are the same. - public static bool operator ==(LogTrainingMetric left, LogTrainingMetric right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(LogTrainingMetric left, LogTrainingMetric right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator LogTrainingMetric(string value) => new LogTrainingMetric(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is LogTrainingMetric other && Equals(other); - /// - public bool Equals(LogTrainingMetric 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogValidationLoss.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogValidationLoss.cs deleted file mode 100644 index 34c93ab5414e4..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogValidationLoss.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The LogValidationLoss. - public readonly partial struct LogValidationLoss : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public LogValidationLoss(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnableValue = "Enable"; - private const string DisableValue = "Disable"; - - /// Enable compute and log validation metrics. - public static LogValidationLoss Enable { get; } = new LogValidationLoss(EnableValue); - /// Disable compute and log validation metrics. - public static LogValidationLoss Disable { get; } = new LogValidationLoss(DisableValue); - /// Determines if two values are the same. - public static bool operator ==(LogValidationLoss left, LogValidationLoss right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(LogValidationLoss left, LogValidationLoss right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator LogValidationLoss(string value) => new LogValidationLoss(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is LogValidationLoss other && Equals(other); - /// - public bool Equals(LogValidationLoss 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.cs deleted file mode 100644 index ce7c38b2bf326..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Labeling MLAssist configuration definition when MLAssist is disabled. - public partial class MLAssistConfigurationDisabled : MachineLearningAssistConfiguration - { - /// Initializes a new instance of . - public MLAssistConfigurationDisabled() - { - MlAssist = MLAssistConfigurationType.Disabled; - } - - /// Initializes a new instance of . - /// [Required] Indicates whether MLAssist feature is enabled. - /// Keeps track of any properties unknown to the library. - internal MLAssistConfigurationDisabled(MLAssistConfigurationType mlAssist, IDictionary serializedAdditionalRawData) : base(mlAssist, serializedAdditionalRawData) - { - MlAssist = mlAssist; - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationType.cs deleted file mode 100644 index ed666300bfe34..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The MLAssistConfigurationType. - internal readonly partial struct MLAssistConfigurationType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MLAssistConfigurationType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static MLAssistConfigurationType Enabled { get; } = new MLAssistConfigurationType(EnabledValue); - /// Disabled. - public static MLAssistConfigurationType Disabled { get; } = new MLAssistConfigurationType(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(MLAssistConfigurationType left, MLAssistConfigurationType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MLAssistConfigurationType left, MLAssistConfigurationType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MLAssistConfigurationType(string value) => new MLAssistConfigurationType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MLAssistConfigurationType other && Equals(other); - /// - public bool Equals(MLAssistConfigurationType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.Serialization.cs index 119b7a2c53f33..4f4bfc4e577cc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.Serialization.cs @@ -26,18 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead } writer.WriteStartObject(); - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -134,7 +122,6 @@ internal static MachineLearningAssetBase DeserializeMachineLearningAssetBase(Jso { return null; } - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -144,16 +131,6 @@ internal static MachineLearningAssetBase DeserializeMachineLearningAssetBase(Jso Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +200,6 @@ internal static MachineLearningAssetBase DeserializeMachineLearningAssetBase(Jso properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.cs index 3e83c00d7450b..43981242e8a79 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.cs @@ -23,21 +23,17 @@ public MachineLearningAssetBase() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. - internal MachineLearningAssetBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived) : base(description, properties, tags, serializedAdditionalRawData) + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + internal MachineLearningAssetBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived) : base(description, properties, tags, serializedAdditionalRawData) { - AutoDeleteSetting = autoDeleteSetting; IsAnonymous = isAnonymous; IsArchived = isArchived; } - /// Specifies the lifecycle setting of managed data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. + /// If the name version are system generated (anonymous registration). public bool? IsAnonymous { get; set; } - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// Is the asset archived?. public bool? IsArchived { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.Serialization.cs deleted file mode 100644 index ec3628d2e5ec4..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// 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.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownMLAssistConfiguration))] - public partial class MachineLearningAssistConfiguration : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("mlAssist"u8); - writer.WriteStringValue(MlAssist.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MachineLearningAssistConfiguration 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(MachineLearningAssistConfiguration)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningAssistConfiguration(document.RootElement, options); - } - - internal static MachineLearningAssistConfiguration DeserializeMachineLearningAssistConfiguration(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("mlAssist", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "Disabled": return MLAssistConfigurationDisabled.DeserializeMLAssistConfigurationDisabled(element, options); - case "Enabled": return MachineLearningAssistEnabledConfiguration.DeserializeMachineLearningAssistEnabledConfiguration(element, options); - } - } - return UnknownMLAssistConfiguration.DeserializeUnknownMLAssistConfiguration(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); - default: - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support writing '{options.Format}' format."); - } - } - - MachineLearningAssistConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMachineLearningAssistConfiguration(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.Serialization.cs deleted file mode 100644 index 74b8cdc8735cb..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.Serialization.cs +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class MachineLearningAssistEnabledConfiguration : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MachineLearningAssistEnabledConfiguration)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("inferencingComputeBinding"u8); - writer.WriteStringValue(InferencingComputeBinding); - writer.WritePropertyName("trainingComputeBinding"u8); - writer.WriteStringValue(TrainingComputeBinding); - writer.WritePropertyName("mlAssist"u8); - writer.WriteStringValue(MlAssist.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MachineLearningAssistEnabledConfiguration 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(MachineLearningAssistEnabledConfiguration)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningAssistEnabledConfiguration(document.RootElement, options); - } - - internal static MachineLearningAssistEnabledConfiguration DeserializeMachineLearningAssistEnabledConfiguration(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string inferencingComputeBinding = default; - string trainingComputeBinding = default; - MLAssistConfigurationType mlAssist = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("inferencingComputeBinding"u8)) - { - inferencingComputeBinding = property.Value.GetString(); - continue; - } - if (property.NameEquals("trainingComputeBinding"u8)) - { - trainingComputeBinding = property.Value.GetString(); - continue; - } - if (property.NameEquals("mlAssist"u8)) - { - mlAssist = new MLAssistConfigurationType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningAssistEnabledConfiguration(mlAssist, serializedAdditionalRawData, inferencingComputeBinding, trainingComputeBinding); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MachineLearningAssistEnabledConfiguration)} does not support writing '{options.Format}' format."); - } - } - - MachineLearningAssistEnabledConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMachineLearningAssistEnabledConfiguration(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MachineLearningAssistEnabledConfiguration)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.cs deleted file mode 100644 index 8f21b5bcf57c1..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Labeling MLAssist configuration definition when MLAssist is enabled. - public partial class MachineLearningAssistEnabledConfiguration : MachineLearningAssistConfiguration - { - /// Initializes a new instance of . - /// [Required] AML compute binding used in inferencing. - /// [Required] AML compute binding used in training. - /// or is null. - public MachineLearningAssistEnabledConfiguration(string inferencingComputeBinding, string trainingComputeBinding) - { - Argument.AssertNotNull(inferencingComputeBinding, nameof(inferencingComputeBinding)); - Argument.AssertNotNull(trainingComputeBinding, nameof(trainingComputeBinding)); - - InferencingComputeBinding = inferencingComputeBinding; - TrainingComputeBinding = trainingComputeBinding; - MlAssist = MLAssistConfigurationType.Enabled; - } - - /// Initializes a new instance of . - /// [Required] Indicates whether MLAssist feature is enabled. - /// Keeps track of any properties unknown to the library. - /// [Required] AML compute binding used in inferencing. - /// [Required] AML compute binding used in training. - internal MachineLearningAssistEnabledConfiguration(MLAssistConfigurationType mlAssist, IDictionary serializedAdditionalRawData, string inferencingComputeBinding, string trainingComputeBinding) : base(mlAssist, serializedAdditionalRawData) - { - InferencingComputeBinding = inferencingComputeBinding; - TrainingComputeBinding = trainingComputeBinding; - MlAssist = mlAssist; - } - - /// Initializes a new instance of for deserialization. - internal MachineLearningAssistEnabledConfiguration() - { - } - - /// [Required] AML compute binding used in inferencing. - public string InferencingComputeBinding { get; set; } - /// [Required] AML compute binding used in training. - public string TrainingComputeBinding { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.Serialization.cs index a5b620e0f34b4..b9de3228e18b5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.Serialization.cs @@ -107,18 +107,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -219,7 +207,6 @@ internal static MachineLearningAzureBlobDatastore DeserializeMachineLearningAzur string subscriptionId = default; MachineLearningDatastoreCredentials credentials = default; DatastoreType datastoreType = default; - IntellectualProperty intellectualProperty = default; bool? isDefault = default; string description = default; IDictionary properties = default; @@ -307,16 +294,6 @@ internal static MachineLearningAzureBlobDatastore DeserializeMachineLearningAzur datastoreType = new DatastoreType(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("isDefault"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -379,7 +356,6 @@ internal static MachineLearningAzureBlobDatastore DeserializeMachineLearningAzur serializedAdditionalRawData, credentials, datastoreType, - intellectualProperty, isDefault, accountName, containerName, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.cs index 5595b986b1212..dc6f88f223dc6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.cs @@ -17,7 +17,7 @@ public partial class MachineLearningAzureBlobDatastore : MachineLearningDatastor /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// is null. public MachineLearningAzureBlobDatastore(MachineLearningDatastoreCredentials credentials) : base(credentials) @@ -35,10 +35,9 @@ public MachineLearningAzureBlobDatastore(MachineLearningDatastoreCredentials cre /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// Storage account name. /// Storage account container name. @@ -47,7 +46,7 @@ public MachineLearningAzureBlobDatastore(MachineLearningDatastoreCredentials cre /// Indicates which identity to use to authenticate service data access to customer's storage. /// Azure Resource Group name. /// Azure Subscription Id. - internal MachineLearningAzureBlobDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault, string accountName, string containerName, string endpoint, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) + internal MachineLearningAzureBlobDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, string accountName, string containerName, string endpoint, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) { AccountName = accountName; ContainerName = containerName; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.Serialization.cs index 765b9291103a4..0b7cd57f708f3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.Serialization.cs @@ -61,18 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -170,7 +158,6 @@ internal static MachineLearningAzureDataLakeGen1Datastore DeserializeMachineLear string subscriptionId = default; MachineLearningDatastoreCredentials credentials = default; DatastoreType datastoreType = default; - IntellectualProperty intellectualProperty = default; bool? isDefault = default; string description = default; IDictionary properties = default; @@ -223,16 +210,6 @@ internal static MachineLearningAzureDataLakeGen1Datastore DeserializeMachineLear datastoreType = new DatastoreType(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("isDefault"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -295,7 +272,6 @@ internal static MachineLearningAzureDataLakeGen1Datastore DeserializeMachineLear serializedAdditionalRawData, credentials, datastoreType, - intellectualProperty, isDefault, serviceDataAccessAuthIdentity, storeName, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.cs index cea6fa6abb1a9..5a73a38d2ea47 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.cs @@ -17,7 +17,7 @@ public partial class MachineLearningAzureDataLakeGen1Datastore : MachineLearning /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Azure Data Lake store name. /// or is null. @@ -38,16 +38,15 @@ public MachineLearningAzureDataLakeGen1Datastore(MachineLearningDatastoreCredent /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// Indicates which identity to use to authenticate service data access to customer's storage. /// [Required] Azure Data Lake store name. /// Azure Resource Group name. /// Azure Subscription Id. - internal MachineLearningAzureDataLakeGen1Datastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string storeName, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) + internal MachineLearningAzureDataLakeGen1Datastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string storeName, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) { ServiceDataAccessAuthIdentity = serviceDataAccessAuthIdentity; StoreName = storeName; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.Serialization.cs index 9ab950ac6b02d..befcefaa22cd0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.Serialization.cs @@ -87,18 +87,6 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -199,7 +187,6 @@ internal static MachineLearningAzureDataLakeGen2Datastore DeserializeMachineLear string subscriptionId = default; MachineLearningDatastoreCredentials credentials = default; DatastoreType datastoreType = default; - IntellectualProperty intellectualProperty = default; bool? isDefault = default; string description = default; IDictionary properties = default; @@ -277,16 +264,6 @@ internal static MachineLearningAzureDataLakeGen2Datastore DeserializeMachineLear datastoreType = new DatastoreType(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("isDefault"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -349,7 +326,6 @@ internal static MachineLearningAzureDataLakeGen2Datastore DeserializeMachineLear serializedAdditionalRawData, credentials, datastoreType, - intellectualProperty, isDefault, accountName, endpoint, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.cs index 0cd706fe22a78..81af87c094bc7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.cs @@ -17,7 +17,7 @@ public partial class MachineLearningAzureDataLakeGen2Datastore : MachineLearning /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage account name. /// [Required] The name of the Data Lake Gen2 filesystem. @@ -41,10 +41,9 @@ public MachineLearningAzureDataLakeGen2Datastore(MachineLearningDatastoreCredent /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// [Required] Storage account name. /// Azure cloud endpoint for the storage account. @@ -53,7 +52,7 @@ public MachineLearningAzureDataLakeGen2Datastore(MachineLearningDatastoreCredent /// Indicates which identity to use to authenticate service data access to customer's storage. /// Azure Resource Group name. /// Azure Subscription Id. - internal MachineLearningAzureDataLakeGen2Datastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault, string accountName, string endpoint, string filesystem, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) + internal MachineLearningAzureDataLakeGen2Datastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, string accountName, string endpoint, string filesystem, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) { AccountName = accountName; Endpoint = endpoint; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.Serialization.cs index 9490d7877866d..2d7fac71ee08b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.Serialization.cs @@ -87,18 +87,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -199,7 +187,6 @@ internal static MachineLearningAzureFileDatastore DeserializeMachineLearningAzur string subscriptionId = default; MachineLearningDatastoreCredentials credentials = default; DatastoreType datastoreType = default; - IntellectualProperty intellectualProperty = default; bool? isDefault = default; string description = default; IDictionary properties = default; @@ -277,16 +264,6 @@ internal static MachineLearningAzureFileDatastore DeserializeMachineLearningAzur datastoreType = new DatastoreType(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("isDefault"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -349,7 +326,6 @@ internal static MachineLearningAzureFileDatastore DeserializeMachineLearningAzur serializedAdditionalRawData, credentials, datastoreType, - intellectualProperty, isDefault, accountName, endpoint, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.cs index c0f8462e70ed0..92af4aea614e4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.cs @@ -17,7 +17,7 @@ public partial class MachineLearningAzureFileDatastore : MachineLearningDatastor /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage account name. /// [Required] The name of the Azure file share that the datastore points to. @@ -41,10 +41,9 @@ public MachineLearningAzureFileDatastore(MachineLearningDatastoreCredentials cre /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// [Required] Storage account name. /// Azure cloud endpoint for the storage account. @@ -53,7 +52,7 @@ public MachineLearningAzureFileDatastore(MachineLearningDatastoreCredentials cre /// Indicates which identity to use to authenticate service data access to customer's storage. /// Azure Resource Group name. /// Azure Subscription Id. - internal MachineLearningAzureFileDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault, string accountName, string endpoint, string fileShareName, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) + internal MachineLearningAzureFileDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, string accountName, string endpoint, string fileShareName, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) { AccountName = accountName; Endpoint = endpoint; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningBatchDeploymentProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningBatchDeploymentProperties.cs index 858954a1649a9..6de796fcd4b91 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningBatchDeploymentProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningBatchDeploymentProperties.cs @@ -21,7 +21,7 @@ public MachineLearningBatchDeploymentProperties() /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.Serialization.cs index 5619958b01772..1bc9927fd9ff4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.Serialization.cs @@ -43,18 +43,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -153,7 +141,6 @@ internal static MachineLearningCodeVersionProperties DeserializeMachineLearningC } Uri codeUri = default; RegistryAssetProvisioningState? provisioningState = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -182,16 +169,6 @@ internal static MachineLearningCodeVersionProperties DeserializeMachineLearningC provisioningState = new RegistryAssetProvisioningState(property.Value.GetString()); continue; } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -261,7 +238,6 @@ internal static MachineLearningCodeVersionProperties DeserializeMachineLearningC properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, codeUri, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.cs index e4652f1a1eefe..7699b04ba1306 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.cs @@ -23,12 +23,11 @@ public MachineLearningCodeVersionProperties() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Uri where code is located. /// Provisioning state for the code version. - internal MachineLearningCodeVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, Uri codeUri, RegistryAssetProvisioningState? provisioningState) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningCodeVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, Uri codeUri, RegistryAssetProvisioningState? provisioningState) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { CodeUri = codeUri; ProvisioningState = provisioningState; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.Serialization.cs index 3b89660666154..658beadf1bf28 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.Serialization.cs @@ -26,18 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea } writer.WriteStartObject(); - if (Optional.IsDefined(AutologgerSettings)) - { - if (AutologgerSettings != null) - { - writer.WritePropertyName("autologgerSettings"u8); - writer.WriteObjectValue(AutologgerSettings, options); - } - else - { - writer.WriteNull("autologgerSettings"); - } - } if (Optional.IsDefined(CodeId)) { if (CodeId != null) @@ -240,24 +228,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -367,7 +337,6 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J { return null; } - AutologgerSettings autologgerSettings = default; ResourceIdentifier codeId = default; string command = default; MachineLearningDistributionConfiguration distribution = default; @@ -387,7 +356,6 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J bool? isArchived = default; JobType jobType = default; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -397,16 +365,6 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("autologgerSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autologgerSettings = null; - continue; - } - autologgerSettings = AutologgerSettings.DeserializeAutologgerSettings(property.Value, options); - continue; - } if (property.NameEquals("codeId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -590,21 +548,6 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -688,10 +631,8 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status, - autologgerSettings, codeId, command, distribution, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.cs index eb98f61d42e47..a321da1c827da 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.cs @@ -49,19 +49,17 @@ public MachineLearningCommandJob(string command, ResourceIdentifier environmentI /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. /// /// Status of the job. - /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// ARM resource ID of the code asset. /// [Required] The command to execute on startup of the job. eg. "python train.py". /// - /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, Ray, or null. + /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// /// [Required] The ARM resource ID of the Environment specification for the job. /// Environment variables included in the job. @@ -79,9 +77,8 @@ public MachineLearningCommandJob(string command, ResourceIdentifier environmentI /// Input parameters. /// Queue settings for the job. /// Compute Resource configuration for the job. - internal MachineLearningCommandJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status, AutologgerSettings autologgerSettings, ResourceIdentifier codeId, string command, MachineLearningDistributionConfiguration distribution, ResourceIdentifier environmentId, IDictionary environmentVariables, IDictionary inputs, MachineLearningCommandJobLimits limits, IDictionary outputs, BinaryData parameters, JobQueueSettings queueSettings, MachineLearningJobResourceConfiguration resources) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) + internal MachineLearningCommandJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, ResourceIdentifier codeId, string command, MachineLearningDistributionConfiguration distribution, ResourceIdentifier environmentId, IDictionary environmentVariables, IDictionary inputs, MachineLearningCommandJobLimits limits, IDictionary outputs, BinaryData parameters, JobQueueSettings queueSettings, MachineLearningJobResourceConfiguration resources) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) { - AutologgerSettings = autologgerSettings; CodeId = codeId; Command = command; Distribution = distribution; @@ -101,26 +98,14 @@ internal MachineLearningCommandJob() { } - /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. - internal AutologgerSettings AutologgerSettings { get; set; } - /// [Required] Indicates whether mlflow autologger is enabled. - public MachineLearningFlowAutoLoggerState? MlflowAutologger - { - get => AutologgerSettings is null ? default(MachineLearningFlowAutoLoggerState?) : AutologgerSettings.MlflowAutologger; - set - { - AutologgerSettings = value.HasValue ? new AutologgerSettings(value.Value) : null; - } - } - /// ARM resource ID of the code asset. public ResourceIdentifier CodeId { get; set; } /// [Required] The command to execute on startup of the job. eg. "python train.py". public string Command { get; set; } /// - /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, Ray, or null. + /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// public MachineLearningDistributionConfiguration Distribution { get; set; } /// [Required] The ARM resource ID of the Environment specification for the job. @@ -173,7 +158,19 @@ public MachineLearningFlowAutoLoggerState? MlflowAutologger /// public BinaryData Parameters { get; } /// Queue settings for the job. - public JobQueueSettings QueueSettings { get; set; } + internal JobQueueSettings QueueSettings { get; set; } + /// Controls the compute job tier. + public JobTier? QueueJobTier + { + get => QueueSettings is null ? default : QueueSettings.JobTier; + set + { + if (QueueSettings is null) + QueueSettings = new JobQueueSettings(); + QueueSettings.JobTier = value; + } + } + /// Compute Resource configuration for the job. public MachineLearningJobResourceConfiguration Resources { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.Serialization.cs index 67393e125c15f..5e4f6c925edf8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.Serialization.cs @@ -50,30 +50,6 @@ void IJsonModel.Write(Utf8JsonWriter writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -172,8 +148,6 @@ internal static MachineLearningComponentVersionProperties DeserializeMachineLear } BinaryData componentSpec = default; RegistryAssetProvisioningState? provisioningState = default; - string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -202,26 +176,6 @@ internal static MachineLearningComponentVersionProperties DeserializeMachineLear provisioningState = new RegistryAssetProvisioningState(property.Value.GetString()); continue; } - if (property.NameEquals("stage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - stage = null; - continue; - } - stage = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -291,12 +245,10 @@ internal static MachineLearningComponentVersionProperties DeserializeMachineLear properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, componentSpec, - provisioningState, - stage); + provisioningState); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.cs index 9535a131f38e4..56437e718d34e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.cs @@ -23,20 +23,17 @@ public MachineLearningComponentVersionProperties() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// /// Defines Component definition details. /// <see href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" /> /// /// Provisioning state for the component version. - /// Stage in the component lifecycle. - internal MachineLearningComponentVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, BinaryData componentSpec, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningComponentVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, BinaryData componentSpec, RegistryAssetProvisioningState? provisioningState) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { ComponentSpec = componentSpec; ProvisioningState = provisioningState; - Stage = stage; } /// @@ -73,7 +70,5 @@ internal MachineLearningComponentVersionProperties(string description, IDictiona public BinaryData ComponentSpec { get; set; } /// Provisioning state for the component version. public RegistryAssetProvisioningState? ProvisioningState { get; } - /// Stage in the component lifecycle. - public string Stage { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.Serialization.cs index e0328ddb0c164..a7b48637fc36c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.Serialization.cs @@ -46,6 +46,11 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("mountAction"u8); writer.WriteStringValue(MountAction.Value.ToString()); } + if (Optional.IsDefined(MountMode)) + { + writer.WritePropertyName("mountMode"u8); + writer.WriteStringValue(MountMode.Value.ToString()); + } if (Optional.IsDefined(CreatedBy)) { writer.WritePropertyName("createdBy"u8); @@ -113,6 +118,7 @@ internal static MachineLearningComputeInstanceDataMount DeserializeMachineLearni MachineLearningSourceType? sourceType = default; string mountName = default; MachineLearningMountAction? mountAction = default; + MountMode? mountMode = default; string createdBy = default; string mountPath = default; MachineLearningMountState? mountState = default; @@ -150,6 +156,15 @@ internal static MachineLearningComputeInstanceDataMount DeserializeMachineLearni mountAction = new MachineLearningMountAction(property.Value.GetString()); continue; } + if (property.NameEquals("mountMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mountMode = new MountMode(property.Value.GetString()); + continue; + } if (property.NameEquals("createdBy"u8)) { createdBy = property.Value.GetString(); @@ -194,6 +209,7 @@ internal static MachineLearningComputeInstanceDataMount DeserializeMachineLearni sourceType, mountName, mountAction, + mountMode, createdBy, mountPath, mountState, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.cs index 0810ecad2bbd0..bed98f0652e2c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.cs @@ -46,7 +46,7 @@ public partial class MachineLearningComputeInstanceDataMount private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal MachineLearningComputeInstanceDataMount() + public MachineLearningComputeInstanceDataMount() { } @@ -55,18 +55,20 @@ internal MachineLearningComputeInstanceDataMount() /// Data source type. /// name of the ComputeInstance data mount. /// Mount Action. + /// Mount Mode. /// who this data mount created by. /// Path of this data mount. /// Mount state. /// The time when the disk mounted. /// Error of this data mount. /// Keeps track of any properties unknown to the library. - internal MachineLearningComputeInstanceDataMount(string source, MachineLearningSourceType? sourceType, string mountName, MachineLearningMountAction? mountAction, string createdBy, string mountPath, MachineLearningMountState? mountState, DateTimeOffset? mountedOn, string error, IDictionary serializedAdditionalRawData) + internal MachineLearningComputeInstanceDataMount(string source, MachineLearningSourceType? sourceType, string mountName, MachineLearningMountAction? mountAction, MountMode? mountMode, string createdBy, string mountPath, MachineLearningMountState? mountState, DateTimeOffset? mountedOn, string error, IDictionary serializedAdditionalRawData) { Source = source; SourceType = sourceType; MountName = mountName; MountAction = mountAction; + MountMode = mountMode; CreatedBy = createdBy; MountPath = mountPath; MountState = mountState; @@ -76,22 +78,24 @@ internal MachineLearningComputeInstanceDataMount(string source, MachineLearningS } /// Source of the ComputeInstance data mount. - public string Source { get; } + public string Source { get; set; } /// Data source type. - public MachineLearningSourceType? SourceType { get; } + public MachineLearningSourceType? SourceType { get; set; } /// name of the ComputeInstance data mount. - public string MountName { get; } + public string MountName { get; set; } /// Mount Action. - public MachineLearningMountAction? MountAction { get; } + public MachineLearningMountAction? MountAction { get; set; } + /// Mount Mode. + public MountMode? MountMode { get; set; } /// who this data mount created by. - public string CreatedBy { get; } + public string CreatedBy { get; set; } /// Path of this data mount. - public string MountPath { get; } + public string MountPath { get; set; } /// Mount state. - public MachineLearningMountState? MountState { get; } + public MachineLearningMountState? MountState { get; set; } /// The time when the disk mounted. - public DateTimeOffset? MountedOn { get; } + public DateTimeOffset? MountedOn { get; set; } /// Error of this data mount. - public string Error { get; } + public string Error { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs index eea3fa2910e96..42dd75d59021c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs @@ -141,6 +141,54 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WriteNull("computeInstanceAuthorizationType"); } } + if (Optional.IsDefined(EnableOSPatching)) + { + if (EnableOSPatching != null) + { + writer.WritePropertyName("enableOSPatching"u8); + writer.WriteBooleanValue(EnableOSPatching.Value); + } + else + { + writer.WriteNull("enableOSPatching"); + } + } + if (Optional.IsDefined(EnableRootAccess)) + { + if (EnableRootAccess != null) + { + writer.WritePropertyName("enableRootAccess"u8); + writer.WriteBooleanValue(EnableRootAccess.Value); + } + else + { + writer.WriteNull("enableRootAccess"); + } + } + if (Optional.IsDefined(EnableSso)) + { + if (EnableSso != null) + { + writer.WritePropertyName("enableSSO"u8); + writer.WriteBooleanValue(EnableSso.Value); + } + else + { + writer.WriteNull("enableSSO"); + } + } + if (Optional.IsDefined(ReleaseQuotaOnStop)) + { + if (ReleaseQuotaOnStop != null) + { + writer.WritePropertyName("releaseQuotaOnStop"u8); + writer.WriteBooleanValue(ReleaseQuotaOnStop.Value); + } + else + { + writer.WriteNull("releaseQuotaOnStop"); + } + } if (Optional.IsDefined(PersonalComputeInstanceSettings)) { if (PersonalComputeInstanceSettings != null) @@ -313,6 +361,10 @@ internal static MachineLearningComputeInstanceProperties DeserializeMachineLearn IReadOnlyList errors = default; MachineLearningComputeInstanceState? state = default; MachineLearningComputeInstanceAuthorizationType? computeInstanceAuthorizationType = default; + bool? enableOSPatching = default; + bool? enableRootAccess = default; + bool? enableSso = default; + bool? releaseQuotaOnStop = default; PersonalComputeInstanceSettings personalComputeInstanceSettings = default; SetupScripts setupScripts = default; MachineLearningComputeInstanceLastOperation lastOperation = default; @@ -460,6 +512,46 @@ internal static MachineLearningComputeInstanceProperties DeserializeMachineLearn computeInstanceAuthorizationType = new MachineLearningComputeInstanceAuthorizationType(property.Value.GetString()); continue; } + if (property.NameEquals("enableOSPatching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + enableOSPatching = null; + continue; + } + enableOSPatching = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableRootAccess"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + enableRootAccess = null; + continue; + } + enableRootAccess = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableSSO"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + enableSso = null; + continue; + } + enableSso = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("releaseQuotaOnStop"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + releaseQuotaOnStop = null; + continue; + } + releaseQuotaOnStop = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("personalComputeInstanceSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -589,6 +681,10 @@ internal static MachineLearningComputeInstanceProperties DeserializeMachineLearn errors ?? new ChangeTrackingList(), state, computeInstanceAuthorizationType, + enableOSPatching, + enableRootAccess, + enableSso, + releaseQuotaOnStop, personalComputeInstanceSettings, setupScripts, lastOperation, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs index 25d507075a028..dca78aeb8fbe3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs @@ -71,6 +71,10 @@ public MachineLearningComputeInstanceProperties() /// Collection of errors encountered on this ComputeInstance. /// The current state of this ComputeInstance. /// The Compute Instance Authorization type. Available values are personal (default). + /// Enable Auto OS Patching. Possible values are: true, false. + /// Enable root access. Possible values are: true, false. + /// Enable SSO (single sign on). Possible values are: true, false. + /// Release quota if compute instance stopped. Possible values are: true - release quota if compute instance stopped. false - don't release quota when compute instance stopped. /// Settings for a personal compute instance. /// Details of customized scripts to execute for setting up the cluster. /// The last operation on ComputeInstance. @@ -82,7 +86,7 @@ public MachineLearningComputeInstanceProperties() /// Describes informations of dataMounts on this ComputeInstance. /// ComputeInstance version. /// Keeps track of any properties unknown to the library. - internal MachineLearningComputeInstanceProperties(string vmSize, ResourceId subnet, MachineLearningApplicationSharingPolicy? applicationSharingPolicy, ComputeInstanceAutologgerSettings autologgerSettings, MachineLearningComputeInstanceSshSettings sshSettings, IList customServices, ImageMetadata osImageMetadata, MachineLearningComputeInstanceConnectivityEndpoints connectivityEndpoints, IReadOnlyList applications, MachineLearningComputeInstanceCreatedBy createdBy, IReadOnlyList errors, MachineLearningComputeInstanceState? state, MachineLearningComputeInstanceAuthorizationType? computeInstanceAuthorizationType, PersonalComputeInstanceSettings personalComputeInstanceSettings, SetupScripts setupScriptsSettings, MachineLearningComputeInstanceLastOperation lastOperation, ComputeSchedules schedules, string idleTimeBeforeShutdown, bool? enableNodePublicIP, IReadOnlyList containers, IReadOnlyList dataDisks, IReadOnlyList dataMounts, ComputeInstanceVersion versions, IDictionary serializedAdditionalRawData) + internal MachineLearningComputeInstanceProperties(string vmSize, ResourceId subnet, MachineLearningApplicationSharingPolicy? applicationSharingPolicy, ComputeInstanceAutologgerSettings autologgerSettings, MachineLearningComputeInstanceSshSettings sshSettings, IList customServices, ImageMetadata osImageMetadata, MachineLearningComputeInstanceConnectivityEndpoints connectivityEndpoints, IReadOnlyList applications, MachineLearningComputeInstanceCreatedBy createdBy, IReadOnlyList errors, MachineLearningComputeInstanceState? state, MachineLearningComputeInstanceAuthorizationType? computeInstanceAuthorizationType, bool? enableOSPatching, bool? enableRootAccess, bool? enableSso, bool? releaseQuotaOnStop, PersonalComputeInstanceSettings personalComputeInstanceSettings, SetupScripts setupScriptsSettings, MachineLearningComputeInstanceLastOperation lastOperation, ComputeSchedules schedules, string idleTimeBeforeShutdown, bool? enableNodePublicIP, IReadOnlyList containers, IReadOnlyList dataDisks, IReadOnlyList dataMounts, ComputeInstanceVersion versions, IDictionary serializedAdditionalRawData) { VmSize = vmSize; Subnet = subnet; @@ -97,6 +101,10 @@ internal MachineLearningComputeInstanceProperties(string vmSize, ResourceId subn Errors = errors; State = state; ComputeInstanceAuthorizationType = computeInstanceAuthorizationType; + EnableOSPatching = enableOSPatching; + EnableRootAccess = enableRootAccess; + EnableSso = enableSso; + ReleaseQuotaOnStop = releaseQuotaOnStop; PersonalComputeInstanceSettings = personalComputeInstanceSettings; SetupScriptsSettings = setupScriptsSettings; LastOperation = lastOperation; @@ -155,6 +163,14 @@ public MachineLearningFlowAutoLogger? MlflowAutologger public MachineLearningComputeInstanceState? State { get; } /// The Compute Instance Authorization type. Available values are personal (default). public MachineLearningComputeInstanceAuthorizationType? ComputeInstanceAuthorizationType { get; set; } + /// Enable Auto OS Patching. Possible values are: true, false. + public bool? EnableOSPatching { get; set; } + /// Enable root access. Possible values are: true, false. + public bool? EnableRootAccess { get; set; } + /// Enable SSO (single sign on). Possible values are: true, false. + public bool? EnableSso { get; set; } + /// Release quota if compute instance stopped. Possible values are: true - release quota if compute instance stopped. false - don't release quota when compute instance stopped. + public bool? ReleaseQuotaOnStop { get; set; } /// Settings for a personal compute instance. internal PersonalComputeInstanceSettings PersonalComputeInstanceSettings { get; set; } /// A user explicitly assigned to a personal compute instance. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceState.cs index 924e9af414edb..5cd4f18a8ef4c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceState.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceState.cs @@ -27,6 +27,7 @@ public MachineLearningComputeInstanceState(string value) private const string DeletingValue = "Deleting"; private const string RunningValue = "Running"; private const string RestartingValue = "Restarting"; + private const string ResizingValue = "Resizing"; private const string JobRunningValue = "JobRunning"; private const string SettingUpValue = "SettingUp"; private const string SetupFailedValue = "SetupFailed"; @@ -48,6 +49,8 @@ public MachineLearningComputeInstanceState(string value) public static MachineLearningComputeInstanceState Running { get; } = new MachineLearningComputeInstanceState(RunningValue); /// Restarting. public static MachineLearningComputeInstanceState Restarting { get; } = new MachineLearningComputeInstanceState(RestartingValue); + /// Resizing. + public static MachineLearningComputeInstanceState Resizing { get; } = new MachineLearningComputeInstanceState(ResizingValue); /// JobRunning. public static MachineLearningComputeInstanceState JobRunning { get; } = new MachineLearningComputeInstanceState(JobRunningValue); /// SettingUp. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionAuthType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionAuthType.cs index e427c9b0f81e7..0408bdfbea50b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionAuthType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionAuthType.cs @@ -27,10 +27,13 @@ public MachineLearningConnectionAuthType(string value) private const string UsernamePasswordValue = "UsernamePassword"; private const string NoneValue = "None"; private const string SasValue = "SAS"; + private const string AccountKeyValue = "AccountKey"; private const string ServicePrincipalValue = "ServicePrincipal"; private const string AccessKeyValue = "AccessKey"; private const string ApiKeyValue = "ApiKey"; private const string CustomKeysValue = "CustomKeys"; + private const string OAuth2Value = "OAuth2"; + private const string AadValue = "AAD"; /// PAT. public static MachineLearningConnectionAuthType Pat { get; } = new MachineLearningConnectionAuthType(PatValue); @@ -42,6 +45,8 @@ public MachineLearningConnectionAuthType(string value) public static MachineLearningConnectionAuthType None { get; } = new MachineLearningConnectionAuthType(NoneValue); /// SAS. public static MachineLearningConnectionAuthType Sas { get; } = new MachineLearningConnectionAuthType(SasValue); + /// AccountKey. + public static MachineLearningConnectionAuthType AccountKey { get; } = new MachineLearningConnectionAuthType(AccountKeyValue); /// ServicePrincipal. public static MachineLearningConnectionAuthType ServicePrincipal { get; } = new MachineLearningConnectionAuthType(ServicePrincipalValue); /// AccessKey. @@ -50,6 +55,10 @@ public MachineLearningConnectionAuthType(string value) public static MachineLearningConnectionAuthType ApiKey { get; } = new MachineLearningConnectionAuthType(ApiKeyValue); /// CustomKeys. public static MachineLearningConnectionAuthType CustomKeys { get; } = new MachineLearningConnectionAuthType(CustomKeysValue); + /// OAuth2. + public static MachineLearningConnectionAuthType OAuth2 { get; } = new MachineLearningConnectionAuthType(OAuth2Value); + /// AAD. + public static MachineLearningConnectionAuthType Aad { get; } = new MachineLearningConnectionAuthType(AadValue); /// Determines if two values are the same. public static bool operator ==(MachineLearningConnectionAuthType left, MachineLearningConnectionAuthType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionCategory.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionCategory.cs index 18a6d51812eb4..a6a4c9d98b7cc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionCategory.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionCategory.cs @@ -35,9 +35,95 @@ public MachineLearningConnectionCategory(string value) private const string RedisValue = "Redis"; private const string ApiKeyValue = "ApiKey"; private const string AzureOpenAIValue = "AzureOpenAI"; + private const string AIServicesValue = "AIServices"; private const string CognitiveSearchValue = "CognitiveSearch"; private const string CognitiveServiceValue = "CognitiveService"; private const string CustomKeysValue = "CustomKeys"; + private const string AzureBlobValue = "AzureBlob"; + private const string AzureOneLakeValue = "AzureOneLake"; + private const string CosmosDbValue = "CosmosDb"; + private const string CosmosDbMongoDbApiValue = "CosmosDbMongoDbApi"; + private const string AzureDataExplorerValue = "AzureDataExplorer"; + private const string AzureMariaDbValue = "AzureMariaDb"; + private const string AzureDatabricksDeltaLakeValue = "AzureDatabricksDeltaLake"; + private const string AzureSqlMiValue = "AzureSqlMi"; + private const string AzureTableStorageValue = "AzureTableStorage"; + private const string AmazonRdsForOracleValue = "AmazonRdsForOracle"; + private const string AmazonRdsForSqlServerValue = "AmazonRdsForSqlServer"; + private const string AmazonRedshiftValue = "AmazonRedshift"; + private const string Db2Value = "Db2"; + private const string DrillValue = "Drill"; + private const string GoogleBigQueryValue = "GoogleBigQuery"; + private const string GreenplumValue = "Greenplum"; + private const string HbaseValue = "Hbase"; + private const string HiveValue = "Hive"; + private const string ImpalaValue = "Impala"; + private const string InformixValue = "Informix"; + private const string MariaDbValue = "MariaDb"; + private const string MicrosoftAccessValue = "MicrosoftAccess"; + private const string MySqlValue = "MySql"; + private const string NetezzaValue = "Netezza"; + private const string OracleValue = "Oracle"; + private const string PhoenixValue = "Phoenix"; + private const string PostgreSqlValue = "PostgreSql"; + private const string PrestoValue = "Presto"; + private const string SapOpenHubValue = "SapOpenHub"; + private const string SapBwValue = "SapBw"; + private const string SapHanaValue = "SapHana"; + private const string SapTableValue = "SapTable"; + private const string SparkValue = "Spark"; + private const string SqlServerValue = "SqlServer"; + private const string SybaseValue = "Sybase"; + private const string TeradataValue = "Teradata"; + private const string VerticaValue = "Vertica"; + private const string CassandraValue = "Cassandra"; + private const string CouchbaseValue = "Couchbase"; + private const string MongoDbV2Value = "MongoDbV2"; + private const string MongoDbAtlasValue = "MongoDbAtlas"; + private const string AmazonS3CompatibleValue = "AmazonS3Compatible"; + private const string FileServerValue = "FileServer"; + private const string FtpServerValue = "FtpServer"; + private const string GoogleCloudStorageValue = "GoogleCloudStorage"; + private const string HdfsValue = "Hdfs"; + private const string OracleCloudStorageValue = "OracleCloudStorage"; + private const string SftpValue = "Sftp"; + private const string GenericHttpValue = "GenericHttp"; + private const string ODataRestValue = "ODataRest"; + private const string OdbcValue = "Odbc"; + private const string GenericRestValue = "GenericRest"; + private const string AmazonMwsValue = "AmazonMws"; + private const string ConcurValue = "Concur"; + private const string DynamicsValue = "Dynamics"; + private const string DynamicsAxValue = "DynamicsAx"; + private const string DynamicsCrmValue = "DynamicsCrm"; + private const string GoogleAdWordsValue = "GoogleAdWords"; + private const string HubspotValue = "Hubspot"; + private const string JiraValue = "Jira"; + private const string MagentoValue = "Magento"; + private const string MarketoValue = "Marketo"; + private const string Office365Value = "Office365"; + private const string EloquaValue = "Eloqua"; + private const string ResponsysValue = "Responsys"; + private const string OracleServiceCloudValue = "OracleServiceCloud"; + private const string PayPalValue = "PayPal"; + private const string QuickBooksValue = "QuickBooks"; + private const string SalesforceValue = "Salesforce"; + private const string SalesforceServiceCloudValue = "SalesforceServiceCloud"; + private const string SalesforceMarketingCloudValue = "SalesforceMarketingCloud"; + private const string SapCloudForCustomerValue = "SapCloudForCustomer"; + private const string SapEccValue = "SapEcc"; + private const string ServiceNowValue = "ServiceNow"; + private const string SharePointOnlineListValue = "SharePointOnlineList"; + private const string ShopifyValue = "Shopify"; + private const string SquareValue = "Square"; + private const string WebTableValue = "WebTable"; + private const string XeroValue = "Xero"; + private const string ZohoValue = "Zoho"; + private const string GenericContainerRegistryValue = "GenericContainerRegistry"; + private const string OpenAIValue = "OpenAI"; + private const string SerpValue = "Serp"; + private const string BingLLMSearchValue = "BingLLMSearch"; + private const string ServerlessValue = "Serverless"; /// PythonFeed. public static MachineLearningConnectionCategory PythonFeed { get; } = new MachineLearningConnectionCategory(PythonFeedValue); @@ -65,12 +151,184 @@ public MachineLearningConnectionCategory(string value) public static MachineLearningConnectionCategory ApiKey { get; } = new MachineLearningConnectionCategory(ApiKeyValue); /// AzureOpenAI. public static MachineLearningConnectionCategory AzureOpenAI { get; } = new MachineLearningConnectionCategory(AzureOpenAIValue); + /// AIServices. + public static MachineLearningConnectionCategory AIServices { get; } = new MachineLearningConnectionCategory(AIServicesValue); /// CognitiveSearch. public static MachineLearningConnectionCategory CognitiveSearch { get; } = new MachineLearningConnectionCategory(CognitiveSearchValue); /// CognitiveService. public static MachineLearningConnectionCategory CognitiveService { get; } = new MachineLearningConnectionCategory(CognitiveServiceValue); /// CustomKeys. public static MachineLearningConnectionCategory CustomKeys { get; } = new MachineLearningConnectionCategory(CustomKeysValue); + /// AzureBlob. + public static MachineLearningConnectionCategory AzureBlob { get; } = new MachineLearningConnectionCategory(AzureBlobValue); + /// AzureOneLake. + public static MachineLearningConnectionCategory AzureOneLake { get; } = new MachineLearningConnectionCategory(AzureOneLakeValue); + /// CosmosDb. + public static MachineLearningConnectionCategory CosmosDb { get; } = new MachineLearningConnectionCategory(CosmosDbValue); + /// CosmosDbMongoDbApi. + public static MachineLearningConnectionCategory CosmosDbMongoDbApi { get; } = new MachineLearningConnectionCategory(CosmosDbMongoDbApiValue); + /// AzureDataExplorer. + public static MachineLearningConnectionCategory AzureDataExplorer { get; } = new MachineLearningConnectionCategory(AzureDataExplorerValue); + /// AzureMariaDb. + public static MachineLearningConnectionCategory AzureMariaDb { get; } = new MachineLearningConnectionCategory(AzureMariaDbValue); + /// AzureDatabricksDeltaLake. + public static MachineLearningConnectionCategory AzureDatabricksDeltaLake { get; } = new MachineLearningConnectionCategory(AzureDatabricksDeltaLakeValue); + /// AzureSqlMi. + public static MachineLearningConnectionCategory AzureSqlMi { get; } = new MachineLearningConnectionCategory(AzureSqlMiValue); + /// AzureTableStorage. + public static MachineLearningConnectionCategory AzureTableStorage { get; } = new MachineLearningConnectionCategory(AzureTableStorageValue); + /// AmazonRdsForOracle. + public static MachineLearningConnectionCategory AmazonRdsForOracle { get; } = new MachineLearningConnectionCategory(AmazonRdsForOracleValue); + /// AmazonRdsForSqlServer. + public static MachineLearningConnectionCategory AmazonRdsForSqlServer { get; } = new MachineLearningConnectionCategory(AmazonRdsForSqlServerValue); + /// AmazonRedshift. + public static MachineLearningConnectionCategory AmazonRedshift { get; } = new MachineLearningConnectionCategory(AmazonRedshiftValue); + /// Db2. + public static MachineLearningConnectionCategory Db2 { get; } = new MachineLearningConnectionCategory(Db2Value); + /// Drill. + public static MachineLearningConnectionCategory Drill { get; } = new MachineLearningConnectionCategory(DrillValue); + /// GoogleBigQuery. + public static MachineLearningConnectionCategory GoogleBigQuery { get; } = new MachineLearningConnectionCategory(GoogleBigQueryValue); + /// Greenplum. + public static MachineLearningConnectionCategory Greenplum { get; } = new MachineLearningConnectionCategory(GreenplumValue); + /// Hbase. + public static MachineLearningConnectionCategory Hbase { get; } = new MachineLearningConnectionCategory(HbaseValue); + /// Hive. + public static MachineLearningConnectionCategory Hive { get; } = new MachineLearningConnectionCategory(HiveValue); + /// Impala. + public static MachineLearningConnectionCategory Impala { get; } = new MachineLearningConnectionCategory(ImpalaValue); + /// Informix. + public static MachineLearningConnectionCategory Informix { get; } = new MachineLearningConnectionCategory(InformixValue); + /// MariaDb. + public static MachineLearningConnectionCategory MariaDb { get; } = new MachineLearningConnectionCategory(MariaDbValue); + /// MicrosoftAccess. + public static MachineLearningConnectionCategory MicrosoftAccess { get; } = new MachineLearningConnectionCategory(MicrosoftAccessValue); + /// MySql. + public static MachineLearningConnectionCategory MySql { get; } = new MachineLearningConnectionCategory(MySqlValue); + /// Netezza. + public static MachineLearningConnectionCategory Netezza { get; } = new MachineLearningConnectionCategory(NetezzaValue); + /// Oracle. + public static MachineLearningConnectionCategory Oracle { get; } = new MachineLearningConnectionCategory(OracleValue); + /// Phoenix. + public static MachineLearningConnectionCategory Phoenix { get; } = new MachineLearningConnectionCategory(PhoenixValue); + /// PostgreSql. + public static MachineLearningConnectionCategory PostgreSql { get; } = new MachineLearningConnectionCategory(PostgreSqlValue); + /// Presto. + public static MachineLearningConnectionCategory Presto { get; } = new MachineLearningConnectionCategory(PrestoValue); + /// SapOpenHub. + public static MachineLearningConnectionCategory SapOpenHub { get; } = new MachineLearningConnectionCategory(SapOpenHubValue); + /// SapBw. + public static MachineLearningConnectionCategory SapBw { get; } = new MachineLearningConnectionCategory(SapBwValue); + /// SapHana. + public static MachineLearningConnectionCategory SapHana { get; } = new MachineLearningConnectionCategory(SapHanaValue); + /// SapTable. + public static MachineLearningConnectionCategory SapTable { get; } = new MachineLearningConnectionCategory(SapTableValue); + /// Spark. + public static MachineLearningConnectionCategory Spark { get; } = new MachineLearningConnectionCategory(SparkValue); + /// SqlServer. + public static MachineLearningConnectionCategory SqlServer { get; } = new MachineLearningConnectionCategory(SqlServerValue); + /// Sybase. + public static MachineLearningConnectionCategory Sybase { get; } = new MachineLearningConnectionCategory(SybaseValue); + /// Teradata. + public static MachineLearningConnectionCategory Teradata { get; } = new MachineLearningConnectionCategory(TeradataValue); + /// Vertica. + public static MachineLearningConnectionCategory Vertica { get; } = new MachineLearningConnectionCategory(VerticaValue); + /// Cassandra. + public static MachineLearningConnectionCategory Cassandra { get; } = new MachineLearningConnectionCategory(CassandraValue); + /// Couchbase. + public static MachineLearningConnectionCategory Couchbase { get; } = new MachineLearningConnectionCategory(CouchbaseValue); + /// MongoDbV2. + public static MachineLearningConnectionCategory MongoDbV2 { get; } = new MachineLearningConnectionCategory(MongoDbV2Value); + /// MongoDbAtlas. + public static MachineLearningConnectionCategory MongoDbAtlas { get; } = new MachineLearningConnectionCategory(MongoDbAtlasValue); + /// AmazonS3Compatible. + public static MachineLearningConnectionCategory AmazonS3Compatible { get; } = new MachineLearningConnectionCategory(AmazonS3CompatibleValue); + /// FileServer. + public static MachineLearningConnectionCategory FileServer { get; } = new MachineLearningConnectionCategory(FileServerValue); + /// FtpServer. + public static MachineLearningConnectionCategory FtpServer { get; } = new MachineLearningConnectionCategory(FtpServerValue); + /// GoogleCloudStorage. + public static MachineLearningConnectionCategory GoogleCloudStorage { get; } = new MachineLearningConnectionCategory(GoogleCloudStorageValue); + /// Hdfs. + public static MachineLearningConnectionCategory Hdfs { get; } = new MachineLearningConnectionCategory(HdfsValue); + /// OracleCloudStorage. + public static MachineLearningConnectionCategory OracleCloudStorage { get; } = new MachineLearningConnectionCategory(OracleCloudStorageValue); + /// Sftp. + public static MachineLearningConnectionCategory Sftp { get; } = new MachineLearningConnectionCategory(SftpValue); + /// GenericHttp. + public static MachineLearningConnectionCategory GenericHttp { get; } = new MachineLearningConnectionCategory(GenericHttpValue); + /// ODataRest. + public static MachineLearningConnectionCategory ODataRest { get; } = new MachineLearningConnectionCategory(ODataRestValue); + /// Odbc. + public static MachineLearningConnectionCategory Odbc { get; } = new MachineLearningConnectionCategory(OdbcValue); + /// GenericRest. + public static MachineLearningConnectionCategory GenericRest { get; } = new MachineLearningConnectionCategory(GenericRestValue); + /// AmazonMws. + public static MachineLearningConnectionCategory AmazonMws { get; } = new MachineLearningConnectionCategory(AmazonMwsValue); + /// Concur. + public static MachineLearningConnectionCategory Concur { get; } = new MachineLearningConnectionCategory(ConcurValue); + /// Dynamics. + public static MachineLearningConnectionCategory Dynamics { get; } = new MachineLearningConnectionCategory(DynamicsValue); + /// DynamicsAx. + public static MachineLearningConnectionCategory DynamicsAx { get; } = new MachineLearningConnectionCategory(DynamicsAxValue); + /// DynamicsCrm. + public static MachineLearningConnectionCategory DynamicsCrm { get; } = new MachineLearningConnectionCategory(DynamicsCrmValue); + /// GoogleAdWords. + public static MachineLearningConnectionCategory GoogleAdWords { get; } = new MachineLearningConnectionCategory(GoogleAdWordsValue); + /// Hubspot. + public static MachineLearningConnectionCategory Hubspot { get; } = new MachineLearningConnectionCategory(HubspotValue); + /// Jira. + public static MachineLearningConnectionCategory Jira { get; } = new MachineLearningConnectionCategory(JiraValue); + /// Magento. + public static MachineLearningConnectionCategory Magento { get; } = new MachineLearningConnectionCategory(MagentoValue); + /// Marketo. + public static MachineLearningConnectionCategory Marketo { get; } = new MachineLearningConnectionCategory(MarketoValue); + /// Office365. + public static MachineLearningConnectionCategory Office365 { get; } = new MachineLearningConnectionCategory(Office365Value); + /// Eloqua. + public static MachineLearningConnectionCategory Eloqua { get; } = new MachineLearningConnectionCategory(EloquaValue); + /// Responsys. + public static MachineLearningConnectionCategory Responsys { get; } = new MachineLearningConnectionCategory(ResponsysValue); + /// OracleServiceCloud. + public static MachineLearningConnectionCategory OracleServiceCloud { get; } = new MachineLearningConnectionCategory(OracleServiceCloudValue); + /// PayPal. + public static MachineLearningConnectionCategory PayPal { get; } = new MachineLearningConnectionCategory(PayPalValue); + /// QuickBooks. + public static MachineLearningConnectionCategory QuickBooks { get; } = new MachineLearningConnectionCategory(QuickBooksValue); + /// Salesforce. + public static MachineLearningConnectionCategory Salesforce { get; } = new MachineLearningConnectionCategory(SalesforceValue); + /// SalesforceServiceCloud. + public static MachineLearningConnectionCategory SalesforceServiceCloud { get; } = new MachineLearningConnectionCategory(SalesforceServiceCloudValue); + /// SalesforceMarketingCloud. + public static MachineLearningConnectionCategory SalesforceMarketingCloud { get; } = new MachineLearningConnectionCategory(SalesforceMarketingCloudValue); + /// SapCloudForCustomer. + public static MachineLearningConnectionCategory SapCloudForCustomer { get; } = new MachineLearningConnectionCategory(SapCloudForCustomerValue); + /// SapEcc. + public static MachineLearningConnectionCategory SapEcc { get; } = new MachineLearningConnectionCategory(SapEccValue); + /// ServiceNow. + public static MachineLearningConnectionCategory ServiceNow { get; } = new MachineLearningConnectionCategory(ServiceNowValue); + /// SharePointOnlineList. + public static MachineLearningConnectionCategory SharePointOnlineList { get; } = new MachineLearningConnectionCategory(SharePointOnlineListValue); + /// Shopify. + public static MachineLearningConnectionCategory Shopify { get; } = new MachineLearningConnectionCategory(ShopifyValue); + /// Square. + public static MachineLearningConnectionCategory Square { get; } = new MachineLearningConnectionCategory(SquareValue); + /// WebTable. + public static MachineLearningConnectionCategory WebTable { get; } = new MachineLearningConnectionCategory(WebTableValue); + /// Xero. + public static MachineLearningConnectionCategory Xero { get; } = new MachineLearningConnectionCategory(XeroValue); + /// Zoho. + public static MachineLearningConnectionCategory Zoho { get; } = new MachineLearningConnectionCategory(ZohoValue); + /// GenericContainerRegistry. + public static MachineLearningConnectionCategory GenericContainerRegistry { get; } = new MachineLearningConnectionCategory(GenericContainerRegistryValue); + /// OpenAI. + public static MachineLearningConnectionCategory OpenAI { get; } = new MachineLearningConnectionCategory(OpenAIValue); + /// Serp. + public static MachineLearningConnectionCategory Serp { get; } = new MachineLearningConnectionCategory(SerpValue); + /// BingLLMSearch. + public static MachineLearningConnectionCategory BingLLMSearch { get; } = new MachineLearningConnectionCategory(BingLLMSearchValue); + /// Serverless. + public static MachineLearningConnectionCategory Serverless { get; } = new MachineLearningConnectionCategory(ServerlessValue); /// Determines if two values are the same. public static bool operator ==(MachineLearningConnectionCategory left, MachineLearningConnectionCategory right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningContainerType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningContainerType.cs index 8f3a47b422397..028596deae7a8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningContainerType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningContainerType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// The type of container to retrieve logs from. + /// The MachineLearningContainerType. public readonly partial struct MachineLearningContainerType : IEquatable { private readonly string _value; @@ -24,14 +24,11 @@ public MachineLearningContainerType(string value) private const string StorageInitializerValue = "StorageInitializer"; private const string InferenceServerValue = "InferenceServer"; - private const string ModelDataCollectorValue = "ModelDataCollector"; - /// The container used to download models and score script. + /// StorageInitializer. public static MachineLearningContainerType StorageInitializer { get; } = new MachineLearningContainerType(StorageInitializerValue); - /// The container used to serve user's request. + /// InferenceServer. public static MachineLearningContainerType InferenceServer { get; } = new MachineLearningContainerType(InferenceServerValue); - /// The container used to collect payload and custom logging when mdc is enabled. - public static MachineLearningContainerType ModelDataCollector { get; } = new MachineLearningContainerType(ModelDataCollectorValue); /// Determines if two values are the same. public static bool operator ==(MachineLearningContainerType left, MachineLearningContainerType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.Serialization.cs index 24ec330c8bbb5..b0b2ac9b9cc53 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.Serialization.cs @@ -26,42 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer } writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(AssetVersion)) - { - if (AssetVersion != null) - { - writer.WritePropertyName("assetVersion"u8); - writer.WriteStringValue(AssetVersion); - } - else - { - writer.WriteNull("assetVersion"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -131,9 +95,6 @@ internal static MachineLearningCustomModelJobOutput DeserializeMachineLearningCu { return null; } - string assetName = default; - string assetVersion = default; - AutoDeleteSetting autoDeleteSetting = default; MachineLearningOutputDeliveryMode? mode = default; Uri uri = default; string description = default; @@ -142,36 +103,6 @@ internal static MachineLearningCustomModelJobOutput DeserializeMachineLearningCu Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("assetVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetVersion = null; - continue; - } - assetVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,15 +143,7 @@ internal static MachineLearningCustomModelJobOutput DeserializeMachineLearningCu } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningCustomModelJobOutput( - description, - jobOutputType, - serializedAdditionalRawData, - assetName, - assetVersion, - autoDeleteSetting, - mode, - uri); + return new MachineLearningCustomModelJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.cs index 710b27d781b84..bf1acd9708591 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.cs @@ -23,27 +23,15 @@ public MachineLearningCustomModelJobOutput() /// Description for the output. /// [Required] Specifies the type of job. /// Keeps track of any properties unknown to the library. - /// Output Asset Name. - /// Output Asset Version. - /// Auto delete setting of output data asset. /// Output Asset Delivery Mode. /// Output Asset URI. - internal MachineLearningCustomModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, string assetName, string assetVersion, AutoDeleteSetting autoDeleteSetting, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + internal MachineLearningCustomModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) { - AssetName = assetName; - AssetVersion = assetVersion; - AutoDeleteSetting = autoDeleteSetting; Mode = mode; Uri = uri; JobOutputType = jobOutputType; } - /// Output Asset Name. - public string AssetName { get; set; } - /// Output Asset Version. - public string AssetVersion { get; set; } - /// Auto delete setting of output data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } /// Output Asset Delivery Mode. public MachineLearningOutputDeliveryMode? Mode { get; set; } /// Output Asset URI. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionCollectionGetAllOptions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionCollectionGetAllOptions.cs deleted file mode 100644 index 0715d44f6be6a..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionCollectionGetAllOptions.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The MachineLearningDataVersionCollectionGetAllOptions. - public partial class MachineLearningDataVersionCollectionGetAllOptions - { - /// Initializes a new instance of . - public MachineLearningDataVersionCollectionGetAllOptions() - { - } - - /// Please choose OrderBy value from ['createdtime', 'modifiedtime']. - public string OrderBy { get; set; } - /// - /// Top count of results, top count cannot be greater than the page size. - /// If topCount > page size, results with be default page size count will be returned - /// - public int? Top { get; set; } - /// Continuation token for pagination. - public string Skip { get; set; } - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - public string Tags { get; set; } - /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. - public MachineLearningListViewType? ListViewType { get; set; } - /// data stage. - public string Stage { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs index 89c2af93c4208..8cfea4d8cd9ab 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs @@ -29,42 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.cs index 54cdebbaa3d27..ffe2daef51187 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.cs @@ -32,19 +32,14 @@ public MachineLearningDataVersionProperties(Uri dataUri) /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// Intellectual Property details. Used if data is an Intellectual Property. - /// Stage in the data lifecycle assigned to this data asset. - internal MachineLearningDataVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IntellectualProperty intellectualProperty, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningDataVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { DataType = dataType; DataUri = dataUri; - IntellectualProperty = intellectualProperty; - Stage = stage; } /// Initializes a new instance of for deserialization. @@ -56,9 +51,5 @@ internal MachineLearningDataVersionProperties() internal MachineLearningDataType DataType { get; set; } /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. public Uri DataUri { get; set; } - /// Intellectual Property details. Used if data is an Intellectual Property. - public IntellectualProperty IntellectualProperty { get; set; } - /// Stage in the data lifecycle assigned to this data asset. - public string Stage { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.Serialization.cs index e1f570248619a..b697af2b272f1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.Serialization.cs @@ -72,8 +72,6 @@ internal static MachineLearningDatastoreCredentials DeserializeMachineLearningDa { case "AccountKey": return MachineLearningAccountKeyDatastoreCredentials.DeserializeMachineLearningAccountKeyDatastoreCredentials(element, options); case "Certificate": return MachineLearningCertificateDatastoreCredentials.DeserializeMachineLearningCertificateDatastoreCredentials(element, options); - case "KerberosKeytab": return KerberosKeytabCredentials.DeserializeKerberosKeytabCredentials(element, options); - case "KerberosPassword": return KerberosPasswordCredentials.DeserializeKerberosPasswordCredentials(element, options); case "None": return MachineLearningNoneDatastoreCredentials.DeserializeMachineLearningNoneDatastoreCredentials(element, options); case "Sas": return MachineLearningSasDatastoreCredentials.DeserializeMachineLearningSasDatastoreCredentials(element, options); case "ServicePrincipal": return MachineLearningServicePrincipalDatastoreCredentials.DeserializeMachineLearningServicePrincipalDatastoreCredentials(element, options); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.cs index 24d3e64602879..a77606d77bd0b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Base definition for datastore credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// public abstract partial class MachineLearningDatastoreCredentials { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.Serialization.cs index e6a03218e6575..567ea3d6b9796 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.Serialization.cs @@ -29,18 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -140,7 +128,6 @@ internal static MachineLearningDatastoreProperties DeserializeMachineLearningDat case "AzureDataLakeGen1": return MachineLearningAzureDataLakeGen1Datastore.DeserializeMachineLearningAzureDataLakeGen1Datastore(element, options); case "AzureDataLakeGen2": return MachineLearningAzureDataLakeGen2Datastore.DeserializeMachineLearningAzureDataLakeGen2Datastore(element, options); case "AzureFile": return MachineLearningAzureFileDatastore.DeserializeMachineLearningAzureFileDatastore(element, options); - case "Hdfs": return HdfsDatastore.DeserializeHdfsDatastore(element, options); case "OneLake": return OneLakeDatastore.DeserializeOneLakeDatastore(element, options); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.cs index a50e972ec1b4f..67d0116fa621d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Base definition for datastore contents configuration. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , and . /// public partial class MachineLearningDatastoreProperties : MachineLearningResourceBase { @@ -21,7 +21,7 @@ public partial class MachineLearningDatastoreProperties : MachineLearningResourc /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// is null. public MachineLearningDatastoreProperties(MachineLearningDatastoreCredentials credentials) @@ -39,16 +39,14 @@ public MachineLearningDatastoreProperties(MachineLearningDatastoreCredentials cr /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. - internal MachineLearningDatastoreProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault) : base(description, properties, tags, serializedAdditionalRawData) + internal MachineLearningDatastoreProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault) : base(description, properties, tags, serializedAdditionalRawData) { Credentials = credentials; DatastoreType = datastoreType; - IntellectualProperty = intellectualProperty; IsDefault = isDefault; } @@ -60,13 +58,11 @@ internal MachineLearningDatastoreProperties() /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// public MachineLearningDatastoreCredentials Credentials { get; set; } /// [Required] Storage type backing the datastore. internal DatastoreType DatastoreType { get; set; } - /// Intellectual Property details. - public IntellectualProperty IntellectualProperty { get; set; } /// Readonly property to indicate if datastore is the workspace default datastore. public bool? IsDefault { get; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.Serialization.cs index 87c78e848ea05..53b108133ad2c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.Serialization.cs @@ -72,8 +72,6 @@ internal static MachineLearningDatastoreSecrets DeserializeMachineLearningDatast { case "AccountKey": return MachineLearningAccountKeyDatastoreSecrets.DeserializeMachineLearningAccountKeyDatastoreSecrets(element, options); case "Certificate": return MachineLearningCertificateDatastoreSecrets.DeserializeMachineLearningCertificateDatastoreSecrets(element, options); - case "KerberosKeytab": return KerberosKeytabSecrets.DeserializeKerberosKeytabSecrets(element, options); - case "KerberosPassword": return KerberosPasswordSecrets.DeserializeKerberosPasswordSecrets(element, options); case "Sas": return MachineLearningSasDatastoreSecrets.DeserializeMachineLearningSasDatastoreSecrets(element, options); case "ServicePrincipal": return MachineLearningServicePrincipalDatastoreSecrets.DeserializeMachineLearningServicePrincipalDatastoreSecrets(element, options); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.cs index eeb7c7176b8bb..fc0fee9615bf3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Base definition for datastore secrets. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , and . /// public abstract partial class MachineLearningDatastoreSecrets { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.Serialization.cs index 4cbb10c1ac64a..118568a8bb349 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.Serialization.cs @@ -43,35 +43,6 @@ void IJsonModel.Write(Utf8JsonWr writer.WriteNull("instanceType"); } } - if (Optional.IsCollectionDefined(Locations)) - { - if (Locations != null) - { - writer.WritePropertyName("locations"u8); - writer.WriteStartArray(); - foreach (var item in Locations) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("locations"); - } - } - if (Optional.IsDefined(MaxInstanceCount)) - { - if (MaxInstanceCount != null) - { - writer.WritePropertyName("maxInstanceCount"u8); - writer.WriteNumberValue(MaxInstanceCount.Value); - } - else - { - writer.WriteNull("maxInstanceCount"); - } - } if (Optional.IsCollectionDefined(Properties)) { if (Properties != null) @@ -142,8 +113,6 @@ internal static MachineLearningDeploymentResourceConfiguration DeserializeMachin } int? instanceCount = default; string instanceType = default; - IList locations = default; - int? maxInstanceCount = default; IDictionary properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -168,31 +137,6 @@ internal static MachineLearningDeploymentResourceConfiguration DeserializeMachin instanceType = property.Value.GetString(); continue; } - if (property.NameEquals("locations"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - locations = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - locations = array; - continue; - } - if (property.NameEquals("maxInstanceCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxInstanceCount = null; - continue; - } - maxInstanceCount = property.Value.GetInt32(); - continue; - } if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -221,13 +165,7 @@ internal static MachineLearningDeploymentResourceConfiguration DeserializeMachin } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningDeploymentResourceConfiguration( - instanceCount, - instanceType, - locations ?? new ChangeTrackingList(), - maxInstanceCount, - properties ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData); + return new MachineLearningDeploymentResourceConfiguration(instanceCount, instanceType, properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.cs index 33a4c554684e0..eff355ebbf46a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.cs @@ -21,14 +21,9 @@ public MachineLearningDeploymentResourceConfiguration() /// Initializes a new instance of . /// Optional number of instances or nodes used by the compute target. /// Optional type of VM used as supported by the compute target. - /// Locations where the job can run. - /// - /// Optional max allowed number of instances or nodes to be used by the compute target. - /// For use with elastic training, currently supported by PyTorch distribution type only. - /// /// Additional properties bag. /// Keeps track of any properties unknown to the library. - internal MachineLearningDeploymentResourceConfiguration(int? instanceCount, string instanceType, IList locations, int? maxInstanceCount, IDictionary properties, IDictionary serializedAdditionalRawData) : base(instanceCount, instanceType, locations, maxInstanceCount, properties, serializedAdditionalRawData) + internal MachineLearningDeploymentResourceConfiguration(int? instanceCount, string instanceType, IDictionary properties, IDictionary serializedAdditionalRawData) : base(instanceCount, instanceType, properties, serializedAdditionalRawData) { } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.Serialization.cs index 4da54ec71e0d4..b3978e4194f55 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.Serialization.cs @@ -72,7 +72,6 @@ internal static MachineLearningDistributionConfiguration DeserializeMachineLearn { case "Mpi": return MpiDistributionConfiguration.DeserializeMpiDistributionConfiguration(element, options); case "PyTorch": return PyTorchDistributionConfiguration.DeserializePyTorchDistributionConfiguration(element, options); - case "Ray": return RayDistributionConfiguration.DeserializeRayDistributionConfiguration(element, options); case "TensorFlow": return TensorFlowDistributionConfiguration.DeserializeTensorFlowDistributionConfiguration(element, options); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.cs index 5f1f7f74601e9..3f416bcebe248 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Base definition for job distribution configuration. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// public abstract partial class MachineLearningDistributionConfiguration { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEndpointDeploymentProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEndpointDeploymentProperties.cs index 991b167ed89a5..53c99c436c6a5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEndpointDeploymentProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEndpointDeploymentProperties.cs @@ -55,7 +55,7 @@ public MachineLearningEndpointDeploymentProperties() /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. @@ -73,7 +73,7 @@ internal MachineLearningEndpointDeploymentProperties(MachineLearningCodeConfigur public MachineLearningCodeConfiguration CodeConfiguration { get; set; } /// Description of the endpoint deployment. public string Description { get; set; } - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. public string EnvironmentId { get; set; } /// Environment variables configuration for the deployment. public IDictionary EnvironmentVariables { get; set; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.Serialization.cs index f752a3ce4353b..672bbfa2881ca 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.Serialization.cs @@ -56,18 +56,6 @@ void IJsonModel.Write(Utf8JsonWrite writer.WritePropertyName("inferenceConfig"u8); writer.WriteObjectValue(InferenceConfig, options); } - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (Optional.IsDefined(OSType)) { writer.WritePropertyName("osType"u8); @@ -90,18 +78,6 @@ void IJsonModel.Write(Utf8JsonWrite writer.WriteNull("stage"); } } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -204,11 +180,9 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe MachineLearningEnvironmentType? environmentType = default; string image = default; MachineLearningInferenceContainerProperties inferenceConfig = default; - IntellectualProperty intellectualProperty = default; MachineLearningOperatingSystemType? osType = default; RegistryAssetProvisioningState? provisioningState = default; string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -264,16 +238,6 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe inferenceConfig = MachineLearningInferenceContainerProperties.DeserializeMachineLearningInferenceContainerProperties(property.Value, options); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("osType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -302,16 +266,6 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe stage = property.Value.GetString(); continue; } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -381,7 +335,6 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, autoRebuild, @@ -390,7 +343,6 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe environmentType, image, inferenceConfig, - intellectualProperty, osType, provisioningState, stage); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.cs index f5f685315463d..cc1bf15317843 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.cs @@ -23,9 +23,8 @@ public MachineLearningEnvironmentVersionProperties() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Defines if image needs to be rebuilt based on base image changes. /// Configuration settings for Docker build context. /// @@ -41,11 +40,10 @@ public MachineLearningEnvironmentVersionProperties() /// <seealso href="https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-custom-docker-image#use-a-custom-base-image" /> /// /// Defines configuration specific to inference. - /// Intellectual Property details. Used if environment is an Intellectual Property. /// The OS type of the environment. /// Provisioning state for the environment version. /// Stage in the environment lifecycle assigned to this environment. - internal MachineLearningEnvironmentVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, AutoRebuildSetting? autoRebuild, MachineLearningBuildContext build, string condaFile, MachineLearningEnvironmentType? environmentType, string image, MachineLearningInferenceContainerProperties inferenceConfig, IntellectualProperty intellectualProperty, MachineLearningOperatingSystemType? osType, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningEnvironmentVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, AutoRebuildSetting? autoRebuild, MachineLearningBuildContext build, string condaFile, MachineLearningEnvironmentType? environmentType, string image, MachineLearningInferenceContainerProperties inferenceConfig, MachineLearningOperatingSystemType? osType, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { AutoRebuild = autoRebuild; Build = build; @@ -53,7 +51,6 @@ internal MachineLearningEnvironmentVersionProperties(string description, IDictio EnvironmentType = environmentType; Image = image; InferenceConfig = inferenceConfig; - IntellectualProperty = intellectualProperty; OSType = osType; ProvisioningState = provisioningState; Stage = stage; @@ -80,8 +77,6 @@ internal MachineLearningEnvironmentVersionProperties(string description, IDictio public string Image { get; set; } /// Defines configuration specific to inference. public MachineLearningInferenceContainerProperties InferenceConfig { get; set; } - /// Intellectual Property details. Used if environment is an Intellectual Property. - public IntellectualProperty IntellectualProperty { get; set; } /// The OS type of the environment. public MachineLearningOperatingSystemType? OSType { get; set; } /// Provisioning state for the environment version. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureCollectionGetAllOptions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureCollectionGetAllOptions.cs new file mode 100644 index 0000000000000..ab556b942aa77 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureCollectionGetAllOptions.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The MachineLearningFeatureCollectionGetAllOptions. + public partial class MachineLearningFeatureCollectionGetAllOptions + { + /// Initializes a new instance of . + public MachineLearningFeatureCollectionGetAllOptions() + { + } + + /// Continuation token for pagination. + public string Skip { get; set; } + /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + public string Tags { get; set; } + /// feature name. + public string FeatureName { get; set; } + /// Description of the featureset. + public string Description { get; set; } + /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. + public MachineLearningListViewType? ListViewType { get; set; } + /// Page size. + public int? PageSize { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureProperties.cs index 67ec9d99fb000..a47817a64cc6d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing feature. + /// DTO object representing feature. public partial class MachineLearningFeatureProperties : MachineLearningResourceBase { /// Initializes a new instance of . diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetContainerProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetContainerProperties.cs index 5af962d899f26..ee9c052ea4ecb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetContainerProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetContainerProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing feature set. + /// DTO object representing feature set. public partial class MachineLearningFeatureSetContainerProperties : MachineLearningAssetContainer { /// Initializes a new instance of . diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.Serialization.cs deleted file mode 100644 index 66644ca8c4162..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.Serialization.cs +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class MachineLearningFeatureSetJob : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MachineLearningFeatureSetJob)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(CreatedOn)) - { - if (CreatedOn != null) - { - writer.WritePropertyName("createdDate"u8); - writer.WriteStringValue(CreatedOn.Value, "O"); - } - else - { - writer.WriteNull("createdDate"); - } - } - if (Optional.IsDefined(DisplayName)) - { - if (DisplayName != null) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - else - { - writer.WriteNull("displayName"); - } - } - if (Optional.IsDefined(Duration)) - { - if (Duration != null) - { - writer.WritePropertyName("duration"u8); - writer.WriteStringValue(Duration.Value, "P"); - } - else - { - writer.WriteNull("duration"); - } - } - if (Optional.IsDefined(ExperimentId)) - { - if (ExperimentId != null) - { - writer.WritePropertyName("experimentId"u8); - writer.WriteStringValue(ExperimentId); - } - else - { - writer.WriteNull("experimentId"); - } - } - if (Optional.IsDefined(FeatureWindow)) - { - if (FeatureWindow != null) - { - writer.WritePropertyName("featureWindow"u8); - writer.WriteObjectValue(FeatureWindow, options); - } - else - { - writer.WriteNull("featureWindow"); - } - } - if (Optional.IsDefined(JobId)) - { - if (JobId != null) - { - writer.WritePropertyName("jobId"u8); - writer.WriteStringValue(JobId); - } - else - { - writer.WriteNull("jobId"); - } - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags != null) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("tags"); - } - } - if (Optional.IsDefined(FeatureStoreJobType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(FeatureStoreJobType.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MachineLearningFeatureSetJob 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(MachineLearningFeatureSetJob)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningFeatureSetJob(document.RootElement, options); - } - - internal static MachineLearningFeatureSetJob DeserializeMachineLearningFeatureSetJob(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DateTimeOffset? createdDate = default; - string displayName = default; - TimeSpan? duration = default; - string experimentId = default; - FeatureWindow featureWindow = default; - string jobId = default; - MachineLearningJobStatus? status = default; - IReadOnlyDictionary tags = default; - FeatureStoreJobType? type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("createdDate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - createdDate = null; - continue; - } - createdDate = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("displayName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - displayName = null; - continue; - } - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("duration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - duration = null; - continue; - } - duration = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("experimentId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - experimentId = null; - continue; - } - experimentId = property.Value.GetString(); - continue; - } - if (property.NameEquals("featureWindow"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - featureWindow = null; - continue; - } - featureWindow = FeatureWindow.DeserializeFeatureWindow(property.Value, options); - continue; - } - if (property.NameEquals("jobId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - jobId = null; - continue; - } - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("status"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - status = new MachineLearningJobStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tags = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type = new FeatureStoreJobType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningFeatureSetJob( - createdDate, - displayName, - duration, - experimentId, - featureWindow, - jobId, - status, - tags ?? new ChangeTrackingDictionary(), - type, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MachineLearningFeatureSetJob)} does not support writing '{options.Format}' format."); - } - } - - MachineLearningFeatureSetJob IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMachineLearningFeatureSetJob(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MachineLearningFeatureSetJob)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.cs deleted file mode 100644 index e7c2d75728b68..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Dto object representing the feature set job. - public partial class MachineLearningFeatureSetJob - { - /// - /// 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 MachineLearningFeatureSetJob() - { - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Specifies the created date. - /// Specifies the display name. - /// Specifies the duration. - /// Specifies the experiment id. - /// Specifies the backfill feature window to be materialized. - /// Specifies the job id. - /// Specifies the job status. - /// Specifies the tags if any. - /// Specifies the feature store job type. - /// Keeps track of any properties unknown to the library. - internal MachineLearningFeatureSetJob(DateTimeOffset? createdOn, string displayName, TimeSpan? duration, string experimentId, FeatureWindow featureWindow, string jobId, MachineLearningJobStatus? status, IReadOnlyDictionary tags, FeatureStoreJobType? featureStoreJobType, IDictionary serializedAdditionalRawData) - { - CreatedOn = createdOn; - DisplayName = displayName; - Duration = duration; - ExperimentId = experimentId; - FeatureWindow = featureWindow; - JobId = jobId; - Status = status; - Tags = tags; - FeatureStoreJobType = featureStoreJobType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Specifies the created date. - public DateTimeOffset? CreatedOn { get; } - /// Specifies the display name. - public string DisplayName { get; } - /// Specifies the duration. - public TimeSpan? Duration { get; } - /// Specifies the experiment id. - public string ExperimentId { get; } - /// Specifies the backfill feature window to be materialized. - public FeatureWindow FeatureWindow { get; } - /// Specifies the job id. - public string JobId { get; } - /// Specifies the job status. - public MachineLearningJobStatus? Status { get; } - /// Specifies the tags if any. - public IReadOnlyDictionary Tags { get; } - /// Specifies the feature store job type. - public FeatureStoreJobType? FeatureStoreJobType { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.Serialization.cs index 24a04b011abc1..2e2f27be13ec6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.Serialization.cs @@ -84,18 +84,6 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteNull("stage"); } } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -197,7 +185,6 @@ internal static MachineLearningFeatureSetVersionProperties DeserializeMachineLea RegistryAssetProvisioningState? provisioningState = default; FeaturesetSpecification specification = default; string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -261,16 +248,6 @@ internal static MachineLearningFeatureSetVersionProperties DeserializeMachineLea stage = property.Value.GetString(); continue; } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -340,7 +317,6 @@ internal static MachineLearningFeatureSetVersionProperties DeserializeMachineLea properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, entities ?? new ChangeTrackingList(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.cs index d7bbffe138c3d..304743ac12aed 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing feature set version. + /// DTO object representing feature set version. public partial class MachineLearningFeatureSetVersionProperties : MachineLearningAssetBase { /// Initializes a new instance of . @@ -24,15 +24,14 @@ public MachineLearningFeatureSetVersionProperties() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Specifies list of entities. /// Specifies the materialization settings. /// Provisioning state for the featureset version container. /// Specifies the feature spec details. /// Specifies the asset stage. - internal MachineLearningFeatureSetVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, IList entities, MaterializationSettings materializationSettings, RegistryAssetProvisioningState? provisioningState, FeaturesetSpecification specification, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningFeatureSetVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, IList entities, MaterializationSettings materializationSettings, RegistryAssetProvisioningState? provisioningState, FeaturesetSpecification specification, string stage) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { Entities = entities; MaterializationSettings = materializationSettings; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityContainerProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityContainerProperties.cs index 8a633db24f2ec..d92241cbf8852 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityContainerProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityContainerProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing feature entity. + /// DTO object representing feature entity. public partial class MachineLearningFeatureStoreEntityContainerProperties : MachineLearningAssetContainer { /// Initializes a new instance of . diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.Serialization.cs index c796d682de7bc..9c9715910c7cb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.Serialization.cs @@ -60,18 +60,6 @@ void IJsonModel.Write(Utf8Js writer.WriteNull("stage"); } } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -171,7 +159,6 @@ internal static MachineLearningFeatureStoreEntityVersionProperties DeserializeMa IList indexColumns = default; RegistryAssetProvisioningState? provisioningState = default; string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -215,16 +202,6 @@ internal static MachineLearningFeatureStoreEntityVersionProperties DeserializeMa stage = property.Value.GetString(); continue; } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -294,7 +271,6 @@ internal static MachineLearningFeatureStoreEntityVersionProperties DeserializeMa properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, indexColumns ?? new ChangeTrackingList(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.cs index 78dcda52b67e8..afd396d737a0c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing feature entity version. + /// DTO object representing feature entity version. public partial class MachineLearningFeatureStoreEntityVersionProperties : MachineLearningAssetBase { /// Initializes a new instance of . @@ -24,13 +24,12 @@ public MachineLearningFeatureStoreEntityVersionProperties() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Specifies index columns. /// Provisioning state for the featurestore entity version. /// Specifies the asset stage. - internal MachineLearningFeatureStoreEntityVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, IList indexColumns, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningFeatureStoreEntityVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, IList indexColumns, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { IndexColumns = indexColumns; ProvisioningState = provisioningState; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowAutoLoggerState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowAutoLoggerState.cs deleted file mode 100644 index 8140672b79bd7..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowAutoLoggerState.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Enum to determine the state of mlflow autologger. - public readonly partial struct MachineLearningFlowAutoLoggerState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MachineLearningFlowAutoLoggerState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static MachineLearningFlowAutoLoggerState Enabled { get; } = new MachineLearningFlowAutoLoggerState(EnabledValue); - /// Disabled. - public static MachineLearningFlowAutoLoggerState Disabled { get; } = new MachineLearningFlowAutoLoggerState(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(MachineLearningFlowAutoLoggerState left, MachineLearningFlowAutoLoggerState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MachineLearningFlowAutoLoggerState left, MachineLearningFlowAutoLoggerState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MachineLearningFlowAutoLoggerState(string value) => new MachineLearningFlowAutoLoggerState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MachineLearningFlowAutoLoggerState other && Equals(other); - /// - public bool Equals(MachineLearningFlowAutoLoggerState 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.Serialization.cs index c8db2b4b4580a..e6204bcdacb38 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.Serialization.cs @@ -26,42 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(AssetVersion)) - { - if (AssetVersion != null) - { - writer.WritePropertyName("assetVersion"u8); - writer.WriteStringValue(AssetVersion); - } - else - { - writer.WriteNull("assetVersion"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -131,9 +95,6 @@ internal static MachineLearningFlowModelJobOutput DeserializeMachineLearningFlow { return null; } - string assetName = default; - string assetVersion = default; - AutoDeleteSetting autoDeleteSetting = default; MachineLearningOutputDeliveryMode? mode = default; Uri uri = default; string description = default; @@ -142,36 +103,6 @@ internal static MachineLearningFlowModelJobOutput DeserializeMachineLearningFlow Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("assetVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetVersion = null; - continue; - } - assetVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,15 +143,7 @@ internal static MachineLearningFlowModelJobOutput DeserializeMachineLearningFlow } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningFlowModelJobOutput( - description, - jobOutputType, - serializedAdditionalRawData, - assetName, - assetVersion, - autoDeleteSetting, - mode, - uri); + return new MachineLearningFlowModelJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.cs index eff40fd148149..b18089ed79179 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.cs @@ -23,27 +23,15 @@ public MachineLearningFlowModelJobOutput() /// Description for the output. /// [Required] Specifies the type of job. /// Keeps track of any properties unknown to the library. - /// Output Asset Name. - /// Output Asset Version. - /// Auto delete setting of output data asset. /// Output Asset Delivery Mode. /// Output Asset URI. - internal MachineLearningFlowModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, string assetName, string assetVersion, AutoDeleteSetting autoDeleteSetting, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + internal MachineLearningFlowModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) { - AssetName = assetName; - AssetVersion = assetVersion; - AutoDeleteSetting = autoDeleteSetting; Mode = mode; Uri = uri; JobOutputType = jobOutputType; } - /// Output Asset Name. - public string AssetName { get; set; } - /// Output Asset Version. - public string AssetVersion { get; set; } - /// Auto delete setting of output data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } /// Output Asset Delivery Mode. public MachineLearningOutputDeliveryMode? Mode { get; set; } /// Output Asset URI. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.Serialization.cs index eed54896bbdbb..6af5eaf4ad9b6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.Serialization.cs @@ -84,18 +84,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteNull("featurizationSettings"); } } - if (Optional.IsDefined(FixedParameters)) - { - if (FixedParameters != null) - { - writer.WritePropertyName("fixedParameters"u8); - writer.WriteObjectValue(FixedParameters, options); - } - else - { - writer.WriteNull("fixedParameters"); - } - } if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -120,35 +108,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteNull("nCrossValidations"); } } - if (Optional.IsCollectionDefined(SearchSpace)) - { - if (SearchSpace != null) - { - writer.WritePropertyName("searchSpace"u8); - writer.WriteStartArray(); - foreach (var item in SearchSpace) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("searchSpace"); - } - } - if (Optional.IsDefined(SweepSettings)) - { - if (SweepSettings != null) - { - writer.WritePropertyName("sweepSettings"u8); - writer.WriteObjectValue(SweepSettings, options); - } - else - { - writer.WriteNull("sweepSettings"); - } - } if (Optional.IsDefined(TestData)) { if (TestData != null) @@ -273,11 +232,8 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting ForecastingTrainingSettings trainingSettings = default; IList cvSplitColumnNames = default; TableVerticalFeaturizationSettings featurizationSettings = default; - TableFixedParameters fixedParameters = default; TableVerticalLimitSettings limitSettings = default; NCrossValidations nCrossValidations = default; - IList searchSpace = default; - TableSweepSettings sweepSettings = default; MachineLearningTableJobInput testData = default; double? testDataSize = default; MachineLearningTableJobInput validationData = default; @@ -345,16 +301,6 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting featurizationSettings = TableVerticalFeaturizationSettings.DeserializeTableVerticalFeaturizationSettings(property.Value, options); continue; } - if (property.NameEquals("fixedParameters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fixedParameters = null; - continue; - } - fixedParameters = TableFixedParameters.DeserializeTableFixedParameters(property.Value, options); - continue; - } if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -375,31 +321,6 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting nCrossValidations = NCrossValidations.DeserializeNCrossValidations(property.Value, options); continue; } - if (property.NameEquals("searchSpace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchSpace = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TableParameterSubspace.DeserializeTableParameterSubspace(item, options)); - } - searchSpace = array; - continue; - } - if (property.NameEquals("sweepSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sweepSettings = null; - continue; - } - sweepSettings = TableSweepSettings.DeserializeTableSweepSettings(property.Value, options); - continue; - } if (property.NameEquals("testData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -496,11 +417,8 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting trainingSettings, cvSplitColumnNames ?? new ChangeTrackingList(), featurizationSettings, - fixedParameters, limitSettings, nCrossValidations, - searchSpace ?? new ChangeTrackingList(), - sweepSettings, testData, testDataSize, validationData, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.cs index b6fe288c1ed77..0cafad244c9f0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.cs @@ -21,7 +21,6 @@ public MachineLearningForecasting(MachineLearningTableJobInput trainingData) : b Argument.AssertNotNull(trainingData, nameof(trainingData)); CvSplitColumnNames = new ChangeTrackingList(); - SearchSpace = new ChangeTrackingList(); TaskType = TaskType.Forecasting; } @@ -39,7 +38,6 @@ public MachineLearningForecasting(MachineLearningTableJobInput trainingData) : b /// Inputs for training phase for an AutoML Job. /// Columns to use for CVSplit data. /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. /// /// Number of cross validation folds to be applied on training dataset @@ -47,8 +45,6 @@ public MachineLearningForecasting(MachineLearningTableJobInput trainingData) : b /// 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 . /// - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Test data input. /// /// The fraction of test dataset that needs to be set aside for validation purpose. @@ -62,18 +58,15 @@ public MachineLearningForecasting(MachineLearningTableJobInput trainingData) : b /// Applied when validation dataset is not provided. /// /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. - internal MachineLearningForecasting(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ForecastingSettings forecastingSettings, ForecastingPrimaryMetric? primaryMetric, ForecastingTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableFixedParameters fixedParameters, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, IList searchSpace, TableSweepSettings sweepSettings, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + internal MachineLearningForecasting(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ForecastingSettings forecastingSettings, ForecastingPrimaryMetric? primaryMetric, ForecastingTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) { ForecastingSettings = forecastingSettings; PrimaryMetric = primaryMetric; TrainingSettings = trainingSettings; CvSplitColumnNames = cvSplitColumnNames; FeaturizationSettings = featurizationSettings; - FixedParameters = fixedParameters; LimitSettings = limitSettings; NCrossValidations = nCrossValidations; - SearchSpace = searchSpace; - SweepSettings = sweepSettings; TestData = testData; TestDataSize = testDataSize; ValidationData = validationData; @@ -97,8 +90,6 @@ internal MachineLearningForecasting() public IList CvSplitColumnNames { get; set; } /// Featurization inputs needed for AutoML job. public TableVerticalFeaturizationSettings FeaturizationSettings { get; set; } - /// Model/training parameters that will remain constant throughout training. - public TableFixedParameters FixedParameters { get; set; } /// Execution constraints for AutoMLJob. public TableVerticalLimitSettings LimitSettings { get; set; } /// @@ -108,10 +99,6 @@ internal MachineLearningForecasting() /// The available derived classes include and . /// public NCrossValidations NCrossValidations { get; set; } - /// Search space for sampling different combinations of models and their hyperparameters. - public IList SearchSpace { get; set; } - /// Settings for model sweeping and hyperparameter tuning. - public TableSweepSettings SweepSettings { get; set; } /// Test data input. public MachineLearningTableJobInput TestData { get; set; } /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobCollectionGetAllOptions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobCollectionGetAllOptions.cs deleted file mode 100644 index 14c23f5f2f3af..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobCollectionGetAllOptions.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The MachineLearningJobCollectionGetAllOptions. - public partial class MachineLearningJobCollectionGetAllOptions - { - /// Initializes a new instance of . - public MachineLearningJobCollectionGetAllOptions() - { - } - - /// Continuation token for pagination. - public string Skip { get; set; } - /// Type of job to be returned. - public string JobType { get; set; } - /// Jobs returned will have this tag key. - public string Tag { get; set; } - /// View type for including/excluding (for example) archived entities. - public MachineLearningListViewType? ListViewType { get; set; } - /// Asset name the job's named output is registered with. - public string AssetName { get; set; } - /// Indicator whether the job is scheduled job. - public bool? Scheduled { get; set; } - /// The scheduled id for listing the job triggered from. - public string ScheduleId { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.Serialization.cs index 3eee51ac52048..2113e2c45b397 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.Serialization.cs @@ -97,24 +97,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -230,7 +212,7 @@ internal static MachineLearningJobProperties DeserializeMachineLearningJobProper { case "AutoML": return AutoMLJob.DeserializeAutoMLJob(element, options); case "Command": return MachineLearningCommandJob.DeserializeMachineLearningCommandJob(element, options); - case "Labeling": return LabelingJobProperties.DeserializeLabelingJobProperties(element, options); + case "FineTuning": return FineTuningJob.DeserializeFineTuningJob(element, options); case "Pipeline": return MachineLearningPipelineJob.DeserializeMachineLearningPipelineJob(element, options); case "Spark": return SparkJob.DeserializeSparkJob(element, options); case "Sweep": return MachineLearningSweepJob.DeserializeMachineLearningSweepJob(element, options); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.cs index c598cdb9be9fa..9efd9ba16b9bd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.cs @@ -14,14 +14,13 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Base definition for a job. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// public partial class MachineLearningJobProperties : MachineLearningResourceBase { /// Initializes a new instance of . public MachineLearningJobProperties() { - SecretsConfiguration = new ChangeTrackingDictionary(); Services = new ChangeTrackingDictionary(); } @@ -43,13 +42,12 @@ public MachineLearningJobProperties() /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. /// /// Status of the job. - internal MachineLearningJobProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status) : base(description, properties, tags, serializedAdditionalRawData) + internal MachineLearningJobProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status) : base(description, properties, tags, serializedAdditionalRawData) { ComponentId = componentId; ComputeId = computeId; @@ -59,7 +57,6 @@ internal MachineLearningJobProperties(string description, IDictionary Notification setting for the job. public NotificationSetting NotificationSetting { get; set; } - /// Configuration for secrets to be made available during runtime. - public IDictionary SecretsConfiguration { get; set; } /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.Serialization.cs index 17be76a8c3b2a..7566763378f8b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.Serialization.cs @@ -60,35 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteNull("instanceType"); } } - if (Optional.IsCollectionDefined(Locations)) - { - if (Locations != null) - { - writer.WritePropertyName("locations"u8); - writer.WriteStartArray(); - foreach (var item in Locations) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("locations"); - } - } - if (Optional.IsDefined(MaxInstanceCount)) - { - if (MaxInstanceCount != null) - { - writer.WritePropertyName("maxInstanceCount"u8); - writer.WriteNumberValue(MaxInstanceCount.Value); - } - else - { - writer.WriteNull("maxInstanceCount"); - } - } if (Optional.IsCollectionDefined(Properties)) { if (Properties != null) @@ -161,8 +132,6 @@ internal static MachineLearningJobResourceConfiguration DeserializeMachineLearni string shmSize = default; int? instanceCount = default; string instanceType = default; - IList locations = default; - int? maxInstanceCount = default; IDictionary properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -202,31 +171,6 @@ internal static MachineLearningJobResourceConfiguration DeserializeMachineLearni instanceType = property.Value.GetString(); continue; } - if (property.NameEquals("locations"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - locations = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - locations = array; - continue; - } - if (property.NameEquals("maxInstanceCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxInstanceCount = null; - continue; - } - maxInstanceCount = property.Value.GetInt32(); - continue; - } if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -258,8 +202,6 @@ internal static MachineLearningJobResourceConfiguration DeserializeMachineLearni return new MachineLearningJobResourceConfiguration( instanceCount, instanceType, - locations ?? new ChangeTrackingList(), - maxInstanceCount, properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, dockerArgs, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.cs index ab1f7d5009b1b..b2950c85222d2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.cs @@ -21,16 +21,11 @@ public MachineLearningJobResourceConfiguration() /// Initializes a new instance of . /// Optional number of instances or nodes used by the compute target. /// Optional type of VM used as supported by the compute target. - /// Locations where the job can run. - /// - /// Optional max allowed number of instances or nodes to be used by the compute target. - /// For use with elastic training, currently supported by PyTorch distribution type only. - /// /// Additional properties bag. /// Keeps track of any properties unknown to the library. /// Extra arguments to pass to the Docker run command. This would override any parameters that have already been set by the system, or in this section. This parameter is only supported for Azure ML compute types. /// Size of the docker container's shared memory block. This should be in the format of (number)(unit) where number as to be greater than 0 and the unit can be one of b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - internal MachineLearningJobResourceConfiguration(int? instanceCount, string instanceType, IList locations, int? maxInstanceCount, IDictionary properties, IDictionary serializedAdditionalRawData, string dockerArgs, string shmSize) : base(instanceCount, instanceType, locations, maxInstanceCount, properties, serializedAdditionalRawData) + internal MachineLearningJobResourceConfiguration(int? instanceCount, string instanceType, IDictionary properties, IDictionary serializedAdditionalRawData, string dockerArgs, string shmSize) : base(instanceCount, instanceType, properties, serializedAdditionalRawData) { DockerArgs = dockerArgs; ShmSize = shmSize; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobScheduleAction.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobScheduleAction.cs index 202108f01316e..23b52b9e0b7bb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobScheduleAction.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobScheduleAction.cs @@ -17,7 +17,7 @@ public partial class MachineLearningJobScheduleAction : MachineLearningScheduleA /// /// [Required] Defines Schedule action definition details. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// /// is null. public MachineLearningJobScheduleAction(MachineLearningJobProperties jobDefinition) @@ -34,7 +34,7 @@ public MachineLearningJobScheduleAction(MachineLearningJobProperties jobDefiniti /// /// [Required] Defines Schedule action definition details. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// internal MachineLearningJobScheduleAction(ScheduleActionType actionType, IDictionary serializedAdditionalRawData, MachineLearningJobProperties jobDefinition) : base(actionType, serializedAdditionalRawData) { @@ -50,7 +50,7 @@ internal MachineLearningJobScheduleAction() /// /// [Required] Defines Schedule action definition details. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// public MachineLearningJobProperties JobDefinition { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobService.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobService.cs index ca8739d0ee426..e660e21a4c973 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobService.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobService.cs @@ -61,7 +61,7 @@ public MachineLearningJobService() /// 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 . /// - /// Port for endpoint set by user. + /// Port for endpoint. /// Additional properties to set on the endpoint. /// Status of endpoint. /// Keeps track of any properties unknown to the library. @@ -90,7 +90,7 @@ internal MachineLearningJobService(string endpoint, string errorMessage, string /// The available derived classes include . /// public JobNodes Nodes { get; set; } - /// Port for endpoint set by user. + /// Port for endpoint. public int? Port { get; set; } /// Additional properties to set on the endpoint. public IDictionary Properties { get; set; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobStatus.cs index 5413431a9ec78..e7551d29e477b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobStatus.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobStatus.cs @@ -36,7 +36,6 @@ public MachineLearningJobStatus(string value) private const string NotRespondingValue = "NotResponding"; private const string PausedValue = "Paused"; private const string UnknownValue = "Unknown"; - private const string ScheduledValue = "Scheduled"; /// Run hasn't started yet. public static MachineLearningJobStatus NotStarted { get; } = new MachineLearningJobStatus(NotStartedValue); @@ -69,8 +68,6 @@ public MachineLearningJobStatus(string value) public static MachineLearningJobStatus Paused { get; } = new MachineLearningJobStatus(PausedValue); /// Default job status if not mapped to all other statuses. public static MachineLearningJobStatus Unknown { get; } = new MachineLearningJobStatus(UnknownValue); - /// The job is in a scheduled state. Job is not in any active state. - public static MachineLearningJobStatus Scheduled { get; } = new MachineLearningJobStatus(ScheduledValue); /// Determines if two values are the same. public static bool operator ==(MachineLearningJobStatus left, MachineLearningJobStatus right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningKubernetesOnlineDeployment.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningKubernetesOnlineDeployment.cs index 3d457bf19cf1d..93a21987e419b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningKubernetesOnlineDeployment.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningKubernetesOnlineDeployment.cs @@ -22,7 +22,7 @@ public MachineLearningKubernetesOnlineDeployment() /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.Serialization.cs index bb273ea5eca69..b0e178253d690 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri MachineLearningWorkspaceConnectionManagedIdentity credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri return new MachineLearningManagedIdentityAuthTypeWorkspaceConnection( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.cs index dc051ac8173fd..62d1b92848ce5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,12 +23,20 @@ public MachineLearningManagedIdentityAuthTypeWorkspaceConnection() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// - internal MachineLearningManagedIdentityAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, MachineLearningWorkspaceConnectionManagedIdentity credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal MachineLearningManagedIdentityAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, MachineLearningWorkspaceConnectionManagedIdentity credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedOnlineDeployment.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedOnlineDeployment.cs index 84641c44d7b30..b9dc436df61e4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedOnlineDeployment.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedOnlineDeployment.cs @@ -22,7 +22,7 @@ public MachineLearningManagedOnlineDeployment() /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionCollectionGetAllOptions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionCollectionGetAllOptions.cs index bf3ae74f31770..3934efc9ae937 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionCollectionGetAllOptions.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionCollectionGetAllOptions.cs @@ -35,7 +35,5 @@ public MachineLearningModelVersionCollectionGetAllOptions() public string Feed { get; set; } /// View type for including/excluding (for example) archived entities. public MachineLearningListViewType? ListViewType { get; set; } - /// Model stage. - public string Stage { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.Serialization.cs index 78a391d17add0..73bcc1a613643 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.Serialization.cs @@ -44,18 +44,6 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteNull("flavors"); } } - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (Optional.IsDefined(JobName)) { if (JobName != null) @@ -109,18 +97,6 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteNull("stage"); } } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -218,13 +194,11 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning return null; } IDictionary flavors = default; - IntellectualProperty intellectualProperty = default; string jobName = default; string modelType = default; Uri modelUri = default; RegistryAssetProvisioningState? provisioningState = default; string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -249,16 +223,6 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning flavors = dictionary; continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("jobName"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -308,16 +272,6 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning stage = property.Value.GetString(); continue; } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -387,11 +341,9 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, flavors ?? new ChangeTrackingDictionary(), - intellectualProperty, jobName, modelType, modelUri, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.cs index 894645f87aae6..59e6668734377 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.cs @@ -24,20 +24,17 @@ public MachineLearningModelVersionProperties() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Mapping of model flavors to their properties. - /// Intellectual Property details. Used if model is an Intellectual Property. /// Name of the training job which produced this model. /// The storage format for this entity. Used for NCD. /// The URI path to the model contents. /// Provisioning state for the model version. /// Stage in the model lifecycle assigned to this model. - internal MachineLearningModelVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, IDictionary flavors, IntellectualProperty intellectualProperty, string jobName, string modelType, Uri modelUri, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningModelVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, IDictionary flavors, string jobName, string modelType, Uri modelUri, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { Flavors = flavors; - IntellectualProperty = intellectualProperty; JobName = jobName; ModelType = modelType; ModelUri = modelUri; @@ -47,8 +44,6 @@ internal MachineLearningModelVersionProperties(string description, IDictionary Mapping of model flavors to their properties. public IDictionary Flavors { get; set; } - /// Intellectual Property details. Used if model is an Intellectual Property. - public IntellectualProperty IntellectualProperty { get; set; } /// Name of the training job which produced this model. public string JobName { get; set; } /// The storage format for this entity. Used for NCD. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.Serialization.cs index b842051331e02..ebec68aa984c9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.Serialization.cs @@ -33,28 +33,72 @@ void IJsonModel.Write(Utf8JsonWr writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -95,9 +139,17 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin } MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -116,6 +168,20 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -125,13 +191,68 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -139,6 +260,15 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -148,9 +278,17 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin return new MachineLearningNoneAuthTypeWorkspaceConnection( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.cs index b191015d36fc0..80ed5abe5039c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,11 +23,19 @@ public MachineLearningNoneAuthTypeWorkspaceConnection() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. - internal MachineLearningNoneAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal MachineLearningNoneAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { AuthType = authType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineDeploymentProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineDeploymentProperties.cs index 9df72b7cedf6c..90771c71bc0b3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineDeploymentProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineDeploymentProperties.cs @@ -24,7 +24,7 @@ public MachineLearningOnlineDeploymentProperties() /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineRequestSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineRequestSettings.cs index dbdf005f4472f..faae447934575 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineRequestSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineRequestSettings.cs @@ -53,8 +53,9 @@ public MachineLearningOnlineRequestSettings() /// Initializes a new instance of . /// The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. /// - /// The maximum amount of time a request will stay in the queue in ISO 8601 format. + /// (Deprecated for Managed Online Endpoints) The maximum amount of time a request will stay in the queue in ISO 8601 format. /// Defaults to 500ms. + /// (Now increase `request_timeout_ms` to account for any networking/queue delays) /// /// /// The scoring timeout in ISO 8601 format. @@ -72,8 +73,9 @@ internal MachineLearningOnlineRequestSettings(int? maxConcurrentRequestsPerInsta /// The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. public int? MaxConcurrentRequestsPerInstance { get; set; } /// - /// The maximum amount of time a request will stay in the queue in ISO 8601 format. + /// (Deprecated for Managed Online Endpoints) The maximum amount of time a request will stay in the queue in ISO 8601 format. /// Defaults to 500ms. + /// (Now increase `request_timeout_ms` to account for any networking/queue delays) /// public TimeSpan? MaxQueueWait { get; set; } /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationName.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationName.cs index 7f3860bc2dd98..47201536eea78 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationName.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationName.cs @@ -26,6 +26,7 @@ public MachineLearningOperationName(string value) private const string StartValue = "Start"; private const string StopValue = "Stop"; private const string RestartValue = "Restart"; + private const string ResizeValue = "Resize"; private const string ReimageValue = "Reimage"; private const string DeleteValue = "Delete"; @@ -37,6 +38,8 @@ public MachineLearningOperationName(string value) public static MachineLearningOperationName Stop { get; } = new MachineLearningOperationName(StopValue); /// Restart. public static MachineLearningOperationName Restart { get; } = new MachineLearningOperationName(RestartValue); + /// Resize. + public static MachineLearningOperationName Resize { get; } = new MachineLearningOperationName(ResizeValue); /// Reimage. public static MachineLearningOperationName Reimage { get; } = new MachineLearningOperationName(ReimageValue); /// Delete. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationStatus.cs index 4230c37905411..c6297a42b7fb1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationStatus.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationStatus.cs @@ -28,6 +28,7 @@ public MachineLearningOperationStatus(string value) private const string StartFailedValue = "StartFailed"; private const string StopFailedValue = "StopFailed"; private const string RestartFailedValue = "RestartFailed"; + private const string ResizeFailedValue = "ResizeFailed"; private const string ReimageFailedValue = "ReimageFailed"; private const string DeleteFailedValue = "DeleteFailed"; @@ -43,6 +44,8 @@ public MachineLearningOperationStatus(string value) public static MachineLearningOperationStatus StopFailed { get; } = new MachineLearningOperationStatus(StopFailedValue); /// RestartFailed. public static MachineLearningOperationStatus RestartFailed { get; } = new MachineLearningOperationStatus(RestartFailedValue); + /// ResizeFailed. + public static MachineLearningOperationStatus ResizeFailed { get; } = new MachineLearningOperationStatus(ResizeFailedValue); /// ReimageFailed. public static MachineLearningOperationStatus ReimageFailed { get; } = new MachineLearningOperationStatus(ReimageFailedValue); /// DeleteFailed. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.Serialization.cs index 25a9b295e848d..7a02756a749d4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.Serialization.cs @@ -31,6 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.cs index cabaf91430a04..c1ad233e93cf0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.cs @@ -52,16 +52,19 @@ public abstract partial class MachineLearningOutboundRule /// Initializes a new instance of . protected MachineLearningOutboundRule() { + ParentRuleNames = new ChangeTrackingList(); } /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. - internal MachineLearningOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData) + internal MachineLearningOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData) { Category = category; + ParentRuleNames = parentRuleNames; Status = status; OutboundRuleType = outboundRuleType; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -69,6 +72,8 @@ internal MachineLearningOutboundRule(OutboundRuleCategory? category, OutboundRul /// Category of a managed network Outbound Rule of a machine learning workspace. public OutboundRuleCategory? Category { get; set; } + /// Gets the parent rule names. + public IReadOnlyList ParentRuleNames { get; } /// Type of a managed network Outbound Rule of a machine learning workspace. public OutboundRuleStatus? Status { get; set; } /// Type of a managed network Outbound Rule of a machine learning workspace. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.Serialization.cs index ccee14df39c86..59c7f0c4290ef 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write(Utf8JsonWri writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine WorkspaceConnectionPersonalAccessToken credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine return new MachineLearningPatAuthTypeWorkspaceConnection( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.cs index 1642b839696b2..78f1bb6726fde 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,12 +23,20 @@ public MachineLearningPatAuthTypeWorkspaceConnection() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// - internal MachineLearningPatAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, WorkspaceConnectionPersonalAccessToken credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal MachineLearningPatAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionPersonalAccessToken credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.Serialization.cs index 3e5626c71290e..1c100f0c20425 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.Serialization.cs @@ -195,24 +195,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -335,7 +317,6 @@ internal static MachineLearningPipelineJob DeserializeMachineLearningPipelineJob bool? isArchived = default; JobType jobType = default; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -486,21 +467,6 @@ internal static MachineLearningPipelineJob DeserializeMachineLearningPipelineJob notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -584,7 +550,6 @@ internal static MachineLearningPipelineJob DeserializeMachineLearningPipelineJob isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status, inputs ?? new ChangeTrackingDictionary(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.cs index b089670fcc8d7..9891a97bad117 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.cs @@ -41,7 +41,6 @@ public MachineLearningPipelineJob() /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -60,7 +59,7 @@ public MachineLearningPipelineJob() /// /// Pipeline settings, for things like ContinueRunOnStepFailure etc. /// ARM resource ID of source job. - internal MachineLearningPipelineJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status, IDictionary inputs, IDictionary jobs, IDictionary outputs, BinaryData settings, ResourceIdentifier sourceJobId) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) + internal MachineLearningPipelineJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, IDictionary inputs, IDictionary jobs, IDictionary outputs, BinaryData settings, ResourceIdentifier sourceJobId) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) { Inputs = inputs; Jobs = jobs; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.Serialization.cs index 248ca99a46115..0f4918e05be2c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.Serialization.cs @@ -117,7 +117,7 @@ internal static MachineLearningRecurrenceTrigger DeserializeMachineLearningRecur string endTime = default; string startTime = default; string timeZone = default; - MachineLearningTriggerType triggerType = default; + TriggerType triggerType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -169,7 +169,7 @@ internal static MachineLearningRecurrenceTrigger DeserializeMachineLearningRecur } if (property.NameEquals("triggerType"u8)) { - triggerType = new MachineLearningTriggerType(property.Value.GetString()); + triggerType = new TriggerType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.cs index 167510b44d780..3e93f5e51107e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.cs @@ -20,7 +20,7 @@ public MachineLearningRecurrenceTrigger(MachineLearningRecurrenceFrequency frequ { Frequency = frequency; Interval = interval; - TriggerType = MachineLearningTriggerType.Recurrence; + TriggerType = TriggerType.Recurrence; } /// Initializes a new instance of . @@ -39,7 +39,7 @@ public MachineLearningRecurrenceTrigger(MachineLearningRecurrenceFrequency frequ /// [Required] The frequency to trigger schedule. /// [Required] Specifies schedule interval in conjunction with frequency. /// The recurrence schedule. - internal MachineLearningRecurrenceTrigger(string endTime, string startTime, string timeZone, MachineLearningTriggerType triggerType, IDictionary serializedAdditionalRawData, MachineLearningRecurrenceFrequency frequency, int interval, MachineLearningRecurrenceSchedule schedule) : base(endTime, startTime, timeZone, triggerType, serializedAdditionalRawData) + internal MachineLearningRecurrenceTrigger(string endTime, string startTime, string timeZone, TriggerType triggerType, IDictionary serializedAdditionalRawData, MachineLearningRecurrenceFrequency frequency, int interval, MachineLearningRecurrenceSchedule schedule) : base(endTime, startTime, timeZone, triggerType, serializedAdditionalRawData) { Frequency = frequency; Interval = interval; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.Serialization.cs index 1f7013a789463..c15e992ff0844 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.Serialization.cs @@ -43,35 +43,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteNull("instanceType"); } } - if (Optional.IsCollectionDefined(Locations)) - { - if (Locations != null) - { - writer.WritePropertyName("locations"u8); - writer.WriteStartArray(); - foreach (var item in Locations) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("locations"); - } - } - if (Optional.IsDefined(MaxInstanceCount)) - { - if (MaxInstanceCount != null) - { - writer.WritePropertyName("maxInstanceCount"u8); - writer.WriteNumberValue(MaxInstanceCount.Value); - } - else - { - writer.WriteNull("maxInstanceCount"); - } - } if (Optional.IsCollectionDefined(Properties)) { if (Properties != null) @@ -142,8 +113,6 @@ internal static MachineLearningResourceConfiguration DeserializeMachineLearningR } int? instanceCount = default; string instanceType = default; - IList locations = default; - int? maxInstanceCount = default; IDictionary properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -168,31 +137,6 @@ internal static MachineLearningResourceConfiguration DeserializeMachineLearningR instanceType = property.Value.GetString(); continue; } - if (property.NameEquals("locations"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - locations = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - locations = array; - continue; - } - if (property.NameEquals("maxInstanceCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxInstanceCount = null; - continue; - } - maxInstanceCount = property.Value.GetInt32(); - continue; - } if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -221,13 +165,7 @@ internal static MachineLearningResourceConfiguration DeserializeMachineLearningR } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningResourceConfiguration( - instanceCount, - instanceType, - locations ?? new ChangeTrackingList(), - maxInstanceCount, - properties ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData); + return new MachineLearningResourceConfiguration(instanceCount, instanceType, properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.cs index ae9d5cfef3bca..e3181c69c35a9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.cs @@ -48,26 +48,18 @@ public partial class MachineLearningResourceConfiguration /// Initializes a new instance of . public MachineLearningResourceConfiguration() { - Locations = new ChangeTrackingList(); Properties = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Optional number of instances or nodes used by the compute target. /// Optional type of VM used as supported by the compute target. - /// Locations where the job can run. - /// - /// Optional max allowed number of instances or nodes to be used by the compute target. - /// For use with elastic training, currently supported by PyTorch distribution type only. - /// /// Additional properties bag. /// Keeps track of any properties unknown to the library. - internal MachineLearningResourceConfiguration(int? instanceCount, string instanceType, IList locations, int? maxInstanceCount, IDictionary properties, IDictionary serializedAdditionalRawData) + internal MachineLearningResourceConfiguration(int? instanceCount, string instanceType, IDictionary properties, IDictionary serializedAdditionalRawData) { InstanceCount = instanceCount; InstanceType = instanceType; - Locations = locations; - MaxInstanceCount = maxInstanceCount; Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -76,13 +68,6 @@ internal MachineLearningResourceConfiguration(int? instanceCount, string instanc public int? InstanceCount { get; set; } /// Optional type of VM used as supported by the compute target. public string InstanceType { get; set; } - /// Locations where the job can run. - public IList Locations { get; set; } - /// - /// Optional max allowed number of instances or nodes to be used by the compute target. - /// For use with elastic training, currently supported by PyTorch distribution type only. - /// - public int? MaxInstanceCount { get; set; } /// /// Additional properties bag. /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.Serialization.cs index b8ee1b8baaf7b..d55249f7f6dd8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write(Utf8JsonWri writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine WorkspaceConnectionSharedAccessSignature credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine return new MachineLearningSasAuthTypeWorkspaceConnection( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.cs index 8aad77a12a645..970cce1336077 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,12 +23,20 @@ public MachineLearningSasAuthTypeWorkspaceConnection() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// - internal MachineLearningSasAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, WorkspaceConnectionSharedAccessSignature credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal MachineLearningSasAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionSharedAccessSignature credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.Serialization.cs index f9437e3bb3b1e..e1d22fa44e9e0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.Serialization.cs @@ -72,7 +72,6 @@ internal static MachineLearningScheduleAction DeserializeMachineLearningSchedule { case "CreateJob": return MachineLearningJobScheduleAction.DeserializeMachineLearningJobScheduleAction(element, options); case "CreateMonitor": return CreateMonitorAction.DeserializeCreateMonitorAction(element, options); - case "ImportData": return ImportDataAction.DeserializeImportDataAction(element, options); case "InvokeBatchEndpoint": return MachineLearningEndpointScheduleAction.DeserializeMachineLearningEndpointScheduleAction(element, options); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.cs index ce59b32dbc5db..96213f32518e7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { /// /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// public abstract partial class MachineLearningScheduleAction { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleProperties.cs index 9fcd369dded44..b011f9ad9a545 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleProperties.cs @@ -17,7 +17,7 @@ public partial class MachineLearningScheduleProperties : MachineLearningResource /// /// [Required] Specifies the action of the schedule /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// /// /// [Required] Specifies the trigger details @@ -42,7 +42,7 @@ public MachineLearningScheduleProperties(MachineLearningScheduleAction action, M /// /// [Required] Specifies the action of the schedule /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// /// Display name of schedule. /// Is the schedule enabled?. @@ -69,7 +69,7 @@ internal MachineLearningScheduleProperties() /// /// [Required] Specifies the action of the schedule /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// public MachineLearningScheduleAction Action { get; set; } /// Display name of schedule. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.Serialization.cs index e3b590d86bb49..4a037be4b4579 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.Serialization.cs @@ -178,24 +178,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -322,7 +304,6 @@ internal static MachineLearningSweepJob DeserializeMachineLearningSweepJob(JsonE bool? isArchived = default; JobType jobType = default; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -480,21 +461,6 @@ internal static MachineLearningSweepJob DeserializeMachineLearningSweepJob(JsonE notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -578,7 +544,6 @@ internal static MachineLearningSweepJob DeserializeMachineLearningSweepJob(JsonE isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status, earlyTermination, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.cs index 485070c4cbd4f..e6a36abd77e42 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.cs @@ -58,7 +58,6 @@ public MachineLearningSweepJob(MachineLearningObjective objective, SamplingAlgor /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -89,7 +88,7 @@ public MachineLearningSweepJob(MachineLearningObjective objective, SamplingAlgor /// /// [Required] A dictionary containing each parameter and its distribution. The dictionary key is the name of the parameter. /// [Required] Trial component definition. - internal MachineLearningSweepJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status, MachineLearningEarlyTerminationPolicy earlyTermination, IDictionary inputs, MachineLearningSweepJobLimits limits, MachineLearningObjective objective, IDictionary outputs, JobQueueSettings queueSettings, SamplingAlgorithm samplingAlgorithm, BinaryData searchSpace, MachineLearningTrialComponent trial) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) + internal MachineLearningSweepJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, MachineLearningEarlyTerminationPolicy earlyTermination, IDictionary inputs, MachineLearningSweepJobLimits limits, MachineLearningObjective objective, IDictionary outputs, JobQueueSettings queueSettings, SamplingAlgorithm samplingAlgorithm, BinaryData searchSpace, MachineLearningTrialComponent trial) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) { EarlyTermination = earlyTermination; Inputs = inputs; @@ -131,7 +130,19 @@ internal MachineLearningSweepJob() /// public IDictionary Outputs { get; set; } /// Queue settings for the job. - public JobQueueSettings QueueSettings { get; set; } + internal JobQueueSettings QueueSettings { get; set; } + /// Controls the compute job tier. + public JobTier? QueueJobTier + { + get => QueueSettings is null ? default : QueueSettings.JobTier; + set + { + if (QueueSettings is null) + QueueSettings = new JobQueueSettings(); + QueueSettings.JobTier = value; + } + } + /// /// [Required] The hyperparameter sampling algorithm /// 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. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.Serialization.cs index b341d71385477..531367a1c5530 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.Serialization.cs @@ -52,42 +52,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -187,9 +151,6 @@ internal static MachineLearningTable DeserializeMachineLearningTable(JsonElement IList referencedUris = default; MachineLearningDataType dataType = default; Uri dataUri = default; - IntellectualProperty intellectualProperty = default; - string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -231,36 +192,6 @@ internal static MachineLearningTable DeserializeMachineLearningTable(JsonElement dataUri = new Uri(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } - if (property.NameEquals("stage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - stage = null; - continue; - } - stage = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -330,13 +261,10 @@ internal static MachineLearningTable DeserializeMachineLearningTable(JsonElement properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, dataType, dataUri, - intellectualProperty, - stage, referencedUris ?? new ChangeTrackingList()); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.cs index 63da2b10c6565..2d7ee18335fcb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.cs @@ -29,15 +29,12 @@ public MachineLearningTable(Uri dataUri) : base(dataUri) /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// Intellectual Property details. Used if data is an Intellectual Property. - /// Stage in the data lifecycle assigned to this data asset. /// Uris referenced in the MLTable definition (required for lineage). - internal MachineLearningTable(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IntellectualProperty intellectualProperty, string stage, IList referencedUris) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived, dataType, dataUri, intellectualProperty, stage) + internal MachineLearningTable(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IList referencedUris) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived, dataType, dataUri) { ReferencedUris = referencedUris; DataType = dataType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.Serialization.cs index 3d33c7164a2e7..e0ae676b51280 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.Serialization.cs @@ -26,42 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(AssetVersion)) - { - if (AssetVersion != null) - { - writer.WritePropertyName("assetVersion"u8); - writer.WriteStringValue(AssetVersion); - } - else - { - writer.WriteNull("assetVersion"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -131,9 +95,6 @@ internal static MachineLearningTableJobOutput DeserializeMachineLearningTableJob { return null; } - string assetName = default; - string assetVersion = default; - AutoDeleteSetting autoDeleteSetting = default; MachineLearningOutputDeliveryMode? mode = default; Uri uri = default; string description = default; @@ -142,36 +103,6 @@ internal static MachineLearningTableJobOutput DeserializeMachineLearningTableJob Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("assetVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetVersion = null; - continue; - } - assetVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,15 +143,7 @@ internal static MachineLearningTableJobOutput DeserializeMachineLearningTableJob } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningTableJobOutput( - description, - jobOutputType, - serializedAdditionalRawData, - assetName, - assetVersion, - autoDeleteSetting, - mode, - uri); + return new MachineLearningTableJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.cs index 01af9cb3e1ae4..7ccc97f227f38 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.cs @@ -23,27 +23,15 @@ public MachineLearningTableJobOutput() /// Description for the output. /// [Required] Specifies the type of job. /// Keeps track of any properties unknown to the library. - /// Output Asset Name. - /// Output Asset Version. - /// Auto delete setting of output data asset. /// Output Asset Delivery Mode. /// Output Asset URI. - internal MachineLearningTableJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, string assetName, string assetVersion, AutoDeleteSetting autoDeleteSetting, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + internal MachineLearningTableJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) { - AssetName = assetName; - AssetVersion = assetVersion; - AutoDeleteSetting = autoDeleteSetting; Mode = mode; Uri = uri; JobOutputType = jobOutputType; } - /// Output Asset Name. - public string AssetName { get; set; } - /// Output Asset Version. - public string AssetVersion { get; set; } - /// Auto delete setting of output data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } /// Output Asset Delivery Mode. public MachineLearningOutputDeliveryMode? Mode { get; set; } /// Output Asset URI. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.Serialization.cs index 46d6edb69d874..28e2d071730f9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.Serialization.cs @@ -68,11 +68,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteNull("stackEnsembleSettings"); } } - if (Optional.IsDefined(TrainingMode)) - { - writer.WritePropertyName("trainingMode"u8); - writer.WriteStringValue(TrainingMode.Value.ToString()); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -118,7 +113,6 @@ internal static MachineLearningTrainingSettings DeserializeMachineLearningTraini bool? enableVoteEnsemble = default; TimeSpan? ensembleModelDownloadTimeout = default; MachineLearningStackEnsembleSettings stackEnsembleSettings = default; - TrainingMode? trainingMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -187,15 +181,6 @@ internal static MachineLearningTrainingSettings DeserializeMachineLearningTraini stackEnsembleSettings = MachineLearningStackEnsembleSettings.DeserializeMachineLearningStackEnsembleSettings(property.Value, options); continue; } - if (property.NameEquals("trainingMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - trainingMode = new TrainingMode(property.Value.GetString()); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -210,7 +195,6 @@ internal static MachineLearningTrainingSettings DeserializeMachineLearningTraini enableVoteEnsemble, ensembleModelDownloadTimeout, stackEnsembleSettings, - trainingMode, serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.cs index 43475454b5761..4f7d3b4e49768 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.cs @@ -61,13 +61,8 @@ public MachineLearningTrainingSettings() /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// /// Stack ensemble settings for stack ensemble run. - /// - /// TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' for now, however in the future may result in mixed mode or heuristics based mode selection. Default is 'auto'. - /// If 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. - /// If 'NonDistributed' then only non distributed algorithms are chosen. - /// /// Keeps track of any properties unknown to the library. - internal MachineLearningTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, TrainingMode? trainingMode, IDictionary serializedAdditionalRawData) + internal MachineLearningTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, IDictionary serializedAdditionalRawData) { IsDnnTrainingEnabled = isDnnTrainingEnabled; IsModelExplainabilityEnabled = isModelExplainabilityEnabled; @@ -76,7 +71,6 @@ internal MachineLearningTrainingSettings(bool? isDnnTrainingEnabled, bool? isMod IsVoteEnsembleEnabled = isVoteEnsembleEnabled; EnsembleModelDownloadTimeout = ensembleModelDownloadTimeout; StackEnsembleSettings = stackEnsembleSettings; - TrainingMode = trainingMode; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -97,11 +91,5 @@ internal MachineLearningTrainingSettings(bool? isDnnTrainingEnabled, bool? isMod public TimeSpan? EnsembleModelDownloadTimeout { get; set; } /// Stack ensemble settings for stack ensemble run. public MachineLearningStackEnsembleSettings StackEnsembleSettings { get; set; } - /// - /// TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' for now, however in the future may result in mixed mode or heuristics based mode selection. Default is 'auto'. - /// If 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. - /// If 'NonDistributed' then only non distributed algorithms are chosen. - /// - public TrainingMode? TrainingMode { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrialComponent.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrialComponent.cs index 8d1d20ac08e20..1488e8ba27074 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrialComponent.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrialComponent.cs @@ -66,7 +66,7 @@ public MachineLearningTrialComponent(string command, ResourceIdentifier environm /// /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// /// [Required] The ARM resource ID of the Environment specification for the job. /// Environment variables included in the job. @@ -95,7 +95,7 @@ internal MachineLearningTrialComponent() /// /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// public MachineLearningDistributionConfiguration Distribution { get; set; } /// [Required] The ARM resource ID of the Environment specification for the job. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTriggerBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTriggerBase.cs index 44d23e21c7583..8e6b48c59b659 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTriggerBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTriggerBase.cs @@ -66,7 +66,7 @@ protected MachineLearningTriggerBase() /// /// [Required]. /// Keeps track of any properties unknown to the library. - internal MachineLearningTriggerBase(string endTime, string startTime, string timeZone, MachineLearningTriggerType triggerType, IDictionary serializedAdditionalRawData) + internal MachineLearningTriggerBase(string endTime, string startTime, string timeZone, TriggerType triggerType, IDictionary serializedAdditionalRawData) { EndTime = endTime; StartTime = startTime; @@ -89,6 +89,6 @@ internal MachineLearningTriggerBase(string endTime, string startTime, string tim /// public string TimeZone { get; set; } /// [Required]. - internal MachineLearningTriggerType TriggerType { get; set; } + internal TriggerType TriggerType { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.Serialization.cs index a44b78a2780b5..24f607a237514 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.Serialization.cs @@ -26,42 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer } writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(AssetVersion)) - { - if (AssetVersion != null) - { - writer.WritePropertyName("assetVersion"u8); - writer.WriteStringValue(AssetVersion); - } - else - { - writer.WriteNull("assetVersion"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -131,9 +95,6 @@ internal static MachineLearningTritonModelJobOutput DeserializeMachineLearningTr { return null; } - string assetName = default; - string assetVersion = default; - AutoDeleteSetting autoDeleteSetting = default; MachineLearningOutputDeliveryMode? mode = default; Uri uri = default; string description = default; @@ -142,36 +103,6 @@ internal static MachineLearningTritonModelJobOutput DeserializeMachineLearningTr Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("assetVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetVersion = null; - continue; - } - assetVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,15 +143,7 @@ internal static MachineLearningTritonModelJobOutput DeserializeMachineLearningTr } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningTritonModelJobOutput( - description, - jobOutputType, - serializedAdditionalRawData, - assetName, - assetVersion, - autoDeleteSetting, - mode, - uri); + return new MachineLearningTritonModelJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.cs index 557b4b8a3c391..6b1adb8a10190 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.cs @@ -23,27 +23,15 @@ public MachineLearningTritonModelJobOutput() /// Description for the output. /// [Required] Specifies the type of job. /// Keeps track of any properties unknown to the library. - /// Output Asset Name. - /// Output Asset Version. - /// Auto delete setting of output data asset. /// Output Asset Delivery Mode. /// Output Asset URI. - internal MachineLearningTritonModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, string assetName, string assetVersion, AutoDeleteSetting autoDeleteSetting, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + internal MachineLearningTritonModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) { - AssetName = assetName; - AssetVersion = assetVersion; - AutoDeleteSetting = autoDeleteSetting; Mode = mode; Uri = uri; JobOutputType = jobOutputType; } - /// Output Asset Name. - public string AssetName { get; set; } - /// Output Asset Version. - public string AssetVersion { get; set; } - /// Auto delete setting of output data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } /// Output Asset Delivery Mode. public MachineLearningOutputDeliveryMode? Mode { get; set; } /// Output Asset URI. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.Serialization.cs index 056d3ffd26baf..82cb1403705cc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.Serialization.cs @@ -30,42 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -164,9 +128,6 @@ internal static MachineLearningUriFileDataVersion DeserializeMachineLearningUriF } MachineLearningDataType dataType = default; Uri dataUri = default; - IntellectualProperty intellectualProperty = default; - string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -186,36 +147,6 @@ internal static MachineLearningUriFileDataVersion DeserializeMachineLearningUriF dataUri = new Uri(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } - if (property.NameEquals("stage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - stage = null; - continue; - } - stage = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -285,13 +216,10 @@ internal static MachineLearningUriFileDataVersion DeserializeMachineLearningUriF properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, dataType, - dataUri, - intellectualProperty, - stage); + dataUri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.cs index 4c3a49c0afec9..014754d285aed 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.cs @@ -28,14 +28,11 @@ public MachineLearningUriFileDataVersion(Uri dataUri) : base(dataUri) /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// Intellectual Property details. Used if data is an Intellectual Property. - /// Stage in the data lifecycle assigned to this data asset. - internal MachineLearningUriFileDataVersion(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IntellectualProperty intellectualProperty, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived, dataType, dataUri, intellectualProperty, stage) + internal MachineLearningUriFileDataVersion(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived, dataType, dataUri) { DataType = dataType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.Serialization.cs index 8545d46931979..968bf30fce756 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.Serialization.cs @@ -26,42 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(AssetVersion)) - { - if (AssetVersion != null) - { - writer.WritePropertyName("assetVersion"u8); - writer.WriteStringValue(AssetVersion); - } - else - { - writer.WriteNull("assetVersion"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -131,9 +95,6 @@ internal static MachineLearningUriFileJobOutput DeserializeMachineLearningUriFil { return null; } - string assetName = default; - string assetVersion = default; - AutoDeleteSetting autoDeleteSetting = default; MachineLearningOutputDeliveryMode? mode = default; Uri uri = default; string description = default; @@ -142,36 +103,6 @@ internal static MachineLearningUriFileJobOutput DeserializeMachineLearningUriFil Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("assetVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetVersion = null; - continue; - } - assetVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,15 +143,7 @@ internal static MachineLearningUriFileJobOutput DeserializeMachineLearningUriFil } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningUriFileJobOutput( - description, - jobOutputType, - serializedAdditionalRawData, - assetName, - assetVersion, - autoDeleteSetting, - mode, - uri); + return new MachineLearningUriFileJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.cs index ef454747600ef..75989ed6f5553 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.cs @@ -23,27 +23,15 @@ public MachineLearningUriFileJobOutput() /// Description for the output. /// [Required] Specifies the type of job. /// Keeps track of any properties unknown to the library. - /// Output Asset Name. - /// Output Asset Version. - /// Auto delete setting of output data asset. /// Output Asset Delivery Mode. /// Output Asset URI. - internal MachineLearningUriFileJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, string assetName, string assetVersion, AutoDeleteSetting autoDeleteSetting, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + internal MachineLearningUriFileJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) { - AssetName = assetName; - AssetVersion = assetVersion; - AutoDeleteSetting = autoDeleteSetting; Mode = mode; Uri = uri; JobOutputType = jobOutputType; } - /// Output Asset Name. - public string AssetName { get; set; } - /// Output Asset Version. - public string AssetVersion { get; set; } - /// Auto delete setting of output data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } /// Output Asset Delivery Mode. public MachineLearningOutputDeliveryMode? Mode { get; set; } /// Output Asset URI. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.Serialization.cs index 814468f662e36..ab3582a8a149b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.Serialization.cs @@ -30,42 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -164,9 +128,6 @@ internal static MachineLearningUriFolderDataVersion DeserializeMachineLearningUr } MachineLearningDataType dataType = default; Uri dataUri = default; - IntellectualProperty intellectualProperty = default; - string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -186,36 +147,6 @@ internal static MachineLearningUriFolderDataVersion DeserializeMachineLearningUr dataUri = new Uri(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } - if (property.NameEquals("stage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - stage = null; - continue; - } - stage = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -285,13 +216,10 @@ internal static MachineLearningUriFolderDataVersion DeserializeMachineLearningUr properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, dataType, - dataUri, - intellectualProperty, - stage); + dataUri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.cs index b2cdfded89083..079791aabfd84 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.cs @@ -28,14 +28,11 @@ public MachineLearningUriFolderDataVersion(Uri dataUri) : base(dataUri) /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// Intellectual Property details. Used if data is an Intellectual Property. - /// Stage in the data lifecycle assigned to this data asset. - internal MachineLearningUriFolderDataVersion(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IntellectualProperty intellectualProperty, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived, dataType, dataUri, intellectualProperty, stage) + internal MachineLearningUriFolderDataVersion(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived, dataType, dataUri) { DataType = dataType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.Serialization.cs index 720b213a5f1b8..edbc33a33ac2d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.Serialization.cs @@ -26,42 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(AssetVersion)) - { - if (AssetVersion != null) - { - writer.WritePropertyName("assetVersion"u8); - writer.WriteStringValue(AssetVersion); - } - else - { - writer.WriteNull("assetVersion"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -131,9 +95,6 @@ internal static MachineLearningUriFolderJobOutput DeserializeMachineLearningUriF { return null; } - string assetName = default; - string assetVersion = default; - AutoDeleteSetting autoDeleteSetting = default; MachineLearningOutputDeliveryMode? mode = default; Uri uri = default; string description = default; @@ -142,36 +103,6 @@ internal static MachineLearningUriFolderJobOutput DeserializeMachineLearningUriF Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("assetVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetVersion = null; - continue; - } - assetVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,15 +143,7 @@ internal static MachineLearningUriFolderJobOutput DeserializeMachineLearningUriF } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningUriFolderJobOutput( - description, - jobOutputType, - serializedAdditionalRawData, - assetName, - assetVersion, - autoDeleteSetting, - mode, - uri); + return new MachineLearningUriFolderJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.cs index 6fe281da22fbd..36bafc62e0455 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.cs @@ -23,27 +23,15 @@ public MachineLearningUriFolderJobOutput() /// Description for the output. /// [Required] Specifies the type of job. /// Keeps track of any properties unknown to the library. - /// Output Asset Name. - /// Output Asset Version. - /// Auto delete setting of output data asset. /// Output Asset Delivery Mode. /// Output Asset URI. - internal MachineLearningUriFolderJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, string assetName, string assetVersion, AutoDeleteSetting autoDeleteSetting, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + internal MachineLearningUriFolderJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) { - AssetName = assetName; - AssetVersion = assetVersion; - AutoDeleteSetting = autoDeleteSetting; Mode = mode; Uri = uri; JobOutputType = jobOutputType; } - /// Output Asset Name. - public string AssetName { get; set; } - /// Output Asset Version. - public string AssetVersion { get; set; } - /// Auto delete setting of output data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } /// Output Asset Delivery Mode. public MachineLearningOutputDeliveryMode? Mode { get; set; } /// Output Asset URI. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.Serialization.cs index 7e6202b7a4a7b..fe22e39d41553 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Writ writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser MachineLearningWorkspaceConnectionUsernamePassword credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser return new MachineLearningUsernamePasswordAuthTypeWorkspaceConnection( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.cs index 7a255e4425f89..cd667ba3a7ace 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,12 +23,20 @@ public MachineLearningUsernamePasswordAuthTypeWorkspaceConnection() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// - internal MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, MachineLearningWorkspaceConnectionUsernamePassword credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, MachineLearningWorkspaceConnectionUsernamePassword credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionPatch.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionPatch.cs index c8a93becf429c..a3b3d1abed5b5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionPatch.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionPatch.cs @@ -54,7 +54,7 @@ public MachineLearningWorkspaceConnectionPatch() /// /// The properties that the machine learning workspace connection will be updated with. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// The available derived classes include , , , , , , , , , , and . /// /// Keeps track of any properties unknown to the library. internal MachineLearningWorkspaceConnectionPatch(MachineLearningWorkspaceConnectionProperties properties, IDictionary serializedAdditionalRawData) @@ -66,7 +66,7 @@ internal MachineLearningWorkspaceConnectionPatch(MachineLearningWorkspaceConnect /// /// The properties that the machine learning workspace connection will be updated with. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// The available derived classes include , , , , , , , , , , and . /// public MachineLearningWorkspaceConnectionProperties Properties { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.Serialization.cs index 743da0b3c84b3..80daf5ac889a9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.Serialization.cs @@ -33,28 +33,72 @@ void IJsonModel.Write(Utf8JsonWrit writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WriteStringValue(item); } -#endif + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -97,11 +141,14 @@ internal static MachineLearningWorkspaceConnectionProperties DeserializeMachineL { switch (discriminator.GetString()) { + case "AAD": return AadAuthTypeWorkspaceConnectionProperties.DeserializeAadAuthTypeWorkspaceConnectionProperties(element, options); case "AccessKey": return AccessKeyAuthTypeWorkspaceConnectionProperties.DeserializeAccessKeyAuthTypeWorkspaceConnectionProperties(element, options); + case "AccountKey": return AccountKeyAuthTypeWorkspaceConnectionProperties.DeserializeAccountKeyAuthTypeWorkspaceConnectionProperties(element, options); case "ApiKey": return ApiKeyAuthWorkspaceConnectionProperties.DeserializeApiKeyAuthWorkspaceConnectionProperties(element, options); case "CustomKeys": return CustomKeysWorkspaceConnectionProperties.DeserializeCustomKeysWorkspaceConnectionProperties(element, options); case "ManagedIdentity": return MachineLearningManagedIdentityAuthTypeWorkspaceConnection.DeserializeMachineLearningManagedIdentityAuthTypeWorkspaceConnection(element, options); case "None": return MachineLearningNoneAuthTypeWorkspaceConnection.DeserializeMachineLearningNoneAuthTypeWorkspaceConnection(element, options); + case "OAuth2": return OAuth2AuthTypeWorkspaceConnectionProperties.DeserializeOAuth2AuthTypeWorkspaceConnectionProperties(element, options); case "PAT": return MachineLearningPatAuthTypeWorkspaceConnection.DeserializeMachineLearningPatAuthTypeWorkspaceConnection(element, options); case "SAS": return MachineLearningSasAuthTypeWorkspaceConnection.DeserializeMachineLearningSasAuthTypeWorkspaceConnection(element, options); case "ServicePrincipal": return ServicePrincipalAuthTypeWorkspaceConnectionProperties.DeserializeServicePrincipalAuthTypeWorkspaceConnectionProperties(element, options); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.cs index 884634891b753..34c3f544b06a6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.cs @@ -7,12 +7,13 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { /// /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// The available derived classes include , , , , , , , , , , and . /// public abstract partial class MachineLearningWorkspaceConnectionProperties { @@ -51,22 +52,40 @@ public abstract partial class MachineLearningWorkspaceConnectionProperties /// Initializes a new instance of . protected MachineLearningWorkspaceConnectionProperties() { + Metadata = new ChangeTrackingDictionary(); + SharedUserList = new ChangeTrackingList(); } /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. - internal MachineLearningWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData) + internal MachineLearningWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) { AuthType = authType; Category = category; + CreatedByWorkspaceArmId = createdByWorkspaceArmId; + Error = error; ExpiryOn = expiryOn; + Group = group; + IsSharedToAll = isSharedToAll; Metadata = metadata; + PeRequirement = peRequirement; + PeStatus = peStatus; + SharedUserList = sharedUserList; Target = target; + UseWorkspaceManagedIdentity = useWorkspaceManagedIdentity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -74,40 +93,27 @@ internal MachineLearningWorkspaceConnectionProperties(MachineLearningConnectionA internal MachineLearningConnectionAuthType AuthType { get; set; } /// Category of the connection. public MachineLearningConnectionCategory? Category { get; set; } + /// Gets the created by workspace arm id. + public ResourceIdentifier CreatedByWorkspaceArmId { get; } + /// Gets or sets the error. + public string Error { get; set; } /// Gets or sets the expiry on. public DateTimeOffset? ExpiryOn { get; set; } - /// - /// Any object - /// - /// 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 Metadata { get; set; } + /// Group based on connection category. + public ConnectionGroup? Group { get; } + /// Gets or sets the is shared to all. + public bool? IsSharedToAll { get; set; } + /// Store user metadata for this connection. + public IDictionary Metadata { get; } + /// Gets or sets the pe requirement. + public ManagedPERequirement? PeRequirement { get; set; } + /// Gets or sets the pe status. + public ManagedPEStatus? PeStatus { get; set; } + /// Gets the shared user list. + public IList SharedUserList { get; } /// Gets or sets the target. public string Target { get; set; } + /// Gets or sets the use workspace managed identity. + public bool? UseWorkspaceManagedIdentity { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.Serialization.cs index 6be22d86f8f73..23391ec0bf2ac 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.Serialization.cs @@ -31,6 +31,11 @@ void IJsonModel.Write(Utf8Js writer.WritePropertyName("password"u8); writer.WriteStringValue(Password); } + if (Optional.IsDefined(SecurityToken)) + { + writer.WritePropertyName("securityToken"u8); + writer.WriteStringValue(SecurityToken); + } if (Optional.IsDefined(Username)) { writer.WritePropertyName("username"u8); @@ -75,6 +80,7 @@ internal static MachineLearningWorkspaceConnectionUsernamePassword DeserializeMa return null; } string password = default; + string securityToken = default; string username = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -85,6 +91,11 @@ internal static MachineLearningWorkspaceConnectionUsernamePassword DeserializeMa password = property.Value.GetString(); continue; } + if (property.NameEquals("securityToken"u8)) + { + securityToken = property.Value.GetString(); + continue; + } if (property.NameEquals("username"u8)) { username = property.Value.GetString(); @@ -96,7 +107,7 @@ internal static MachineLearningWorkspaceConnectionUsernamePassword DeserializeMa } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningWorkspaceConnectionUsernamePassword(password, username, serializedAdditionalRawData); + return new MachineLearningWorkspaceConnectionUsernamePassword(password, securityToken, username, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.cs index 5af53ce2289a6..0c3b16ed57d00 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.cs @@ -52,17 +52,21 @@ public MachineLearningWorkspaceConnectionUsernamePassword() /// Initializes a new instance of . /// + /// Optional, required by connections like SalesForce for extra security in addition to UsernamePassword. /// /// Keeps track of any properties unknown to the library. - internal MachineLearningWorkspaceConnectionUsernamePassword(string password, string username, IDictionary serializedAdditionalRawData) + internal MachineLearningWorkspaceConnectionUsernamePassword(string password, string securityToken, string username, IDictionary serializedAdditionalRawData) { Password = password; + SecurityToken = securityToken; Username = username; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Gets or sets the password. public string Password { get; set; } + /// Optional, required by connections like SalesForce for extra security in addition to UsernamePassword. + public string SecurityToken { get; set; } /// Gets or sets the username. public string Username { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.Serialization.cs index 02057d2865c91..9defbeeafb8ab 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.Serialization.cs @@ -160,6 +160,29 @@ void IJsonModel.Write(Utf8JsonWriter { JsonSerializer.Serialize(writer, document.RootElement); } +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(RequiredResourceProviders)) + { + writer.WritePropertyName("requiredResourceProviders"u8); + writer.WriteStartObject(); + foreach (var item in RequiredResourceProviders) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } #endif } writer.WriteEndObject(); @@ -277,6 +300,7 @@ internal static MachineLearningWorkspaceDiagnoseProperties DeserializeMachineLea IDictionary keyVault = default; IDictionary nsg = default; IDictionary others = default; + IDictionary requiredResourceProviders = default; IDictionary resourceLock = default; IDictionary storageAccount = default; IDictionary udr = default; @@ -410,6 +434,27 @@ internal static MachineLearningWorkspaceDiagnoseProperties DeserializeMachineLea others = dictionary; continue; } + if (property.NameEquals("requiredResourceProviders"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + requiredResourceProviders = dictionary; + continue; + } if (property.NameEquals("resourceLock"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -486,6 +531,7 @@ internal static MachineLearningWorkspaceDiagnoseProperties DeserializeMachineLea keyVault ?? new ChangeTrackingDictionary(), nsg ?? new ChangeTrackingDictionary(), others ?? new ChangeTrackingDictionary(), + requiredResourceProviders ?? new ChangeTrackingDictionary(), resourceLock ?? new ChangeTrackingDictionary(), storageAccount ?? new ChangeTrackingDictionary(), udr ?? new ChangeTrackingDictionary(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.cs index d35c33788d318..464e4d55b3a06 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.cs @@ -54,6 +54,7 @@ public MachineLearningWorkspaceDiagnoseProperties() KeyVault = new ChangeTrackingDictionary(); Nsg = new ChangeTrackingDictionary(); Others = new ChangeTrackingDictionary(); + RequiredResourceProviders = new ChangeTrackingDictionary(); ResourceLock = new ChangeTrackingDictionary(); StorageAccount = new ChangeTrackingDictionary(); Udr = new ChangeTrackingDictionary(); @@ -66,11 +67,12 @@ public MachineLearningWorkspaceDiagnoseProperties() /// Setting for diagnosing dependent key vault. /// Setting for diagnosing network security group. /// Setting for diagnosing unclassified category of problems. + /// Setting for diagnosing the presence of required resource providers in the workspace. /// Setting for diagnosing resource lock. /// Setting for diagnosing dependent storage account. /// Setting for diagnosing user defined routing. /// Keeps track of any properties unknown to the library. - internal MachineLearningWorkspaceDiagnoseProperties(IDictionary applicationInsights, IDictionary containerRegistry, IDictionary dnsResolution, IDictionary keyVault, IDictionary nsg, IDictionary others, IDictionary resourceLock, IDictionary storageAccount, IDictionary udr, IDictionary serializedAdditionalRawData) + internal MachineLearningWorkspaceDiagnoseProperties(IDictionary applicationInsights, IDictionary containerRegistry, IDictionary dnsResolution, IDictionary keyVault, IDictionary nsg, IDictionary others, IDictionary requiredResourceProviders, IDictionary resourceLock, IDictionary storageAccount, IDictionary udr, IDictionary serializedAdditionalRawData) { ApplicationInsights = applicationInsights; ContainerRegistry = containerRegistry; @@ -78,6 +80,7 @@ internal MachineLearningWorkspaceDiagnoseProperties(IDictionary public IDictionary Others { get; } /// + /// Setting for diagnosing the presence of required resource providers in the workspace. + /// + /// 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" }. + /// + /// + /// + /// + public IDictionary RequiredResourceProviders { get; } + /// /// Setting for diagnosing resource lock /// /// To assign an object to the value of this property use . diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.Serialization.cs index 09106307cb581..bad217ca2fa1f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.Serialization.cs @@ -51,6 +51,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); + if (Optional.IsDefined(AllowRoleAssignmentOnRG)) + { + writer.WritePropertyName("allowRoleAssignmentOnRG"u8); + writer.WriteBooleanValue(AllowRoleAssignmentOnRG.Value); + } if (Optional.IsDefined(ApplicationInsights)) { writer.WritePropertyName("applicationInsights"u8); @@ -71,6 +76,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("enableDataIsolation"u8); writer.WriteBooleanValue(EnableDataIsolation.Value); } + if (Optional.IsDefined(EnableSoftwareBillOfMaterials)) + { + writer.WritePropertyName("enableSoftwareBillOfMaterials"u8); + writer.WriteBooleanValue(EnableSoftwareBillOfMaterials.Value); + } if (Optional.IsDefined(Encryption)) { writer.WritePropertyName("encryption"u8); @@ -91,6 +101,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("imageBuildCompute"u8); writer.WriteStringValue(ImageBuildCompute); } + if (Optional.IsCollectionDefined(IPAllowlist)) + { + writer.WritePropertyName("ipAllowlist"u8); + writer.WriteStartArray(); + foreach (var item in IPAllowlist) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(ManagedNetwork)) { writer.WritePropertyName("managedNetwork"u8); @@ -106,6 +126,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("publicNetworkAccess"u8); writer.WriteStringValue(PublicNetworkAccessType.Value.ToString()); } + if (Optional.IsDefined(ServerlessComputeSettings)) + { + writer.WritePropertyName("serverlessComputeSettings"u8); + writer.WriteObjectValue(ServerlessComputeSettings, options); + } if (Optional.IsDefined(ServiceManagedResourcesSettings)) { writer.WritePropertyName("serviceManagedResourcesSettings"u8); @@ -163,17 +188,21 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac ManagedServiceIdentity identity = default; MachineLearningSku sku = default; IDictionary tags = default; + bool? allowRoleAssignmentOnRG = default; string applicationInsights = default; string containerRegistry = default; string description = default; bool? enableDataIsolation = default; + bool? enableSoftwareBillOfMaterials = default; EncryptionUpdateProperties encryption = default; FeatureStoreSettings featureStoreSettings = default; string friendlyName = default; string imageBuildCompute = default; + IList ipAllowlist = default; ManagedNetworkSettings managedNetwork = default; string primaryUserAssignedIdentity = default; MachineLearningPublicNetworkAccessType? publicNetworkAccess = default; + ServerlessComputeSettings serverlessComputeSettings = default; ServiceManagedResourcesSettings serviceManagedResourcesSettings = default; int? softDeleteRetentionInDays = default; bool? v1LegacyMode = default; @@ -223,6 +252,15 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac } foreach (var property0 in property.Value.EnumerateObject()) { + if (property0.NameEquals("allowRoleAssignmentOnRG"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowRoleAssignmentOnRG = property0.Value.GetBoolean(); + continue; + } if (property0.NameEquals("applicationInsights"u8)) { applicationInsights = property0.Value.GetString(); @@ -247,6 +285,15 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac enableDataIsolation = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("enableSoftwareBillOfMaterials"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableSoftwareBillOfMaterials = property0.Value.GetBoolean(); + continue; + } if (property0.NameEquals("encryption"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -275,6 +322,20 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac imageBuildCompute = property0.Value.GetString(); continue; } + if (property0.NameEquals("ipAllowlist"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAllowlist = array; + continue; + } if (property0.NameEquals("managedNetwork"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -298,6 +359,15 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac publicNetworkAccess = new MachineLearningPublicNetworkAccessType(property0.Value.GetString()); continue; } + if (property0.NameEquals("serverlessComputeSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverlessComputeSettings = ServerlessComputeSettings.DeserializeServerlessComputeSettings(property0.Value, options); + continue; + } if (property0.NameEquals("serviceManagedResourcesSettings"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -338,17 +408,21 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac identity, sku, tags ?? new ChangeTrackingDictionary(), + allowRoleAssignmentOnRG, applicationInsights, containerRegistry, description, enableDataIsolation, + enableSoftwareBillOfMaterials, encryption, featureStoreSettings, friendlyName, imageBuildCompute, + ipAllowlist ?? new ChangeTrackingList(), managedNetwork, primaryUserAssignedIdentity, publicNetworkAccess, + serverlessComputeSettings, serviceManagedResourcesSettings, softDeleteRetentionInDays, v1LegacyMode, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.cs index ac49c6c97791c..98a25d81437c4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.cs @@ -50,43 +50,52 @@ public partial class MachineLearningWorkspacePatch public MachineLearningWorkspacePatch() { Tags = new ChangeTrackingDictionary(); + IPAllowlist = new ChangeTrackingList(); } /// Initializes a new instance of . /// Managed service identity (system assigned and/or user assigned identities). /// Optional. This field is required to be implemented by the RP because AML is supporting more than one tier. /// The resource tags for the machine learning workspace. + /// /// ARM id of the application insights associated with this workspace. /// ARM id of the container registry associated with this workspace. /// The description of this workspace. /// + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. /// /// Settings for feature store type workspace. /// The friendly name for this workspace. This name in mutable. /// The compute name for image build. + /// The list of IPv4 addresses that are allowed to access the workspace. /// Managed Network settings for a machine learning workspace. /// The user assigned identity resource id that represents the workspace identity. /// Whether requests from Public Network are allowed. + /// Settings for serverless compute in a workspace. /// The service managed resource settings. /// Retention time in days after workspace get soft deleted. /// Enabling v1_legacy_mode may prevent you from using features provided by the v2 API. /// Keeps track of any properties unknown to the library. - internal MachineLearningWorkspacePatch(ManagedServiceIdentity identity, MachineLearningSku sku, IDictionary tags, string applicationInsights, string containerRegistry, string description, bool? enableDataIsolation, EncryptionUpdateProperties encryption, FeatureStoreSettings featureStoreSettings, string friendlyName, string imageBuildCompute, ManagedNetworkSettings managedNetwork, string primaryUserAssignedIdentity, MachineLearningPublicNetworkAccessType? publicNetworkAccessType, ServiceManagedResourcesSettings serviceManagedResourcesSettings, int? softDeleteRetentionInDays, bool? v1LegacyMode, IDictionary serializedAdditionalRawData) + internal MachineLearningWorkspacePatch(ManagedServiceIdentity identity, MachineLearningSku sku, IDictionary tags, bool? allowRoleAssignmentOnRG, string applicationInsights, string containerRegistry, string description, bool? enableDataIsolation, bool? enableSoftwareBillOfMaterials, EncryptionUpdateProperties encryption, FeatureStoreSettings featureStoreSettings, string friendlyName, string imageBuildCompute, IList ipAllowlist, ManagedNetworkSettings managedNetwork, string primaryUserAssignedIdentity, MachineLearningPublicNetworkAccessType? publicNetworkAccessType, ServerlessComputeSettings serverlessComputeSettings, ServiceManagedResourcesSettings serviceManagedResourcesSettings, int? softDeleteRetentionInDays, bool? v1LegacyMode, IDictionary serializedAdditionalRawData) { Identity = identity; Sku = sku; Tags = tags; + AllowRoleAssignmentOnRG = allowRoleAssignmentOnRG; ApplicationInsights = applicationInsights; ContainerRegistry = containerRegistry; Description = description; EnableDataIsolation = enableDataIsolation; + EnableSoftwareBillOfMaterials = enableSoftwareBillOfMaterials; Encryption = encryption; FeatureStoreSettings = featureStoreSettings; FriendlyName = friendlyName; ImageBuildCompute = imageBuildCompute; + IPAllowlist = ipAllowlist; ManagedNetwork = managedNetwork; PrimaryUserAssignedIdentity = primaryUserAssignedIdentity; PublicNetworkAccessType = publicNetworkAccessType; + ServerlessComputeSettings = serverlessComputeSettings; ServiceManagedResourcesSettings = serviceManagedResourcesSettings; SoftDeleteRetentionInDays = softDeleteRetentionInDays; V1LegacyMode = v1LegacyMode; @@ -99,6 +108,8 @@ internal MachineLearningWorkspacePatch(ManagedServiceIdentity identity, MachineL public MachineLearningSku Sku { get; set; } /// The resource tags for the machine learning workspace. public IDictionary Tags { get; } + /// Gets or sets the allow role assignment on rg. + public bool? AllowRoleAssignmentOnRG { get; set; } /// ARM id of the application insights associated with this workspace. public string ApplicationInsights { get; set; } /// ARM id of the container registry associated with this workspace. @@ -107,6 +118,8 @@ internal MachineLearningWorkspacePatch(ManagedServiceIdentity identity, MachineL public string Description { get; set; } /// Gets or sets the enable data isolation. public bool? EnableDataIsolation { get; set; } + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. + public bool? EnableSoftwareBillOfMaterials { get; set; } /// Gets or sets the encryption. internal EncryptionUpdateProperties Encryption { get; set; } /// Gets or sets the key identifier. @@ -122,12 +135,16 @@ public string KeyIdentifier public string FriendlyName { get; set; } /// The compute name for image build. public string ImageBuildCompute { get; set; } + /// The list of IPv4 addresses that are allowed to access the workspace. + public IList IPAllowlist { get; } /// Managed Network settings for a machine learning workspace. public ManagedNetworkSettings ManagedNetwork { get; set; } /// The user assigned identity resource id that represents the workspace identity. public string PrimaryUserAssignedIdentity { get; set; } /// Whether requests from Public Network are allowed. public MachineLearningPublicNetworkAccessType? PublicNetworkAccessType { get; set; } + /// Settings for serverless compute in a workspace. + public ServerlessComputeSettings ServerlessComputeSettings { get; set; } /// The service managed resource settings. internal ServiceManagedResourcesSettings ServiceManagedResourcesSettings { get; set; } /// Gets or sets the cosmos db collections throughput. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedComputeIdentity.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedComputeIdentity.cs index bf9c7517553b2..75ea8e2ab6802 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedComputeIdentity.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedComputeIdentity.cs @@ -21,16 +21,16 @@ public ManagedComputeIdentity() } /// Initializes a new instance of . - /// [Required] Monitor compute identity type enum. + /// [Required] Specifies the type of identity to use within the monitoring jobs. /// Keeps track of any properties unknown to the library. - /// Managed service identity (system assigned and/or user assigned identities). + /// The identity which will be leveraged by the monitoring jobs. internal ManagedComputeIdentity(MonitorComputeIdentityType computeIdentityType, IDictionary serializedAdditionalRawData, ManagedServiceIdentity identity) : base(computeIdentityType, serializedAdditionalRawData) { Identity = identity; ComputeIdentityType = computeIdentityType; } - /// Managed service identity (system assigned and/or user assigned identities). + /// The identity which will be leveraged by the monitoring jobs. public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.Serialization.cs new file mode 100644 index 0000000000000..98e898af65f2d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.Serialization.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ManagedIdentityCredential : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedIdentityCredential)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ManagedIdentityType)) + { + if (ManagedIdentityType != null) + { + writer.WritePropertyName("managedIdentityType"u8); + writer.WriteStringValue(ManagedIdentityType); + } + else + { + writer.WriteNull("managedIdentityType"); + } + } + if (Optional.IsDefined(UserManagedIdentityClientId)) + { + if (UserManagedIdentityClientId != null) + { + writer.WritePropertyName("userManagedIdentityClientId"u8); + writer.WriteStringValue(UserManagedIdentityClientId); + } + else + { + writer.WriteNull("userManagedIdentityClientId"); + } + } + if (Optional.IsDefined(UserManagedIdentityPrincipalId)) + { + if (UserManagedIdentityPrincipalId != null) + { + writer.WritePropertyName("userManagedIdentityPrincipalId"u8); + writer.WriteStringValue(UserManagedIdentityPrincipalId); + } + else + { + writer.WriteNull("userManagedIdentityPrincipalId"); + } + } + if (Optional.IsDefined(UserManagedIdentityResourceId)) + { + if (UserManagedIdentityResourceId != null) + { + writer.WritePropertyName("userManagedIdentityResourceId"u8); + writer.WriteStringValue(UserManagedIdentityResourceId); + } + else + { + writer.WriteNull("userManagedIdentityResourceId"); + } + } + if (Optional.IsDefined(UserManagedIdentityTenantId)) + { + if (UserManagedIdentityTenantId != null) + { + writer.WritePropertyName("userManagedIdentityTenantId"u8); + writer.WriteStringValue(UserManagedIdentityTenantId); + } + else + { + writer.WriteNull("userManagedIdentityTenantId"); + } + } + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedIdentityCredential 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(ManagedIdentityCredential)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedIdentityCredential(document.RootElement, options); + } + + internal static ManagedIdentityCredential DeserializeManagedIdentityCredential(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string managedIdentityType = default; + string userManagedIdentityClientId = default; + string userManagedIdentityPrincipalId = default; + string userManagedIdentityResourceId = default; + string userManagedIdentityTenantId = default; + DataReferenceCredentialType credentialType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("managedIdentityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + managedIdentityType = null; + continue; + } + managedIdentityType = property.Value.GetString(); + continue; + } + if (property.NameEquals("userManagedIdentityClientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userManagedIdentityClientId = null; + continue; + } + userManagedIdentityClientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("userManagedIdentityPrincipalId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userManagedIdentityPrincipalId = null; + continue; + } + userManagedIdentityPrincipalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("userManagedIdentityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userManagedIdentityResourceId = null; + continue; + } + userManagedIdentityResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("userManagedIdentityTenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userManagedIdentityTenantId = null; + continue; + } + userManagedIdentityTenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("credentialType"u8)) + { + credentialType = new DataReferenceCredentialType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedIdentityCredential( + credentialType, + serializedAdditionalRawData, + managedIdentityType, + userManagedIdentityClientId, + userManagedIdentityPrincipalId, + userManagedIdentityResourceId, + userManagedIdentityTenantId); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedIdentityCredential)} does not support writing '{options.Format}' format."); + } + } + + ManagedIdentityCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedIdentityCredential(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedIdentityCredential)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.cs new file mode 100644 index 0000000000000..555a30e411cc1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Credential for user managed identity. + public partial class ManagedIdentityCredential : DataReferenceCredential + { + /// Initializes a new instance of . + internal ManagedIdentityCredential() + { + CredentialType = DataReferenceCredentialType.ManagedIdentity; + } + + /// Initializes a new instance of . + /// [Required] Credential type used to authentication with storage. + /// Keeps track of any properties unknown to the library. + /// ManagedIdentityCredential identity type. + /// ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. + /// TenantId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + internal ManagedIdentityCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData, string managedIdentityType, string userManagedIdentityClientId, string userManagedIdentityPrincipalId, string userManagedIdentityResourceId, string userManagedIdentityTenantId) : base(credentialType, serializedAdditionalRawData) + { + ManagedIdentityType = managedIdentityType; + UserManagedIdentityClientId = userManagedIdentityClientId; + UserManagedIdentityPrincipalId = userManagedIdentityPrincipalId; + UserManagedIdentityResourceId = userManagedIdentityResourceId; + UserManagedIdentityTenantId = userManagedIdentityTenantId; + CredentialType = credentialType; + } + + /// ManagedIdentityCredential identity type. + public string ManagedIdentityType { get; } + /// ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + public string UserManagedIdentityClientId { get; } + /// PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + public string UserManagedIdentityPrincipalId { get; } + /// Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. + public string UserManagedIdentityResourceId { get; } + /// TenantId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + public string UserManagedIdentityTenantId { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.Serialization.cs index 5f6dbcba59008..2c63996e8dfdd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.Serialization.cs @@ -59,6 +59,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WritePropertyName("status"u8); writer.WriteObjectValue(Status, options); } + if (options.Format != "W" && Optional.IsCollectionDefined(ChangeableIsolationModes)) + { + writer.WritePropertyName("changeableIsolationModes"u8); + writer.WriteStartArray(); + foreach (var item in ChangeableIsolationModes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,6 +111,7 @@ internal static ManagedNetworkSettings DeserializeManagedNetworkSettings(JsonEle string networkId = default; IDictionary outboundRules = default; ManagedNetworkProvisionStatus status = default; + IReadOnlyList changeableIsolationModes = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -143,13 +154,33 @@ internal static ManagedNetworkSettings DeserializeManagedNetworkSettings(JsonEle status = ManagedNetworkProvisionStatus.DeserializeManagedNetworkProvisionStatus(property.Value, options); continue; } + if (property.NameEquals("changeableIsolationModes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new IsolationMode(item.GetString())); + } + changeableIsolationModes = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedNetworkSettings(isolationMode, networkId, outboundRules ?? new ChangeTrackingDictionary(), status, serializedAdditionalRawData); + return new ManagedNetworkSettings( + isolationMode, + networkId, + outboundRules ?? new ChangeTrackingDictionary(), + status, + changeableIsolationModes ?? new ChangeTrackingList(), + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.cs index 57c04e669be17..6a50509cb982e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.cs @@ -49,6 +49,7 @@ public partial class ManagedNetworkSettings public ManagedNetworkSettings() { OutboundRules = new ChangeTrackingDictionary(); + ChangeableIsolationModes = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -60,13 +61,15 @@ public ManagedNetworkSettings() /// The available derived classes include , and . /// /// Status of the Provisioning for the managed network of a machine learning workspace. + /// /// Keeps track of any properties unknown to the library. - internal ManagedNetworkSettings(IsolationMode? isolationMode, string networkId, IDictionary outboundRules, ManagedNetworkProvisionStatus status, IDictionary serializedAdditionalRawData) + internal ManagedNetworkSettings(IsolationMode? isolationMode, string networkId, IDictionary outboundRules, ManagedNetworkProvisionStatus status, IReadOnlyList changeableIsolationModes, IDictionary serializedAdditionalRawData) { IsolationMode = isolationMode; NetworkId = networkId; OutboundRules = outboundRules; Status = status; + ChangeableIsolationModes = changeableIsolationModes; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,5 +85,7 @@ internal ManagedNetworkSettings(IsolationMode? isolationMode, string networkId, public IDictionary OutboundRules { get; set; } /// Status of the Provisioning for the managed network of a machine learning workspace. public ManagedNetworkProvisionStatus Status { get; set; } + /// Gets the changeable isolation modes. + public IReadOnlyList ChangeableIsolationModes { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..0618aa7bc1e41 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.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.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ManagedOnlineEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnlineEndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(EndpointComputeType)) + { + writer.WritePropertyName("endpointComputeType"u8); + writer.WriteStringValue(EndpointComputeType.Value.ToString()); + } + if (Optional.IsDefined(Model)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(Model); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedOnlineEndpointDeploymentResourceProperties 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(ManagedOnlineEndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedOnlineEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static ManagedOnlineEndpointDeploymentResourceProperties DeserializeManagedOnlineEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MachineLearningEndpointComputeType? endpointComputeType = default; + string model = default; + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpointComputeType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointComputeType = new MachineLearningEndpointComputeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedOnlineEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + type, + serializedAdditionalRawData, + endpointComputeType, + model); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedOnlineEndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ManagedOnlineEndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedOnlineEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedOnlineEndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.cs new file mode 100644 index 0000000000000..44f2699f74f92 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ManagedOnlineEndpointDeploymentResourceProperties. + public partial class ManagedOnlineEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + public ManagedOnlineEndpointDeploymentResourceProperties() + { + EndpointDeploymentResourcePropertiesType = "managedOnlineEndpoint"; + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + /// Enum to determine endpoint compute type. + /// + internal ManagedOnlineEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData, MachineLearningEndpointComputeType? endpointComputeType, string model) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + EndpointComputeType = endpointComputeType; + Model = model; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "managedOnlineEndpoint"; + } + + /// Enum to determine endpoint compute type. + public MachineLearningEndpointComputeType? EndpointComputeType { get; set; } + /// Gets or sets the model. + public string Model { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..630b2660c608f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.Serialization.cs @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ManagedOnlineEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnlineEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AuthMode)) + { + writer.WritePropertyName("authMode"u8); + writer.WriteStringValue(AuthMode.Value.ToString()); + } + if (Optional.IsDefined(Compute)) + { + writer.WritePropertyName("compute"u8); + writer.WriteStringValue(Compute); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsCollectionDefined(MirrorTraffic)) + { + writer.WritePropertyName("mirrorTraffic"u8); + writer.WriteStartObject(); + foreach (var item in MirrorTraffic) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(ScoringUri)) + { + writer.WritePropertyName("scoringUri"u8); + writer.WriteStringValue(ScoringUri.AbsoluteUri); + } + if (Optional.IsCollectionDefined(Traffic)) + { + writer.WritePropertyName("traffic"u8); + writer.WriteStartObject(); + foreach (var item in Traffic) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedOnlineEndpointResourceProperties 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(ManagedOnlineEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedOnlineEndpointResourceProperties(document.RootElement, options); + } + + internal static ManagedOnlineEndpointResourceProperties DeserializeManagedOnlineEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MachineLearningEndpointAuthMode? authMode = default; + string compute = default; + string description = default; + IDictionary mirrorTraffic = default; + Uri scoringUri = default; + IDictionary traffic = default; + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new MachineLearningEndpointAuthMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("compute"u8)) + { + compute = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("mirrorTraffic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetInt32()); + } + mirrorTraffic = dictionary; + continue; + } + if (property.NameEquals("scoringUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scoringUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("traffic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetInt32()); + } + traffic = dictionary; + continue; + } + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedOnlineEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData, + authMode, + compute, + description, + mirrorTraffic ?? new ChangeTrackingDictionary(), + scoringUri, + traffic ?? new ChangeTrackingDictionary()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedOnlineEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ManagedOnlineEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedOnlineEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedOnlineEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.cs new file mode 100644 index 0000000000000..c88617aa3005a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ManagedOnlineEndpointResourceProperties. + public partial class ManagedOnlineEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public ManagedOnlineEndpointResourceProperties() + { + MirrorTraffic = new ChangeTrackingDictionary(); + Traffic = new ChangeTrackingDictionary(); + EndpointType = EndpointType.ManagedOnlineEndpoint; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + /// Enum to determine endpoint authentication mode. + /// + /// + /// Dictionary of <integer>. + /// + /// Dictionary of <integer>. + internal ManagedOnlineEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData, MachineLearningEndpointAuthMode? authMode, string compute, string description, IDictionary mirrorTraffic, Uri scoringUri, IDictionary traffic) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + AuthMode = authMode; + Compute = compute; + Description = description; + MirrorTraffic = mirrorTraffic; + ScoringUri = scoringUri; + Traffic = traffic; + EndpointType = endpointType; + } + + /// Enum to determine endpoint authentication mode. + public MachineLearningEndpointAuthMode? AuthMode { get; set; } + /// Gets or sets the compute. + public string Compute { get; set; } + /// Gets or sets the description. + public string Description { get; set; } + /// Dictionary of <integer>. + public IDictionary MirrorTraffic { get; } + /// Gets or sets the scoring uri. + public Uri ScoringUri { get; set; } + /// Dictionary of <integer>. + public IDictionary Traffic { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPERequirement.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPERequirement.cs new file mode 100644 index 0000000000000..bef855e02febb --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPERequirement.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ManagedPERequirement. + public readonly partial struct ManagedPERequirement : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedPERequirement(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RequiredValue = "Required"; + private const string NotRequiredValue = "NotRequired"; + private const string NotApplicableValue = "NotApplicable"; + + /// Required. + public static ManagedPERequirement Required { get; } = new ManagedPERequirement(RequiredValue); + /// NotRequired. + public static ManagedPERequirement NotRequired { get; } = new ManagedPERequirement(NotRequiredValue); + /// NotApplicable. + public static ManagedPERequirement NotApplicable { get; } = new ManagedPERequirement(NotApplicableValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedPERequirement left, ManagedPERequirement right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedPERequirement left, ManagedPERequirement right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ManagedPERequirement(string value) => new ManagedPERequirement(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedPERequirement other && Equals(other); + /// + public bool Equals(ManagedPERequirement 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPEStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPEStatus.cs new file mode 100644 index 0000000000000..0f093ab17e784 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPEStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ManagedPEStatus. + public readonly partial struct ManagedPEStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedPEStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InactiveValue = "Inactive"; + private const string ActiveValue = "Active"; + private const string NotApplicableValue = "NotApplicable"; + + /// Inactive. + public static ManagedPEStatus Inactive { get; } = new ManagedPEStatus(InactiveValue); + /// Active. + public static ManagedPEStatus Active { get; } = new ManagedPEStatus(ActiveValue); + /// NotApplicable. + public static ManagedPEStatus NotApplicable { get; } = new ManagedPEStatus(NotApplicableValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedPEStatus left, ManagedPEStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedPEStatus left, ManagedPEStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ManagedPEStatus(string value) => new ManagedPEStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedPEStatus other && Equals(other); + /// + public bool Equals(ManagedPEStatus 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.Serialization.cs similarity index 55% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.Serialization.cs index 319bc38d8b8a6..dca7b304c2e6d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.Serialization.cs @@ -13,32 +13,23 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class GenerationSafetyQualityMetricThreshold : IUtf8JsonSerializable, IJsonModel + public partial class ManagedResourceGroupAssignedIdentities : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GenerationSafetyQualityMetricThreshold)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ManagedResourceGroupAssignedIdentities)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("metric"u8); - writer.WriteStringValue(Metric.ToString()); - if (Optional.IsDefined(Threshold)) + if (options.Format != "W" && Optional.IsDefined(PrincipalId)) { - if (Threshold != null) - { - writer.WritePropertyName("threshold"u8); - writer.WriteObjectValue(Threshold, options); - } - else - { - writer.WriteNull("threshold"); - } + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -58,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WriteEndObject(); } - GenerationSafetyQualityMetricThreshold IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ManagedResourceGroupAssignedIdentities IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GenerationSafetyQualityMetricThreshold)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ManagedResourceGroupAssignedIdentities)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGenerationSafetyQualityMetricThreshold(document.RootElement, options); + return DeserializeManagedResourceGroupAssignedIdentities(document.RootElement, options); } - internal static GenerationSafetyQualityMetricThreshold DeserializeGenerationSafetyQualityMetricThreshold(JsonElement element, ModelReaderWriterOptions options = null) + internal static ManagedResourceGroupAssignedIdentities DeserializeManagedResourceGroupAssignedIdentities(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +69,18 @@ internal static GenerationSafetyQualityMetricThreshold DeserializeGenerationSafe { return null; } - GenerationSafetyQualityMetric metric = default; - MonitoringThreshold threshold = default; + Guid? principalId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("metric"u8)) - { - metric = new GenerationSafetyQualityMetric(property.Value.GetString()); - continue; - } - if (property.NameEquals("threshold"u8)) + if (property.NameEquals("principalId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - threshold = null; continue; } - threshold = MonitoringThreshold.DeserializeMonitoringThreshold(property.Value, options); + principalId = property.Value.GetGuid(); continue; } if (options.Format != "W") @@ -105,38 +89,38 @@ internal static GenerationSafetyQualityMetricThreshold DeserializeGenerationSafe } } serializedAdditionalRawData = rawDataDictionary; - return new GenerationSafetyQualityMetricThreshold(metric, threshold, serializedAdditionalRawData); + return new ManagedResourceGroupAssignedIdentities(principalId, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(GenerationSafetyQualityMetricThreshold)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedResourceGroupAssignedIdentities)} does not support writing '{options.Format}' format."); } } - GenerationSafetyQualityMetricThreshold IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ManagedResourceGroupAssignedIdentities IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGenerationSafetyQualityMetricThreshold(document.RootElement, options); + return DeserializeManagedResourceGroupAssignedIdentities(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(GenerationSafetyQualityMetricThreshold)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedResourceGroupAssignedIdentities)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs similarity index 69% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelConfiguration.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs index 3b97a28d24e30..1fd6356f43f09 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Model configuration options. - public partial class ModelConfiguration + /// Details for managed resource group assigned identities. + public partial class ManagedResourceGroupAssignedIdentities { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,21 @@ public partial class ModelConfiguration /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ModelConfiguration() + /// Initializes a new instance of . + public ManagedResourceGroupAssignedIdentities() { } - /// Initializes a new instance of . - /// Input delivery mode for the model. - /// Relative mounting path of the model in the target image. + /// Initializes a new instance of . + /// Identity principal Id. /// Keeps track of any properties unknown to the library. - internal ModelConfiguration(PackageInputDeliveryMode? mode, string mountPath, IDictionary serializedAdditionalRawData) + internal ManagedResourceGroupAssignedIdentities(Guid? principalId, IDictionary serializedAdditionalRawData) { - Mode = mode; - MountPath = mountPath; + PrincipalId = principalId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Input delivery mode for the model. - public PackageInputDeliveryMode? Mode { get; set; } - /// Relative mounting path of the model in the target image. - public string MountPath { get; set; } + /// Identity principal Id. + public Guid? PrincipalId { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.Serialization.cs new file mode 100644 index 0000000000000..e5329dc0a8988 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class ManagedResourceGroupSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedResourceGroupSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AssignedIdentities)) + { + if (AssignedIdentities != null) + { + writer.WritePropertyName("assignedIdentities"u8); + writer.WriteStartArray(); + foreach (var item in AssignedIdentities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("assignedIdentities"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedResourceGroupSettings 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(ManagedResourceGroupSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedResourceGroupSettings(document.RootElement, options); + } + + internal static ManagedResourceGroupSettings DeserializeManagedResourceGroupSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList assignedIdentities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + assignedIdentities = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ManagedResourceGroupAssignedIdentities.DeserializeManagedResourceGroupAssignedIdentities(item, options)); + } + assignedIdentities = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedResourceGroupSettings(assignedIdentities ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedResourceGroupSettings)} does not support writing '{options.Format}' format."); + } + } + + ManagedResourceGroupSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedResourceGroupSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedResourceGroupSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringDataSegment.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs similarity index 68% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringDataSegment.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs index 427462ba78951..1bc7eb5ea3c0c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringDataSegment.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// The MonitoringDataSegment. - public partial class MonitoringDataSegment + /// Managed resource group settings. + internal partial class ManagedResourceGroupSettings { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,22 @@ public partial class MonitoringDataSegment /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public MonitoringDataSegment() + /// Initializes a new instance of . + public ManagedResourceGroupSettings() { - Values = new ChangeTrackingList(); + AssignedIdentities = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The feature to segment the data on. - /// Filters for only the specified values of the given segmented feature. + /// Initializes a new instance of . + /// List of assigned identities for the managed resource group. /// Keeps track of any properties unknown to the library. - internal MonitoringDataSegment(string feature, IList values, IDictionary serializedAdditionalRawData) + internal ManagedResourceGroupSettings(IList assignedIdentities, IDictionary serializedAdditionalRawData) { - Feature = feature; - Values = values; + AssignedIdentities = assignedIdentities; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The feature to segment the data on. - public string Feature { get; set; } - /// Filters for only the specified values of the given segmented feature. - public IList Values { get; set; } + /// List of assigned identities for the managed resource group. + public IList AssignedIdentities { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelClass.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs similarity index 50% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelClass.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs index 422d4d91cd12b..d671d47cef500 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelClass.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs @@ -13,47 +13,53 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class LabelClass : IUtf8JsonSerializable, IJsonModel + public partial class MarketplacePlan : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelClass)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MarketplacePlan)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(DisplayName)) + if (options.Format != "W" && Optional.IsDefined(OfferId)) { - if (DisplayName != null) + if (OfferId != null) { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); + writer.WritePropertyName("offerId"u8); + writer.WriteStringValue(OfferId); } else { - writer.WriteNull("displayName"); + writer.WriteNull("offerId"); } } - if (Optional.IsCollectionDefined(Subclasses)) + if (options.Format != "W" && Optional.IsDefined(PlanId)) { - if (Subclasses != null) + if (PlanId != null) { - writer.WritePropertyName("subclasses"u8); - writer.WriteStartObject(); - foreach (var item in Subclasses) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); + writer.WritePropertyName("planId"u8); + writer.WriteStringValue(PlanId); + } + else + { + writer.WriteNull("planId"); + } + } + if (options.Format != "W" && Optional.IsDefined(PublisherId)) + { + if (PublisherId != null) + { + writer.WritePropertyName("publisherId"u8); + writer.WriteStringValue(PublisherId); } else { - writer.WriteNull("subclasses"); + writer.WriteNull("publisherId"); } } if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -74,19 +80,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption writer.WriteEndObject(); } - LabelClass IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MarketplacePlan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelClass)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MarketplacePlan)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelClass(document.RootElement, options); + return DeserializeMarketplacePlan(document.RootElement, options); } - internal static LabelClass DeserializeLabelClass(JsonElement element, ModelReaderWriterOptions options = null) + internal static MarketplacePlan DeserializeMarketplacePlan(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -94,35 +100,41 @@ internal static LabelClass DeserializeLabelClass(JsonElement element, ModelReade { return null; } - string displayName = default; - IDictionary subclasses = default; + string offerId = default; + string planId = default; + string publisherId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("displayName"u8)) + if (property.NameEquals("offerId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - displayName = null; + offerId = null; continue; } - displayName = property.Value.GetString(); + offerId = property.Value.GetString(); continue; } - if (property.NameEquals("subclasses"u8)) + if (property.NameEquals("planId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - subclasses = null; + planId = null; continue; } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + planId = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisherId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) { - dictionary.Add(property0.Name, DeserializeLabelClass(property0.Value, options)); + publisherId = null; + continue; } - subclasses = dictionary; + publisherId = property.Value.GetString(); continue; } if (options.Format != "W") @@ -131,38 +143,38 @@ internal static LabelClass DeserializeLabelClass(JsonElement element, ModelReade } } serializedAdditionalRawData = rawDataDictionary; - return new LabelClass(displayName, subclasses ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new MarketplacePlan(offerId, planId, publisherId, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelClass)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MarketplacePlan)} does not support writing '{options.Format}' format."); } } - LabelClass IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MarketplacePlan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelClass(document.RootElement, options); + return DeserializeMarketplacePlan(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelClass)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MarketplacePlan)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs similarity index 60% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs index ae6b6681bdc14..803ecbcd277f4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs @@ -10,12 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// - /// Labeling MLAssist configuration definition - /// 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 MachineLearningAssistConfiguration + /// The MarketplacePlan. + public partial class MarketplacePlan { /// /// Keeps track of any properties unknown to the library. @@ -47,23 +43,31 @@ public abstract partial class MachineLearningAssistConfiguration /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - protected MachineLearningAssistConfiguration() + /// Initializes a new instance of . + internal MarketplacePlan() { } - /// Initializes a new instance of . - /// [Required] Indicates whether MLAssist feature is enabled. + /// Initializes a new instance of . + /// The identifying name of the Offer of the Marketplace Plan. + /// The identifying name of the Plan of the Marketplace Plan. + /// The identifying name of the Publisher of the Marketplace Plan. /// Keeps track of any properties unknown to the library. - internal MachineLearningAssistConfiguration(MLAssistConfigurationType mlAssist, IDictionary serializedAdditionalRawData) + internal MarketplacePlan(string offerId, string planId, string publisherId, IDictionary serializedAdditionalRawData) { - MlAssist = mlAssist; + OfferId = offerId; + PlanId = planId; + PublisherId = publisherId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// [Required] Indicates whether MLAssist feature is enabled. - internal MLAssistConfigurationType MlAssist { get; set; } + /// The identifying name of the Offer of the Marketplace Plan. + public string OfferId { get; } + /// The identifying name of the Plan of the Marketplace Plan. + public string PlanId { get; } + /// The identifying name of the Publisher of the Marketplace Plan. + public string PublisherId { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.Serialization.cs new file mode 100644 index 0000000000000..605767c0f678c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class MarketplaceSubscriptionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceSubscriptionProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(MarketplacePlan)) + { + if (MarketplacePlan != null) + { + writer.WritePropertyName("marketplacePlan"u8); + writer.WriteObjectValue(MarketplacePlan, options); + } + else + { + writer.WriteNull("marketplacePlan"); + } + } + if (options.Format != "W" && Optional.IsDefined(MarketplaceSubscriptionStatus)) + { + writer.WritePropertyName("marketplaceSubscriptionStatus"u8); + writer.WriteStringValue(MarketplaceSubscriptionStatus.Value.ToString()); + } + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MarketplaceSubscriptionProperties 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(MarketplaceSubscriptionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMarketplaceSubscriptionProperties(document.RootElement, options); + } + + internal static MarketplaceSubscriptionProperties DeserializeMarketplaceSubscriptionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MarketplacePlan marketplacePlan = default; + MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default; + string modelId = default; + MarketplaceSubscriptionProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("marketplacePlan"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + marketplacePlan = null; + continue; + } + marketplacePlan = MarketplacePlan.DeserializeMarketplacePlan(property.Value, options); + continue; + } + if (property.NameEquals("marketplaceSubscriptionStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + marketplaceSubscriptionStatus = new MarketplaceSubscriptionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MarketplaceSubscriptionProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MarketplaceSubscriptionProperties(marketplacePlan, marketplaceSubscriptionStatus, modelId, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MarketplaceSubscriptionProperties)} does not support writing '{options.Format}' format."); + } + } + + MarketplaceSubscriptionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMarketplaceSubscriptionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MarketplaceSubscriptionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.cs new file mode 100644 index 0000000000000..a952a9759fcee --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.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 Azure.ResourceManager.MachineLearning.Models +{ + /// The MarketplaceSubscriptionProperties. + public partial class MarketplaceSubscriptionProperties + { + /// + /// 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 . + /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + /// is null. + public MarketplaceSubscriptionProperties(string modelId) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + + ModelId = modelId; + } + + /// Initializes a new instance of . + /// Marketplace Plan associated with the Marketplace Subscription. + /// Current status of the Marketplace Subscription. + /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + /// Provisioning State of the Marketplace Subscription. + /// Keeps track of any properties unknown to the library. + internal MarketplaceSubscriptionProperties(MarketplacePlan marketplacePlan, MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus, string modelId, MarketplaceSubscriptionProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + MarketplacePlan = marketplacePlan; + MarketplaceSubscriptionStatus = marketplaceSubscriptionStatus; + ModelId = modelId; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MarketplaceSubscriptionProperties() + { + } + + /// Marketplace Plan associated with the Marketplace Subscription. + public MarketplacePlan MarketplacePlan { get; } + /// Current status of the Marketplace Subscription. + public MarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get; } + /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + public string ModelId { get; set; } + /// Provisioning State of the Marketplace Subscription. + public MarketplaceSubscriptionProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProvisioningState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProvisioningState.cs new file mode 100644 index 0000000000000..11d5e61b8264d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProvisioningState.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 Azure.ResourceManager.MachineLearning.Models +{ + /// The MarketplaceSubscriptionProvisioningState. + public readonly partial struct MarketplaceSubscriptionProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MarketplaceSubscriptionProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatingValue = "Creating"; + private const string DeletingValue = "Deleting"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string UpdatingValue = "Updating"; + private const string CanceledValue = "Canceled"; + + /// MarketplaceSubscription is being created. + public static MarketplaceSubscriptionProvisioningState Creating { get; } = new MarketplaceSubscriptionProvisioningState(CreatingValue); + /// MarketplaceSubscription is being deleted. + public static MarketplaceSubscriptionProvisioningState Deleting { get; } = new MarketplaceSubscriptionProvisioningState(DeletingValue); + /// MarketplaceSubscription is successfully provisioned. + public static MarketplaceSubscriptionProvisioningState Succeeded { get; } = new MarketplaceSubscriptionProvisioningState(SucceededValue); + /// MarketplaceSubscription provisioning failed. + public static MarketplaceSubscriptionProvisioningState Failed { get; } = new MarketplaceSubscriptionProvisioningState(FailedValue); + /// MarketplaceSubscription is being updated. + public static MarketplaceSubscriptionProvisioningState Updating { get; } = new MarketplaceSubscriptionProvisioningState(UpdatingValue); + /// Canceled. + public static MarketplaceSubscriptionProvisioningState Canceled { get; } = new MarketplaceSubscriptionProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(MarketplaceSubscriptionProvisioningState left, MarketplaceSubscriptionProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MarketplaceSubscriptionProvisioningState left, MarketplaceSubscriptionProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MarketplaceSubscriptionProvisioningState(string value) => new MarketplaceSubscriptionProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MarketplaceSubscriptionProvisioningState other && Equals(other); + /// + public bool Equals(MarketplaceSubscriptionProvisioningState 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.Serialization.cs similarity index 58% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobResourceArmPaginatedResult.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.Serialization.cs index 15907f39a48d8..14a5efb3f6ae9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobResourceArmPaginatedResult.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class LabelingJobResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + internal partial class MarketplaceSubscriptionResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobResourceArmPaginatedResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionResourceArmPaginatedResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -59,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteEndObject(); } - LabelingJobResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MarketplaceSubscriptionResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobResourceArmPaginatedResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionResourceArmPaginatedResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobResourceArmPaginatedResult(document.RootElement, options); + return DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(document.RootElement, options); } - internal static LabelingJobResourceArmPaginatedResult DeserializeLabelingJobResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static MarketplaceSubscriptionResourceArmPaginatedResult DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -80,7 +80,7 @@ internal static LabelingJobResourceArmPaginatedResult DeserializeLabelingJobReso return null; } string nextLink = default; - IReadOnlyList value = default; + IReadOnlyList value = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -96,10 +96,10 @@ internal static LabelingJobResourceArmPaginatedResult DeserializeLabelingJobReso { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(item, options)); + array.Add(MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(item, options)); } value = array; continue; @@ -110,38 +110,38 @@ internal static LabelingJobResourceArmPaginatedResult DeserializeLabelingJobReso } } serializedAdditionalRawData = rawDataDictionary; - return new LabelingJobResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new MarketplaceSubscriptionResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingJobResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); } } - LabelingJobResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MarketplaceSubscriptionResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobResourceArmPaginatedResult(document.RootElement, options); + return DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingJobResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.cs new file mode 100644 index 0000000000000..02e7b285f352d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// A paginated list of MarketplaceSubscription entities. + internal partial class MarketplaceSubscriptionResourceArmPaginatedResult + { + /// + /// 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 MarketplaceSubscriptionResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The link to the next page of MarketplaceSubscription objects. If null, there are no additional pages. + /// An array of objects of type MarketplaceSubscription. + /// Keeps track of any properties unknown to the library. + internal MarketplaceSubscriptionResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The link to the next page of MarketplaceSubscription objects. If null, there are no additional pages. + public string NextLink { get; } + /// An array of objects of type MarketplaceSubscription. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionStatus.cs new file mode 100644 index 0000000000000..58a3644401738 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionStatus.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The MarketplaceSubscriptionStatus. + public readonly partial struct MarketplaceSubscriptionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MarketplaceSubscriptionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SubscribedValue = "Subscribed"; + private const string SuspendedValue = "Suspended"; + private const string UnsubscribedValue = "Unsubscribed"; + + /// + /// The customer can now use the Marketplace Subscription's + /// model and will be billed. + /// + public static MarketplaceSubscriptionStatus Subscribed { get; } = new MarketplaceSubscriptionStatus(SubscribedValue); + /// + /// The customer could not be billed for the Marketplace Subscription. + /// The customer will not be able to access the model. + /// + public static MarketplaceSubscriptionStatus Suspended { get; } = new MarketplaceSubscriptionStatus(SuspendedValue); + /// + /// Marketplace Subscriptions reach this state in response to an explicit customer or CSP action. + /// A Marketplace Subscription can also be canceled implicitly, as a result of nonpayment of dues, + /// after being in the Suspended state for some time. + /// + public static MarketplaceSubscriptionStatus Unsubscribed { get; } = new MarketplaceSubscriptionStatus(UnsubscribedValue); + /// Determines if two values are the same. + public static bool operator ==(MarketplaceSubscriptionStatus left, MarketplaceSubscriptionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MarketplaceSubscriptionStatus left, MarketplaceSubscriptionStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MarketplaceSubscriptionStatus(string value) => new MarketplaceSubscriptionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MarketplaceSubscriptionStatus other && Equals(other); + /// + public bool Equals(MarketplaceSubscriptionStatus 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MaterializationComputeResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MaterializationComputeResource.cs index 433ff76d12017..a76bb655e0c75 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MaterializationComputeResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MaterializationComputeResource.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing compute resource. + /// DTO object representing compute resource. internal partial class MaterializationComputeResource { /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelLifecycleStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelLifecycleStatus.cs new file mode 100644 index 0000000000000..0b6a4651ccac4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelLifecycleStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Model lifecycle status. + public readonly partial struct ModelLifecycleStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ModelLifecycleStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string GenerallyAvailableValue = "GenerallyAvailable"; + private const string PreviewValue = "Preview"; + + /// GenerallyAvailable. + public static ModelLifecycleStatus GenerallyAvailable { get; } = new ModelLifecycleStatus(GenerallyAvailableValue); + /// Preview. + public static ModelLifecycleStatus Preview { get; } = new ModelLifecycleStatus(PreviewValue); + /// Determines if two values are the same. + public static bool operator ==(ModelLifecycleStatus left, ModelLifecycleStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ModelLifecycleStatus left, ModelLifecycleStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ModelLifecycleStatus(string value) => new ModelLifecycleStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ModelLifecycleStatus other && Equals(other); + /// + public bool Equals(ModelLifecycleStatus 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.Serialization.cs deleted file mode 100644 index 8fc503433c34a..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.Serialization.cs +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ModelPackageContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPackageContent)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(BaseEnvironmentSource)) - { - if (BaseEnvironmentSource != null) - { - writer.WritePropertyName("baseEnvironmentSource"u8); - writer.WriteObjectValue(BaseEnvironmentSource, options); - } - else - { - writer.WriteNull("baseEnvironmentSource"); - } - } - if (Optional.IsCollectionDefined(EnvironmentVariables)) - { - if (EnvironmentVariables != null) - { - writer.WritePropertyName("environmentVariables"u8); - writer.WriteStartObject(); - foreach (var item in EnvironmentVariables) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("environmentVariables"); - } - } - writer.WritePropertyName("inferencingServer"u8); - writer.WriteObjectValue(InferencingServer, options); - if (Optional.IsCollectionDefined(Inputs)) - { - if (Inputs != null) - { - writer.WritePropertyName("inputs"u8); - writer.WriteStartArray(); - foreach (var item in Inputs) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("inputs"); - } - } - if (Optional.IsDefined(ModelConfiguration)) - { - if (ModelConfiguration != null) - { - writer.WritePropertyName("modelConfiguration"u8); - writer.WriteObjectValue(ModelConfiguration, options); - } - else - { - writer.WriteNull("modelConfiguration"); - } - } - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags != null) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("tags"); - } - } - writer.WritePropertyName("targetEnvironmentId"u8); - writer.WriteStringValue(TargetEnvironmentId); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelPackageContent 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(ModelPackageContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelPackageContent(document.RootElement, options); - } - - internal static ModelPackageContent DeserializeModelPackageContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - BaseEnvironmentSource baseEnvironmentSource = default; - IDictionary environmentVariables = default; - InferencingServer inferencingServer = default; - IList inputs = default; - ModelConfiguration modelConfiguration = default; - IDictionary tags = default; - string targetEnvironmentId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("baseEnvironmentSource"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - baseEnvironmentSource = null; - continue; - } - baseEnvironmentSource = BaseEnvironmentSource.DeserializeBaseEnvironmentSource(property.Value, options); - continue; - } - if (property.NameEquals("environmentVariables"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - environmentVariables = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - environmentVariables = dictionary; - continue; - } - if (property.NameEquals("inferencingServer"u8)) - { - inferencingServer = InferencingServer.DeserializeInferencingServer(property.Value, options); - continue; - } - if (property.NameEquals("inputs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - inputs = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ModelPackageInput.DeserializeModelPackageInput(item, options)); - } - inputs = array; - continue; - } - if (property.NameEquals("modelConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - modelConfiguration = null; - continue; - } - modelConfiguration = ModelConfiguration.DeserializeModelConfiguration(property.Value, options); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tags = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("targetEnvironmentId"u8)) - { - targetEnvironmentId = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ModelPackageContent( - baseEnvironmentSource, - environmentVariables ?? new ChangeTrackingDictionary(), - inferencingServer, - inputs ?? new ChangeTrackingList(), - modelConfiguration, - tags ?? new ChangeTrackingDictionary(), - targetEnvironmentId, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ModelPackageContent)} does not support writing '{options.Format}' format."); - } - } - - ModelPackageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelPackageContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelPackageContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.cs deleted file mode 100644 index d8884a1703fcd..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Model package operation request properties. - public partial class ModelPackageContent - { - /// - /// 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 . - /// - /// [Required] Inferencing server configurations. - /// 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 . - /// - /// [Required] Arm ID of the target environment to be created by package operation. - /// or is null. - public ModelPackageContent(InferencingServer inferencingServer, string targetEnvironmentId) - { - Argument.AssertNotNull(inferencingServer, nameof(inferencingServer)); - Argument.AssertNotNull(targetEnvironmentId, nameof(targetEnvironmentId)); - - EnvironmentVariables = new ChangeTrackingDictionary(); - InferencingServer = inferencingServer; - Inputs = new ChangeTrackingList(); - Tags = new ChangeTrackingDictionary(); - TargetEnvironmentId = targetEnvironmentId; - } - - /// Initializes a new instance of . - /// - /// Base environment to start with. - /// 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 . - /// - /// Collection of environment variables. - /// - /// [Required] Inferencing server configurations. - /// 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 . - /// - /// Collection of inputs. - /// Model configuration including the mount mode. - /// Tag dictionary. Tags can be added, removed, and updated. - /// [Required] Arm ID of the target environment to be created by package operation. - /// Keeps track of any properties unknown to the library. - internal ModelPackageContent(BaseEnvironmentSource baseEnvironmentSource, IDictionary environmentVariables, InferencingServer inferencingServer, IList inputs, ModelConfiguration modelConfiguration, IDictionary tags, string targetEnvironmentId, IDictionary serializedAdditionalRawData) - { - BaseEnvironmentSource = baseEnvironmentSource; - EnvironmentVariables = environmentVariables; - InferencingServer = inferencingServer; - Inputs = inputs; - ModelConfiguration = modelConfiguration; - Tags = tags; - TargetEnvironmentId = targetEnvironmentId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ModelPackageContent() - { - } - - /// - /// Base environment to start with. - /// 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 . - /// - public BaseEnvironmentSource BaseEnvironmentSource { get; set; } - /// Collection of environment variables. - public IDictionary EnvironmentVariables { get; set; } - /// - /// [Required] Inferencing server configurations. - /// 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 InferencingServer InferencingServer { get; } - /// Collection of inputs. - public IList Inputs { get; set; } - /// Model configuration including the mount mode. - public ModelConfiguration ModelConfiguration { get; set; } - /// Tag dictionary. Tags can be added, removed, and updated. - public IDictionary Tags { get; set; } - /// [Required] Arm ID of the target environment to be created by package operation. - public string TargetEnvironmentId { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.Serialization.cs deleted file mode 100644 index da416eee27148..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.Serialization.cs +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ModelPackageInput : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPackageInput)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("inputType"u8); - writer.WriteStringValue(InputType.ToString()); - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsDefined(MountPath)) - { - if (MountPath != null) - { - writer.WritePropertyName("mountPath"u8); - writer.WriteStringValue(MountPath); - } - else - { - writer.WriteNull("mountPath"); - } - } - writer.WritePropertyName("path"u8); - writer.WriteObjectValue(Path, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelPackageInput 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(ModelPackageInput)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelPackageInput(document.RootElement, options); - } - - internal static ModelPackageInput DeserializeModelPackageInput(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - PackageInputType inputType = default; - PackageInputDeliveryMode? mode = default; - string mountPath = default; - PackageInputPathBase path = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("inputType"u8)) - { - inputType = new PackageInputType(property.Value.GetString()); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new PackageInputDeliveryMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("mountPath"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - mountPath = null; - continue; - } - mountPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("path"u8)) - { - path = PackageInputPathBase.DeserializePackageInputPathBase(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ModelPackageInput(inputType, mode, mountPath, path, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ModelPackageInput)} does not support writing '{options.Format}' format."); - } - } - - ModelPackageInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelPackageInput(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelPackageInput)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.cs deleted file mode 100644 index f39a4fd39a8fa..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Model package input options. - public partial class ModelPackageInput - { - /// - /// 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 . - /// [Required] Type of the input included in the target image. - /// - /// [Required] Location of the input. - /// 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 . - /// - /// is null. - public ModelPackageInput(PackageInputType inputType, PackageInputPathBase path) - { - Argument.AssertNotNull(path, nameof(path)); - - InputType = inputType; - Path = path; - } - - /// Initializes a new instance of . - /// [Required] Type of the input included in the target image. - /// Input delivery mode of the input. - /// Relative mount path of the input in the target image. - /// - /// [Required] Location of the input. - /// 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 . - /// - /// Keeps track of any properties unknown to the library. - internal ModelPackageInput(PackageInputType inputType, PackageInputDeliveryMode? mode, string mountPath, PackageInputPathBase path, IDictionary serializedAdditionalRawData) - { - InputType = inputType; - Mode = mode; - MountPath = mountPath; - Path = path; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ModelPackageInput() - { - } - - /// [Required] Type of the input included in the target image. - public PackageInputType InputType { get; set; } - /// Input delivery mode of the input. - public PackageInputDeliveryMode? Mode { get; set; } - /// Relative mount path of the input in the target image. - public string MountPath { get; set; } - /// - /// [Required] Location of the input. - /// 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 PackageInputPathBase Path { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.Serialization.cs deleted file mode 100644 index 7f91f0936ae36..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.Serialization.cs +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ModelPackageResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPackageResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(BaseEnvironmentSource)) - { - if (BaseEnvironmentSource != null) - { - writer.WritePropertyName("baseEnvironmentSource"u8); - writer.WriteObjectValue(BaseEnvironmentSource, options); - } - else - { - writer.WriteNull("baseEnvironmentSource"); - } - } - if (options.Format != "W" && Optional.IsDefined(BuildId)) - { - if (BuildId != null) - { - writer.WritePropertyName("buildId"u8); - writer.WriteStringValue(BuildId); - } - else - { - writer.WriteNull("buildId"); - } - } - if (options.Format != "W" && Optional.IsDefined(BuildState)) - { - writer.WritePropertyName("buildState"u8); - writer.WriteStringValue(BuildState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsCollectionDefined(EnvironmentVariables)) - { - if (EnvironmentVariables != null) - { - writer.WritePropertyName("environmentVariables"u8); - writer.WriteStartObject(); - foreach (var item in EnvironmentVariables) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("environmentVariables"); - } - } - if (options.Format != "W" && Optional.IsDefined(InferencingServer)) - { - if (InferencingServer != null) - { - writer.WritePropertyName("inferencingServer"u8); - writer.WriteObjectValue(InferencingServer, options); - } - else - { - writer.WriteNull("inferencingServer"); - } - } - if (options.Format != "W" && Optional.IsCollectionDefined(Inputs)) - { - if (Inputs != null) - { - writer.WritePropertyName("inputs"u8); - writer.WriteStartArray(); - foreach (var item in Inputs) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("inputs"); - } - } - if (options.Format != "W" && Optional.IsDefined(LogUri)) - { - if (LogUri != null) - { - writer.WritePropertyName("logUrl"u8); - writer.WriteStringValue(LogUri.AbsoluteUri); - } - else - { - writer.WriteNull("logUrl"); - } - } - if (options.Format != "W" && Optional.IsDefined(ModelConfiguration)) - { - if (ModelConfiguration != null) - { - writer.WritePropertyName("modelConfiguration"u8); - writer.WriteObjectValue(ModelConfiguration, options); - } - else - { - writer.WriteNull("modelConfiguration"); - } - } - if (options.Format != "W" && Optional.IsCollectionDefined(Tags)) - { - if (Tags != null) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("tags"); - } - } - if (options.Format != "W" && Optional.IsDefined(TargetEnvironmentId)) - { - if (TargetEnvironmentId != null) - { - writer.WritePropertyName("targetEnvironmentId"u8); - writer.WriteStringValue(TargetEnvironmentId); - } - else - { - writer.WriteNull("targetEnvironmentId"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelPackageResult 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(ModelPackageResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelPackageResult(document.RootElement, options); - } - - internal static ModelPackageResult DeserializeModelPackageResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - BaseEnvironmentSource baseEnvironmentSource = default; - string buildId = default; - PackageBuildState? buildState = default; - IReadOnlyDictionary environmentVariables = default; - InferencingServer inferencingServer = default; - IReadOnlyList inputs = default; - Uri logUrl = default; - ModelConfiguration modelConfiguration = default; - IReadOnlyDictionary tags = default; - string targetEnvironmentId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("baseEnvironmentSource"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - baseEnvironmentSource = null; - continue; - } - baseEnvironmentSource = BaseEnvironmentSource.DeserializeBaseEnvironmentSource(property.Value, options); - continue; - } - if (property.NameEquals("buildId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - buildId = null; - continue; - } - buildId = property.Value.GetString(); - continue; - } - if (property.NameEquals("buildState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - buildState = new PackageBuildState(property.Value.GetString()); - continue; - } - if (property.NameEquals("environmentVariables"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - environmentVariables = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - environmentVariables = dictionary; - continue; - } - if (property.NameEquals("inferencingServer"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - inferencingServer = null; - continue; - } - inferencingServer = InferencingServer.DeserializeInferencingServer(property.Value, options); - continue; - } - if (property.NameEquals("inputs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - inputs = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ModelPackageInput.DeserializeModelPackageInput(item, options)); - } - inputs = array; - continue; - } - if (property.NameEquals("logUrl"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - logUrl = null; - continue; - } - logUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("modelConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - modelConfiguration = null; - continue; - } - modelConfiguration = ModelConfiguration.DeserializeModelConfiguration(property.Value, options); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tags = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("targetEnvironmentId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - targetEnvironmentId = null; - continue; - } - targetEnvironmentId = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ModelPackageResult( - baseEnvironmentSource, - buildId, - buildState, - environmentVariables ?? new ChangeTrackingDictionary(), - inferencingServer, - inputs ?? new ChangeTrackingList(), - logUrl, - modelConfiguration, - tags ?? new ChangeTrackingDictionary(), - targetEnvironmentId, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ModelPackageResult)} does not support writing '{options.Format}' format."); - } - } - - ModelPackageResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelPackageResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelPackageResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.cs deleted file mode 100644 index 627e1ee30296f..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Package response returned after async package operation completes successfully. - public partial class ModelPackageResult - { - /// - /// 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 ModelPackageResult() - { - EnvironmentVariables = new ChangeTrackingDictionary(); - Inputs = new ChangeTrackingList(); - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// - /// Base environment to start with. - /// 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 . - /// - /// Build id of the image build operation. - /// Build state of the image build operation. - /// Collection of environment variables. - /// - /// Inferencing server configurations. - /// 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 . - /// - /// Collection of inputs. - /// Log url of the image build operation. - /// Model configuration including the mount mode. - /// Tag dictionary. Tags can be added, removed, and updated. - /// Asset ID of the target environment created by package operation. - /// Keeps track of any properties unknown to the library. - internal ModelPackageResult(BaseEnvironmentSource baseEnvironmentSource, string buildId, PackageBuildState? buildState, IReadOnlyDictionary environmentVariables, InferencingServer inferencingServer, IReadOnlyList inputs, Uri logUri, ModelConfiguration modelConfiguration, IReadOnlyDictionary tags, string targetEnvironmentId, IDictionary serializedAdditionalRawData) - { - BaseEnvironmentSource = baseEnvironmentSource; - BuildId = buildId; - BuildState = buildState; - EnvironmentVariables = environmentVariables; - InferencingServer = inferencingServer; - Inputs = inputs; - LogUri = logUri; - ModelConfiguration = modelConfiguration; - Tags = tags; - TargetEnvironmentId = targetEnvironmentId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// - /// Base environment to start with. - /// 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 . - /// - public BaseEnvironmentSource BaseEnvironmentSource { get; } - /// Build id of the image build operation. - public string BuildId { get; } - /// Build state of the image build operation. - public PackageBuildState? BuildState { get; } - /// Collection of environment variables. - public IReadOnlyDictionary EnvironmentVariables { get; } - /// - /// Inferencing server configurations. - /// 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 InferencingServer InferencingServer { get; } - /// Collection of inputs. - public IReadOnlyList Inputs { get; } - /// Log url of the image build operation. - public Uri LogUri { get; } - /// Model configuration including the mount mode. - public ModelConfiguration ModelConfiguration { get; } - /// Tag dictionary. Tags can be added, removed, and updated. - public IReadOnlyDictionary Tags { get; } - /// Asset ID of the target environment created by package operation. - public string TargetEnvironmentId { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.Serialization.cs deleted file mode 100644 index 899e18214637a..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.Serialization.cs +++ /dev/null @@ -1,123 +0,0 @@ -// 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.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownModelPerformanceMetricThresholdBase))] - public partial class ModelPerformanceMetricThresholdBase : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("modelType"u8); - writer.WriteStringValue(ModelType.ToString()); - if (Optional.IsDefined(Threshold)) - { - if (Threshold != null) - { - writer.WritePropertyName("threshold"u8); - writer.WriteObjectValue(Threshold, options); - } - else - { - writer.WriteNull("threshold"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelPerformanceMetricThresholdBase 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(ModelPerformanceMetricThresholdBase)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelPerformanceMetricThresholdBase(document.RootElement, options); - } - - internal static ModelPerformanceMetricThresholdBase DeserializeModelPerformanceMetricThresholdBase(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("modelType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "Classification": return ClassificationModelPerformanceMetricThreshold.DeserializeClassificationModelPerformanceMetricThreshold(element, options); - case "Regression": return RegressionModelPerformanceMetricThreshold.DeserializeRegressionModelPerformanceMetricThreshold(element, options); - } - } - return UnknownModelPerformanceMetricThresholdBase.DeserializeUnknownModelPerformanceMetricThresholdBase(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); - default: - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support writing '{options.Format}' format."); - } - } - - ModelPerformanceMetricThresholdBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelPerformanceMetricThresholdBase(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.cs deleted file mode 100644 index ee8c9a375a809..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// - /// 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 ModelPerformanceMetricThresholdBase - { - /// - /// 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 ModelPerformanceMetricThresholdBase() - { - } - - /// Initializes a new instance of . - /// [Required] Specifies the data type of the metric threshold. - /// The threshold value. If null, a default value will be set depending on the selected metric. - /// Keeps track of any properties unknown to the library. - internal ModelPerformanceMetricThresholdBase(MonitoringModelType modelType, MonitoringThreshold threshold, IDictionary serializedAdditionalRawData) - { - ModelType = modelType; - Threshold = threshold; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// [Required] Specifies the data type of the metric threshold. - internal MonitoringModelType ModelType { get; set; } - /// The threshold value. If null, a default value will be set depending on the selected metric. - internal MonitoringThreshold Threshold { get; set; } - /// The threshold value. If null, the set default is dependent on the metric type. - public double? ThresholdValue - { - get => Threshold is null ? default : Threshold.Value; - set - { - if (Threshold is null) - Threshold = new MonitoringThreshold(); - Threshold.Value = value; - } - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.Serialization.cs deleted file mode 100644 index a30e982ae321d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.Serialization.cs +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ModelPerformanceSignal : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPerformanceSignal)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(DataSegment)) - { - if (DataSegment != null) - { - writer.WritePropertyName("dataSegment"u8); - writer.WriteObjectValue(DataSegment, options); - } - else - { - writer.WriteNull("dataSegment"); - } - } - writer.WritePropertyName("metricThreshold"u8); - writer.WriteObjectValue(MetricThreshold, options); - writer.WritePropertyName("productionData"u8); - writer.WriteStartArray(); - foreach (var item in ProductionData) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - writer.WritePropertyName("referenceData"u8); - writer.WriteObjectValue(ReferenceData, options); - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsCollectionDefined(Properties)) - { - if (Properties != null) - { - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("properties"); - } - } - writer.WritePropertyName("signalType"u8); - writer.WriteStringValue(SignalType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelPerformanceSignal 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(ModelPerformanceSignal)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelPerformanceSignal(document.RootElement, options); - } - - internal static ModelPerformanceSignal DeserializeModelPerformanceSignal(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MonitoringDataSegment dataSegment = default; - ModelPerformanceMetricThresholdBase metricThreshold = default; - IList productionData = default; - MonitoringInputDataBase referenceData = default; - MonitoringNotificationMode? mode = default; - IDictionary properties = default; - MonitoringSignalType signalType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("dataSegment"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - dataSegment = null; - continue; - } - dataSegment = MonitoringDataSegment.DeserializeMonitoringDataSegment(property.Value, options); - continue; - } - if (property.NameEquals("metricThreshold"u8)) - { - metricThreshold = ModelPerformanceMetricThresholdBase.DeserializeModelPerformanceMetricThresholdBase(property.Value, options); - continue; - } - if (property.NameEquals("productionData"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MonitoringInputDataBase.DeserializeMonitoringInputDataBase(item, options)); - } - productionData = array; - continue; - } - if (property.NameEquals("referenceData"u8)) - { - referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new MonitoringNotificationMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - properties = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - properties = dictionary; - continue; - } - if (property.NameEquals("signalType"u8)) - { - signalType = new MonitoringSignalType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ModelPerformanceSignal( - mode, - properties ?? new ChangeTrackingDictionary(), - signalType, - serializedAdditionalRawData, - dataSegment, - metricThreshold, - productionData, - referenceData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ModelPerformanceSignal)} does not support writing '{options.Format}' format."); - } - } - - ModelPerformanceSignal IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelPerformanceSignal(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelPerformanceSignal)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.cs deleted file mode 100644 index 46931be82aa82..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Model performance signal definition. - public partial class ModelPerformanceSignal : MonitoringSignalBase - { - /// Initializes a new instance of . - /// - /// [Required] A list of metrics to calculate and their associated thresholds. - /// 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 . - /// - /// - /// [Required] The data produced by the production service which drift will be calculated for. - /// 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 . - /// - /// - /// [Required] The data to calculate drift against. - /// 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 . - /// - /// , or is null. - public ModelPerformanceSignal(ModelPerformanceMetricThresholdBase metricThreshold, IEnumerable productionData, MonitoringInputDataBase referenceData) - { - Argument.AssertNotNull(metricThreshold, nameof(metricThreshold)); - Argument.AssertNotNull(productionData, nameof(productionData)); - Argument.AssertNotNull(referenceData, nameof(referenceData)); - - MetricThreshold = metricThreshold; - ProductionData = productionData.ToList(); - ReferenceData = referenceData; - SignalType = MonitoringSignalType.ModelPerformance; - } - - /// Initializes a new instance of . - /// The current notification mode for this signal. - /// Property dictionary. Properties can be added, but not removed or altered. - /// [Required] Specifies the type of signal to monitor. - /// Keeps track of any properties unknown to the library. - /// The data segment. - /// - /// [Required] A list of metrics to calculate and their associated thresholds. - /// 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 . - /// - /// - /// [Required] The data produced by the production service which drift will be calculated for. - /// 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 . - /// - /// - /// [Required] The data to calculate drift against. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - internal ModelPerformanceSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, MonitoringDataSegment dataSegment, ModelPerformanceMetricThresholdBase metricThreshold, IList productionData, MonitoringInputDataBase referenceData) : base(mode, properties, signalType, serializedAdditionalRawData) - { - DataSegment = dataSegment; - MetricThreshold = metricThreshold; - ProductionData = productionData; - ReferenceData = referenceData; - SignalType = signalType; - } - - /// Initializes a new instance of for deserialization. - internal ModelPerformanceSignal() - { - } - - /// The data segment. - public MonitoringDataSegment DataSegment { get; set; } - /// - /// [Required] A list of metrics to calculate and their associated thresholds. - /// 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 ModelPerformanceMetricThresholdBase MetricThreshold { get; set; } - /// - /// [Required] The data produced by the production service which drift will be calculated for. - /// 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 ProductionData { get; } - /// - /// [Required] The data to calculate drift against. - /// 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 MonitoringInputDataBase ReferenceData { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelProvider.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelProvider.cs new file mode 100644 index 0000000000000..abfac75efe61b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelProvider.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Enum to determine the type of fine tuning. + internal readonly partial struct ModelProvider : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ModelProvider(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureOpenAIValue = "AzureOpenAI"; + private const string CustomValue = "Custom"; + + /// Fine tuning using Azure Open AI model. + public static ModelProvider AzureOpenAI { get; } = new ModelProvider(AzureOpenAIValue); + /// Fine tuning using custom model. + public static ModelProvider Custom { get; } = new ModelProvider(CustomValue); + /// Determines if two values are the same. + public static bool operator ==(ModelProvider left, ModelProvider right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ModelProvider left, ModelProvider right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ModelProvider(string value) => new ModelProvider(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ModelProvider other && Equals(other); + /// + public bool Equals(ModelProvider 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobInstructions.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobInstructions.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs index 453e16c521945..00b70fc620c13 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobInstructions.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs @@ -13,29 +13,29 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class LabelingJobInstructions : IUtf8JsonSerializable, IJsonModel + internal partial class ModelSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobInstructions)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ModelSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Uri)) + if (Optional.IsDefined(ModelId)) { - if (Uri != null) + if (ModelId != null) { - writer.WritePropertyName("uri"u8); - writer.WriteStringValue(Uri.AbsoluteUri); + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); } else { - writer.WriteNull("uri"); + writer.WriteNull("modelId"); } } if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -56,19 +56,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndObject(); } - LabelingJobInstructions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ModelSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobInstructions)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ModelSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobInstructions(document.RootElement, options); + return DeserializeModelSettings(document.RootElement, options); } - internal static LabelingJobInstructions DeserializeLabelingJobInstructions(JsonElement element, ModelReaderWriterOptions options = null) + internal static ModelSettings DeserializeModelSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,19 +76,19 @@ internal static LabelingJobInstructions DeserializeLabelingJobInstructions(JsonE { return null; } - Uri uri = default; + string modelId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("uri"u8)) + if (property.NameEquals("modelId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - uri = null; + modelId = null; continue; } - uri = new Uri(property.Value.GetString()); + modelId = property.Value.GetString(); continue; } if (options.Format != "W") @@ -97,38 +97,38 @@ internal static LabelingJobInstructions DeserializeLabelingJobInstructions(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new LabelingJobInstructions(uri, serializedAdditionalRawData); + return new ModelSettings(modelId, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingJobInstructions)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ModelSettings)} does not support writing '{options.Format}' format."); } } - LabelingJobInstructions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ModelSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobInstructions(document.RootElement, options); + return DeserializeModelSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingJobInstructions)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ModelSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs new file mode 100644 index 0000000000000..8aca8bc654643 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ModelSettings. + internal partial class ModelSettings + { + /// + /// 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 . + public ModelSettings() + { + } + + /// Initializes a new instance of . + /// The unique model identifier that this ServerlessEndpoint should provision. + /// Keeps track of any properties unknown to the library. + internal ModelSettings(string modelId, IDictionary serializedAdditionalRawData) + { + ModelId = modelId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The unique model identifier that this ServerlessEndpoint should provision. + public string ModelId { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelTaskType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelTaskType.cs index 7185f0c325ec2..0eddb4a2d9806 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelTaskType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelTaskType.cs @@ -24,14 +24,11 @@ public ModelTaskType(string value) private const string ClassificationValue = "Classification"; private const string RegressionValue = "Regression"; - private const string QuestionAnsweringValue = "QuestionAnswering"; /// Classification. public static ModelTaskType Classification { get; } = new ModelTaskType(ClassificationValue); /// Regression. public static ModelTaskType Regression { get; } = new ModelTaskType(RegressionValue); - /// QuestionAnswering. - public static ModelTaskType QuestionAnswering { get; } = new ModelTaskType(QuestionAnsweringValue); /// Determines if two values are the same. public static bool operator ==(ModelTaskType left, ModelTaskType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorComputeIdentityBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorComputeIdentityBase.cs index 797cbdfe27268..6257f0012e663 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorComputeIdentityBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorComputeIdentityBase.cs @@ -55,7 +55,7 @@ protected MonitorComputeIdentityBase() } /// Initializes a new instance of . - /// [Required] Monitor compute identity type enum. + /// [Required] Specifies the type of identity to use within the monitoring jobs. /// Keeps track of any properties unknown to the library. internal MonitorComputeIdentityBase(MonitorComputeIdentityType computeIdentityType, IDictionary serializedAdditionalRawData) { @@ -63,7 +63,7 @@ internal MonitorComputeIdentityBase(MonitorComputeIdentityType computeIdentityTy _serializedAdditionalRawData = serializedAdditionalRawData; } - /// [Required] Monitor compute identity type enum. + /// [Required] Specifies the type of identity to use within the monitoring jobs. internal MonitorComputeIdentityType ComputeIdentityType { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.Serialization.cs index 8e12819d7e6f1..47e16cbcab878 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.Serialization.cs @@ -26,16 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite } writer.WriteStartObject(); - if (Optional.IsDefined(AlertNotificationSetting)) + if (Optional.IsDefined(AlertNotificationSettings)) { - if (AlertNotificationSetting != null) + if (AlertNotificationSettings != null) { - writer.WritePropertyName("alertNotificationSetting"u8); - writer.WriteObjectValue(AlertNotificationSetting, options); + writer.WritePropertyName("alertNotificationSettings"u8); + writer.WriteObjectValue(AlertNotificationSettings, options); } else { - writer.WriteNull("alertNotificationSetting"); + writer.WriteNull("alertNotificationSettings"); } } writer.WritePropertyName("computeConfiguration"u8); @@ -98,7 +98,7 @@ internal static MonitorDefinition DeserializeMonitorDefinition(JsonElement eleme { return null; } - MonitoringAlertNotificationSettingsBase alertNotificationSetting = default; + MonitorNotificationSettings alertNotificationSettings = default; MonitorComputeConfigurationBase computeConfiguration = default; MonitoringTarget monitoringTarget = default; IDictionary signals = default; @@ -106,14 +106,14 @@ internal static MonitorDefinition DeserializeMonitorDefinition(JsonElement eleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("alertNotificationSetting"u8)) + if (property.NameEquals("alertNotificationSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - alertNotificationSetting = null; + alertNotificationSettings = null; continue; } - alertNotificationSetting = MonitoringAlertNotificationSettingsBase.DeserializeMonitoringAlertNotificationSettingsBase(property.Value, options); + alertNotificationSettings = MonitorNotificationSettings.DeserializeMonitorNotificationSettings(property.Value, options); continue; } if (property.NameEquals("computeConfiguration"u8)) @@ -147,7 +147,7 @@ internal static MonitorDefinition DeserializeMonitorDefinition(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new MonitorDefinition(alertNotificationSetting, computeConfiguration, monitoringTarget, signals, serializedAdditionalRawData); + return new MonitorDefinition(alertNotificationSettings, computeConfiguration, monitoringTarget, signals, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.cs index 4a6ddba493ba6..a5950dac2b15e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.cs @@ -54,7 +54,7 @@ public partial class MonitorDefinition /// /// [Required] The signals to monitor. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , and . + /// The available derived classes include , , , and . /// /// or is null. public MonitorDefinition(MonitorComputeConfigurationBase computeConfiguration, IDictionary signals) @@ -67,26 +67,22 @@ public MonitorDefinition(MonitorComputeConfigurationBase computeConfiguration, I } /// Initializes a new instance of . - /// - /// The monitor's notification settings. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// + /// The monitor's notification settings. /// /// [Required] The ARM resource ID of the compute resource to run the monitoring job on. /// 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 . /// - /// The ARM resource ID of either the model or deployment targeted by this monitor. + /// The entities targeted by the monitor. /// /// [Required] The signals to monitor. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , and . + /// The available derived classes include , , , and . /// /// Keeps track of any properties unknown to the library. - internal MonitorDefinition(MonitoringAlertNotificationSettingsBase alertNotificationSetting, MonitorComputeConfigurationBase computeConfiguration, MonitoringTarget monitoringTarget, IDictionary signals, IDictionary serializedAdditionalRawData) + internal MonitorDefinition(MonitorNotificationSettings alertNotificationSettings, MonitorComputeConfigurationBase computeConfiguration, MonitoringTarget monitoringTarget, IDictionary signals, IDictionary serializedAdditionalRawData) { - AlertNotificationSetting = alertNotificationSetting; + AlertNotificationSettings = alertNotificationSettings; ComputeConfiguration = computeConfiguration; MonitoringTarget = monitoringTarget; Signals = signals; @@ -98,24 +94,32 @@ internal MonitorDefinition() { } - /// - /// The monitor's notification settings. - /// 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 MonitoringAlertNotificationSettingsBase AlertNotificationSetting { get; set; } + /// The monitor's notification settings. + internal MonitorNotificationSettings AlertNotificationSettings { get; set; } + /// The email recipient list which has a limitation of 499 characters in total. + public IList Emails + { + get => AlertNotificationSettings is null ? default : AlertNotificationSettings.Emails; + set + { + if (AlertNotificationSettings is null) + AlertNotificationSettings = new MonitorNotificationSettings(); + AlertNotificationSettings.Emails = value; + } + } + /// /// [Required] The ARM resource ID of the compute resource to run the monitoring job on. /// 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 . /// public MonitorComputeConfigurationBase ComputeConfiguration { get; set; } - /// The ARM resource ID of either the model or deployment targeted by this monitor. + /// The entities targeted by the monitor. public MonitoringTarget MonitoringTarget { get; set; } /// /// [Required] The signals to monitor. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , and . + /// The available derived classes include , , , and . /// public IDictionary Signals { get; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringDataSegment.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs similarity index 54% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringDataSegment.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs index 52b10ecf0e696..7e88982908cae 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringDataSegment.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs @@ -13,38 +13,26 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class MonitoringDataSegment : IUtf8JsonSerializable, IJsonModel + internal partial class MonitorEmailNotificationSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MonitoringDataSegment)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MonitorEmailNotificationSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Feature)) + if (Optional.IsCollectionDefined(Emails)) { - if (Feature != null) + if (Emails != null) { - writer.WritePropertyName("feature"u8); - writer.WriteStringValue(Feature); - } - else - { - writer.WriteNull("feature"); - } - } - if (Optional.IsCollectionDefined(Values)) - { - if (Values != null) - { - writer.WritePropertyName("values"u8); + writer.WritePropertyName("emails"u8); writer.WriteStartArray(); - foreach (var item in Values) + foreach (var item in Emails) { writer.WriteStringValue(item); } @@ -52,7 +40,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW } else { - writer.WriteNull("values"); + writer.WriteNull("emails"); } } if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -73,19 +61,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteEndObject(); } - MonitoringDataSegment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MonitorEmailNotificationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MonitoringDataSegment)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MonitorEmailNotificationSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMonitoringDataSegment(document.RootElement, options); + return DeserializeMonitorEmailNotificationSettings(document.RootElement, options); } - internal static MonitoringDataSegment DeserializeMonitoringDataSegment(JsonElement element, ModelReaderWriterOptions options = null) + internal static MonitorEmailNotificationSettings DeserializeMonitorEmailNotificationSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -93,27 +81,16 @@ internal static MonitoringDataSegment DeserializeMonitoringDataSegment(JsonEleme { return null; } - string feature = default; - IList values = default; + IList emails = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("feature"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - feature = null; - continue; - } - feature = property.Value.GetString(); - continue; - } - if (property.NameEquals("values"u8)) + if (property.NameEquals("emails"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - values = null; + emails = null; continue; } List array = new List(); @@ -121,7 +98,7 @@ internal static MonitoringDataSegment DeserializeMonitoringDataSegment(JsonEleme { array.Add(item.GetString()); } - values = array; + emails = array; continue; } if (options.Format != "W") @@ -130,38 +107,38 @@ internal static MonitoringDataSegment DeserializeMonitoringDataSegment(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new MonitoringDataSegment(feature, values ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new MonitorEmailNotificationSettings(emails ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MonitoringDataSegment)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MonitorEmailNotificationSettings)} does not support writing '{options.Format}' format."); } } - MonitoringDataSegment IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MonitorEmailNotificationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMonitoringDataSegment(document.RootElement, options); + return DeserializeMonitorEmailNotificationSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MonitoringDataSegment)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MonitorEmailNotificationSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs new file mode 100644 index 0000000000000..4a748e4f6368b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The MonitorEmailNotificationSettings. + internal partial class MonitorEmailNotificationSettings + { + /// + /// 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 . + public MonitorEmailNotificationSettings() + { + Emails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The email recipient list which has a limitation of 499 characters in total. + /// Keeps track of any properties unknown to the library. + internal MonitorEmailNotificationSettings(IList emails, IDictionary serializedAdditionalRawData) + { + Emails = emails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The email recipient list which has a limitation of 499 characters in total. + public IList Emails { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs similarity index 53% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelConfiguration.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs index ec63bd3150029..76f1b9e5d4d94 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs @@ -13,34 +13,29 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class ModelConfiguration : IUtf8JsonSerializable, IJsonModel + internal partial class MonitorNotificationSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ModelConfiguration)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MonitorNotificationSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Mode)) + if (Optional.IsDefined(EmailNotificationSettings)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsDefined(MountPath)) - { - if (MountPath != null) + if (EmailNotificationSettings != null) { - writer.WritePropertyName("mountPath"u8); - writer.WriteStringValue(MountPath); + writer.WritePropertyName("emailNotificationSettings"u8); + writer.WriteObjectValue(EmailNotificationSettings, options); } else { - writer.WriteNull("mountPath"); + writer.WriteNull("emailNotificationSettings"); } } if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -61,19 +56,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - ModelConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MonitorNotificationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ModelConfiguration)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MonitorNotificationSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelConfiguration(document.RootElement, options); + return DeserializeMonitorNotificationSettings(document.RootElement, options); } - internal static ModelConfiguration DeserializeModelConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + internal static MonitorNotificationSettings DeserializeMonitorNotificationSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -81,29 +76,19 @@ internal static ModelConfiguration DeserializeModelConfiguration(JsonElement ele { return null; } - PackageInputDeliveryMode? mode = default; - string mountPath = default; + MonitorEmailNotificationSettings emailNotificationSettings = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new PackageInputDeliveryMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("mountPath"u8)) + if (property.NameEquals("emailNotificationSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - mountPath = null; + emailNotificationSettings = null; continue; } - mountPath = property.Value.GetString(); + emailNotificationSettings = MonitorEmailNotificationSettings.DeserializeMonitorEmailNotificationSettings(property.Value, options); continue; } if (options.Format != "W") @@ -112,38 +97,38 @@ internal static ModelConfiguration DeserializeModelConfiguration(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new ModelConfiguration(mode, mountPath, serializedAdditionalRawData); + return new MonitorNotificationSettings(emailNotificationSettings, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ModelConfiguration)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MonitorNotificationSettings)} does not support writing '{options.Format}' format."); } } - ModelConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MonitorNotificationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelConfiguration(document.RootElement, options); + return DeserializeMonitorNotificationSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ModelConfiguration)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MonitorNotificationSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs index cd5b78d3729ce..abc1244c89eb2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs @@ -10,11 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// - /// 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 MonitoringAlertNotificationSettingsBase + /// The MonitorNotificationSettings. + internal partial class MonitorNotificationSettings { /// /// Keeps track of any properties unknown to the library. @@ -46,23 +43,34 @@ public abstract partial class MonitoringAlertNotificationSettingsBase /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - protected MonitoringAlertNotificationSettingsBase() + /// Initializes a new instance of . + public MonitorNotificationSettings() { } - /// Initializes a new instance of . - /// [Required] Specifies the type of signal to monitor. + /// Initializes a new instance of . + /// The AML notification email settings. /// Keeps track of any properties unknown to the library. - internal MonitoringAlertNotificationSettingsBase(MonitoringAlertNotificationType alertNotificationType, IDictionary serializedAdditionalRawData) + internal MonitorNotificationSettings(MonitorEmailNotificationSettings emailNotificationSettings, IDictionary serializedAdditionalRawData) { - AlertNotificationType = alertNotificationType; + EmailNotificationSettings = emailNotificationSettings; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// [Required] Specifies the type of signal to monitor. - internal MonitoringAlertNotificationType AlertNotificationType { get; set; } + /// The AML notification email settings. + internal MonitorEmailNotificationSettings EmailNotificationSettings { get; set; } + /// The email recipient list which has a limitation of 499 characters in total. + public IList Emails + { + get => EmailNotificationSettings is null ? default : EmailNotificationSettings.Emails; + set + { + if (EmailNotificationSettings is null) + EmailNotificationSettings = new MonitorEmailNotificationSettings(); + EmailNotificationSettings.Emails = value; + } + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.Serialization.cs deleted file mode 100644 index 5e4bfe87233af..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// 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.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownMonitoringAlertNotificationSettingsBase))] - public partial class MonitoringAlertNotificationSettingsBase : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("alertNotificationType"u8); - writer.WriteStringValue(AlertNotificationType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MonitoringAlertNotificationSettingsBase 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(MonitoringAlertNotificationSettingsBase)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMonitoringAlertNotificationSettingsBase(document.RootElement, options); - } - - internal static MonitoringAlertNotificationSettingsBase DeserializeMonitoringAlertNotificationSettingsBase(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("alertNotificationType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AzureMonitor": return AzMonMonitoringAlertNotificationSettings.DeserializeAzMonMonitoringAlertNotificationSettings(element, options); - case "Email": return EmailMonitoringAlertNotificationSettings.DeserializeEmailMonitoringAlertNotificationSettings(element, options); - } - } - return UnknownMonitoringAlertNotificationSettingsBase.DeserializeUnknownMonitoringAlertNotificationSettingsBase(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); - default: - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support writing '{options.Format}' format."); - } - } - - MonitoringAlertNotificationSettingsBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMonitoringAlertNotificationSettingsBase(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationType.cs deleted file mode 100644 index 8a7d19bc7e5bc..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The MonitoringAlertNotificationType. - internal readonly partial struct MonitoringAlertNotificationType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MonitoringAlertNotificationType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureMonitorValue = "AzureMonitor"; - private const string EmailValue = "Email"; - - /// Settings for Azure Monitor based alerting. - public static MonitoringAlertNotificationType AzureMonitor { get; } = new MonitoringAlertNotificationType(AzureMonitorValue); - /// Settings for AML email notifications. - public static MonitoringAlertNotificationType Email { get; } = new MonitoringAlertNotificationType(EmailValue); - /// Determines if two values are the same. - public static bool operator ==(MonitoringAlertNotificationType left, MonitoringAlertNotificationType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MonitoringAlertNotificationType left, MonitoringAlertNotificationType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MonitoringAlertNotificationType(string value) => new MonitoringAlertNotificationType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MonitoringAlertNotificationType other && Equals(other); - /// - public bool Equals(MonitoringAlertNotificationType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.Serialization.cs index 503ad60c9249c..2676753525453 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.Serialization.cs @@ -105,8 +105,8 @@ internal static MonitoringInputDataBase DeserializeMonitoringInputDataBase(JsonE switch (discriminator.GetString()) { case "Fixed": return FixedInputData.DeserializeFixedInputData(element, options); + case "Rolling": return RollingInputData.DeserializeRollingInputData(element, options); case "Static": return StaticInputData.DeserializeStaticInputData(element, options); - case "Trailing": return TrailingInputData.DeserializeTrailingInputData(element, options); } } return UnknownMonitoringInputDataBase.DeserializeUnknownMonitoringInputDataBase(element, options); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.cs index 58a132de83e36..cc188c85d1a11 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Monitoring input data base definition. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public abstract partial class MonitoringInputDataBase { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataType.cs index 488917152a4bd..6a50784f81ad1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataType.cs @@ -23,13 +23,13 @@ public MonitoringInputDataType(string value) } private const string StaticValue = "Static"; - private const string TrailingValue = "Trailing"; + private const string RollingValue = "Rolling"; private const string FixedValue = "Fixed"; /// An input data with a fixed window size. public static MonitoringInputDataType Static { get; } = new MonitoringInputDataType(StaticValue); - /// An input data which trailing relatively to the monitor's current run. - public static MonitoringInputDataType Trailing { get; } = new MonitoringInputDataType(TrailingValue); + /// An input data which rolls relatively to the monitor's current run time. + public static MonitoringInputDataType Rolling { get; } = new MonitoringInputDataType(RollingValue); /// An input data with tabular format which doesn't require preprocessing. public static MonitoringInputDataType Fixed { get; } = new MonitoringInputDataType(FixedValue); /// Determines if two values are the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringModelType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringModelType.cs deleted file mode 100644 index 0f7f898175196..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringModelType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The MonitoringModelType. - public readonly partial struct MonitoringModelType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MonitoringModelType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ClassificationValue = "Classification"; - private const string RegressionValue = "Regression"; - - /// A model trained for classification tasks. - public static MonitoringModelType Classification { get; } = new MonitoringModelType(ClassificationValue); - /// A model trained for regressions tasks. - public static MonitoringModelType Regression { get; } = new MonitoringModelType(RegressionValue); - /// Determines if two values are the same. - public static bool operator ==(MonitoringModelType left, MonitoringModelType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MonitoringModelType left, MonitoringModelType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MonitoringModelType(string value) => new MonitoringModelType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MonitoringModelType other && Equals(other); - /// - public bool Equals(MonitoringModelType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationMode.cs deleted file mode 100644 index 8467b207fffe5..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The MonitoringNotificationMode. - public readonly partial struct MonitoringNotificationMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MonitoringNotificationMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DisabledValue = "Disabled"; - private const string EnabledValue = "Enabled"; - - /// Disabled notifications will not produce emails/metrics leveraged for alerting. - public static MonitoringNotificationMode Disabled { get; } = new MonitoringNotificationMode(DisabledValue); - /// Enabled notification will produce emails/metrics leveraged for alerting. - public static MonitoringNotificationMode Enabled { get; } = new MonitoringNotificationMode(EnabledValue); - /// Determines if two values are the same. - public static bool operator ==(MonitoringNotificationMode left, MonitoringNotificationMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MonitoringNotificationMode left, MonitoringNotificationMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MonitoringNotificationMode(string value) => new MonitoringNotificationMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MonitoringNotificationMode other && Equals(other); - /// - public bool Equals(MonitoringNotificationMode 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationType.cs new file mode 100644 index 0000000000000..019cbff350dba --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The MonitoringNotificationType. + public readonly partial struct MonitoringNotificationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MonitoringNotificationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AmlNotificationValue = "AmlNotification"; + + /// Enables email notifications through AML notifications. + public static MonitoringNotificationType AmlNotification { get; } = new MonitoringNotificationType(AmlNotificationValue); + /// Determines if two values are the same. + public static bool operator ==(MonitoringNotificationType left, MonitoringNotificationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MonitoringNotificationType left, MonitoringNotificationType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MonitoringNotificationType(string value) => new MonitoringNotificationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MonitoringNotificationType other && Equals(other); + /// + public bool Equals(MonitoringNotificationType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.Serialization.cs index eee3d06c0cbe9..5ff5888a2ac6f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.Serialization.cs @@ -26,10 +26,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteStartObject(); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -97,9 +109,6 @@ internal static MonitoringSignalBase DeserializeMonitoringSignalBase(JsonElement case "DataDrift": return DataDriftMonitoringSignal.DeserializeDataDriftMonitoringSignal(element, options); case "DataQuality": return DataQualityMonitoringSignal.DeserializeDataQualityMonitoringSignal(element, options); case "FeatureAttributionDrift": return FeatureAttributionDriftMonitoringSignal.DeserializeFeatureAttributionDriftMonitoringSignal(element, options); - case "GenerationSafetyQuality": return GenerationSafetyQualityMonitoringSignal.DeserializeGenerationSafetyQualityMonitoringSignal(element, options); - case "GenerationTokenStatistics": return GenerationTokenStatisticsSignal.DeserializeGenerationTokenStatisticsSignal(element, options); - case "ModelPerformance": return ModelPerformanceSignal.DeserializeModelPerformanceSignal(element, options); case "PredictionDrift": return PredictionDriftMonitoringSignal.DeserializePredictionDriftMonitoringSignal(element, options); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.cs index a375c432ff3fd..2aeb6c39497d1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { /// /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , and . + /// The available derived classes include , , , and . /// public abstract partial class MonitoringSignalBase { @@ -51,24 +51,25 @@ public abstract partial class MonitoringSignalBase /// Initializes a new instance of . protected MonitoringSignalBase() { + NotificationTypes = new ChangeTrackingList(); Properties = new ChangeTrackingDictionary(); } /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. - internal MonitoringSignalBase(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData) + internal MonitoringSignalBase(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData) { - Mode = mode; + NotificationTypes = notificationTypes; Properties = properties; SignalType = signalType; _serializedAdditionalRawData = serializedAdditionalRawData; } /// The current notification mode for this signal. - public MonitoringNotificationMode? Mode { get; set; } + public IList NotificationTypes { get; set; } /// Property dictionary. Properties can be added, but not removed or altered. public IDictionary Properties { get; set; } /// [Required] Specifies the type of signal to monitor. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalType.cs index 1445538716a04..a5fa7ced5854d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalType.cs @@ -27,9 +27,6 @@ public MonitoringSignalType(string value) private const string DataQualityValue = "DataQuality"; private const string FeatureAttributionDriftValue = "FeatureAttributionDrift"; private const string CustomValue = "Custom"; - private const string ModelPerformanceValue = "ModelPerformance"; - private const string GenerationSafetyQualityValue = "GenerationSafetyQuality"; - private const string GenerationTokenStatisticsValue = "GenerationTokenStatistics"; /// Tracks model input data distribution change, comparing against training data or past production data. public static MonitoringSignalType DataDrift { get; } = new MonitoringSignalType(DataDriftValue); @@ -41,12 +38,6 @@ public MonitoringSignalType(string value) public static MonitoringSignalType FeatureAttributionDrift { get; } = new MonitoringSignalType(FeatureAttributionDriftValue); /// Tracks a custom signal provided by users. public static MonitoringSignalType Custom { get; } = new MonitoringSignalType(CustomValue); - /// Tracks model performance based on ground truth data. - public static MonitoringSignalType ModelPerformance { get; } = new MonitoringSignalType(ModelPerformanceValue); - /// Tracks the safety and quality of generated content. - public static MonitoringSignalType GenerationSafetyQuality { get; } = new MonitoringSignalType(GenerationSafetyQualityValue); - /// Tracks the token usage of generative endpoints. - public static MonitoringSignalType GenerationTokenStatistics { get; } = new MonitoringSignalType(GenerationTokenStatisticsValue); /// Determines if two values are the same. public static bool operator ==(MonitoringSignalType left, MonitoringSignalType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringTarget.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringTarget.cs index 627f5a03d5e27..22420b15967f5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringTarget.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringTarget.cs @@ -46,16 +46,16 @@ public partial class MonitoringTarget private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// [Required] The machine learning task type of the model. + /// [Required] The machine learning task type of the monitored model. public MonitoringTarget(ModelTaskType taskType) { TaskType = taskType; } /// Initializes a new instance of . - /// The ARM resource ID of either the deployment targeted by this monitor. - /// The ARM resource ID of either the model targeted by this monitor. - /// [Required] The machine learning task type of the model. + /// Reference to the deployment asset targeted by this monitor. + /// Reference to the model asset targeted by this monitor. + /// [Required] The machine learning task type of the monitored model. /// Keeps track of any properties unknown to the library. internal MonitoringTarget(string deploymentId, string modelId, ModelTaskType taskType, IDictionary serializedAdditionalRawData) { @@ -70,11 +70,11 @@ internal MonitoringTarget() { } - /// The ARM resource ID of either the deployment targeted by this monitor. + /// Reference to the deployment asset targeted by this monitor. public string DeploymentId { get; set; } - /// The ARM resource ID of either the model targeted by this monitor. + /// Reference to the model asset targeted by this monitor. public string ModelId { get; set; } - /// [Required] The machine learning task type of the model. + /// [Required] The machine learning task type of the monitored model. public ModelTaskType TaskType { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.Serialization.cs deleted file mode 100644 index 2c1c889dd9e84..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.Serialization.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class MonitoringWorkspaceConnection : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MonitoringWorkspaceConnection)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(EnvironmentVariables)) - { - if (EnvironmentVariables != null) - { - writer.WritePropertyName("environmentVariables"u8); - writer.WriteStartObject(); - foreach (var item in EnvironmentVariables) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("environmentVariables"); - } - } - if (Optional.IsCollectionDefined(Secrets)) - { - if (Secrets != null) - { - writer.WritePropertyName("secrets"u8); - writer.WriteStartObject(); - foreach (var item in Secrets) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secrets"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MonitoringWorkspaceConnection 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(MonitoringWorkspaceConnection)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMonitoringWorkspaceConnection(document.RootElement, options); - } - - internal static MonitoringWorkspaceConnection DeserializeMonitoringWorkspaceConnection(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary environmentVariables = default; - IDictionary secrets = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("environmentVariables"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - environmentVariables = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - environmentVariables = dictionary; - continue; - } - if (property.NameEquals("secrets"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secrets = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - secrets = dictionary; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MonitoringWorkspaceConnection(environmentVariables ?? new ChangeTrackingDictionary(), secrets ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MonitoringWorkspaceConnection)} does not support writing '{options.Format}' format."); - } - } - - MonitoringWorkspaceConnection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMonitoringWorkspaceConnection(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MonitoringWorkspaceConnection)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.cs deleted file mode 100644 index 4733daa9fcf4b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Monitoring workspace connection definition. - public partial class MonitoringWorkspaceConnection - { - /// - /// 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 . - public MonitoringWorkspaceConnection() - { - EnvironmentVariables = new ChangeTrackingDictionary(); - Secrets = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// - /// The properties of a workspace service connection to store as environment variables in the submitted jobs. - /// Key is workspace connection property path, name is environment variable key. - /// - /// - /// The properties of a workspace service connection to store as secrets in the submitted jobs. - /// Key is workspace connection property path, name is secret key. - /// - /// Keeps track of any properties unknown to the library. - internal MonitoringWorkspaceConnection(IDictionary environmentVariables, IDictionary secrets, IDictionary serializedAdditionalRawData) - { - EnvironmentVariables = environmentVariables; - Secrets = secrets; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// - /// The properties of a workspace service connection to store as environment variables in the submitted jobs. - /// Key is workspace connection property path, name is environment variable key. - /// - public IDictionary EnvironmentVariables { get; set; } - /// - /// The properties of a workspace service connection to store as secrets in the submitted jobs. - /// Key is workspace connection property path, name is secret key. - /// - public IDictionary Secrets { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MediaType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MountMode.cs similarity index 51% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MediaType.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MountMode.cs index 2d74c358353e1..7ddf80dfea74a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MediaType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MountMode.cs @@ -10,37 +10,37 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Media type of data asset. - internal readonly partial struct MediaType : IEquatable + /// Mount Mode. + public readonly partial struct MountMode : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public MediaType(string value) + public MountMode(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string ImageValue = "Image"; - private const string TextValue = "Text"; + private const string ReadOnlyValue = "ReadOnly"; + private const string ReadWriteValue = "ReadWrite"; - /// Image. - public static MediaType Image { get; } = new MediaType(ImageValue); - /// Text. - public static MediaType Text { get; } = new MediaType(TextValue); - /// Determines if two values are the same. - public static bool operator ==(MediaType left, MediaType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MediaType left, MediaType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MediaType(string value) => new MediaType(value); + /// ReadOnly. + public static MountMode ReadOnly { get; } = new MountMode(ReadOnlyValue); + /// ReadWrite. + public static MountMode ReadWrite { get; } = new MountMode(ReadWriteValue); + /// Determines if two values are the same. + public static bool operator ==(MountMode left, MountMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MountMode left, MountMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MountMode(string value) => new MountMode(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MediaType other && Equals(other); + public override bool Equals(object obj) => obj is MountMode other && Equals(other); /// - public bool Equals(MediaType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(MountMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.Serialization.cs deleted file mode 100644 index c49bc03fa2705..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.Serialization.cs +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class NlpFixedParameters : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NlpFixedParameters)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(GradientAccumulationSteps)) - { - if (GradientAccumulationSteps != null) - { - writer.WritePropertyName("gradientAccumulationSteps"u8); - writer.WriteNumberValue(GradientAccumulationSteps.Value); - } - else - { - writer.WriteNull("gradientAccumulationSteps"); - } - } - if (Optional.IsDefined(LearningRate)) - { - if (LearningRate != null) - { - writer.WritePropertyName("learningRate"u8); - writer.WriteNumberValue(LearningRate.Value); - } - else - { - writer.WriteNull("learningRate"); - } - } - if (Optional.IsDefined(LearningRateScheduler)) - { - writer.WritePropertyName("learningRateScheduler"u8); - writer.WriteStringValue(LearningRateScheduler.Value.ToString()); - } - if (Optional.IsDefined(ModelName)) - { - if (ModelName != null) - { - writer.WritePropertyName("modelName"u8); - writer.WriteStringValue(ModelName); - } - else - { - writer.WriteNull("modelName"); - } - } - if (Optional.IsDefined(NumberOfEpochs)) - { - if (NumberOfEpochs != null) - { - writer.WritePropertyName("numberOfEpochs"u8); - writer.WriteNumberValue(NumberOfEpochs.Value); - } - else - { - writer.WriteNull("numberOfEpochs"); - } - } - if (Optional.IsDefined(TrainingBatchSize)) - { - if (TrainingBatchSize != null) - { - writer.WritePropertyName("trainingBatchSize"u8); - writer.WriteNumberValue(TrainingBatchSize.Value); - } - else - { - writer.WriteNull("trainingBatchSize"); - } - } - if (Optional.IsDefined(ValidationBatchSize)) - { - if (ValidationBatchSize != null) - { - writer.WritePropertyName("validationBatchSize"u8); - writer.WriteNumberValue(ValidationBatchSize.Value); - } - else - { - writer.WriteNull("validationBatchSize"); - } - } - if (Optional.IsDefined(WarmupRatio)) - { - if (WarmupRatio != null) - { - writer.WritePropertyName("warmupRatio"u8); - writer.WriteNumberValue(WarmupRatio.Value); - } - else - { - writer.WriteNull("warmupRatio"); - } - } - if (Optional.IsDefined(WeightDecay)) - { - if (WeightDecay != null) - { - writer.WritePropertyName("weightDecay"u8); - writer.WriteNumberValue(WeightDecay.Value); - } - else - { - writer.WriteNull("weightDecay"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NlpFixedParameters 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(NlpFixedParameters)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNlpFixedParameters(document.RootElement, options); - } - - internal static NlpFixedParameters DeserializeNlpFixedParameters(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? gradientAccumulationSteps = default; - float? learningRate = default; - NlpLearningRateScheduler? learningRateScheduler = default; - string modelName = default; - int? numberOfEpochs = default; - int? trainingBatchSize = default; - int? validationBatchSize = default; - float? warmupRatio = default; - float? weightDecay = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("gradientAccumulationSteps"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - gradientAccumulationSteps = null; - continue; - } - gradientAccumulationSteps = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("learningRate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - learningRate = null; - continue; - } - learningRate = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("learningRateScheduler"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - learningRateScheduler = new NlpLearningRateScheduler(property.Value.GetString()); - continue; - } - if (property.NameEquals("modelName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - modelName = null; - continue; - } - modelName = property.Value.GetString(); - continue; - } - if (property.NameEquals("numberOfEpochs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - numberOfEpochs = null; - continue; - } - numberOfEpochs = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("trainingBatchSize"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - trainingBatchSize = null; - continue; - } - trainingBatchSize = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("validationBatchSize"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - validationBatchSize = null; - continue; - } - validationBatchSize = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("warmupRatio"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - warmupRatio = null; - continue; - } - warmupRatio = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("weightDecay"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - weightDecay = null; - continue; - } - weightDecay = property.Value.GetSingle(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NlpFixedParameters( - gradientAccumulationSteps, - learningRate, - learningRateScheduler, - modelName, - numberOfEpochs, - trainingBatchSize, - validationBatchSize, - warmupRatio, - weightDecay, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(NlpFixedParameters)} does not support writing '{options.Format}' format."); - } - } - - NlpFixedParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNlpFixedParameters(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NlpFixedParameters)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.cs deleted file mode 100644 index 3eba73123c656..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Fixed training parameters that won't be swept over during AutoML NLP training. - public partial class NlpFixedParameters - { - /// - /// 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 . - public NlpFixedParameters() - { - } - - /// Initializes a new instance of . - /// Number of steps to accumulate gradients over before running a backward pass. - /// The learning rate for the training procedure. - /// The type of learning rate schedule to use during the training procedure. - /// The name of the model to train. - /// Number of training epochs. - /// The batch size for the training procedure. - /// The batch size to be used during evaluation. - /// The warmup ratio, used alongside LrSchedulerType. - /// The weight decay for the training procedure. - /// Keeps track of any properties unknown to the library. - internal NlpFixedParameters(int? gradientAccumulationSteps, float? learningRate, NlpLearningRateScheduler? learningRateScheduler, string modelName, int? numberOfEpochs, int? trainingBatchSize, int? validationBatchSize, float? warmupRatio, float? weightDecay, IDictionary serializedAdditionalRawData) - { - GradientAccumulationSteps = gradientAccumulationSteps; - LearningRate = learningRate; - LearningRateScheduler = learningRateScheduler; - ModelName = modelName; - NumberOfEpochs = numberOfEpochs; - TrainingBatchSize = trainingBatchSize; - ValidationBatchSize = validationBatchSize; - WarmupRatio = warmupRatio; - WeightDecay = weightDecay; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Number of steps to accumulate gradients over before running a backward pass. - public int? GradientAccumulationSteps { get; set; } - /// The learning rate for the training procedure. - public float? LearningRate { get; set; } - /// The type of learning rate schedule to use during the training procedure. - public NlpLearningRateScheduler? LearningRateScheduler { get; set; } - /// The name of the model to train. - public string ModelName { get; set; } - /// Number of training epochs. - public int? NumberOfEpochs { get; set; } - /// The batch size for the training procedure. - public int? TrainingBatchSize { get; set; } - /// The batch size to be used during evaluation. - public int? ValidationBatchSize { get; set; } - /// The warmup ratio, used alongside LrSchedulerType. - public float? WarmupRatio { get; set; } - /// The weight decay for the training procedure. - public float? WeightDecay { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpLearningRateScheduler.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpLearningRateScheduler.cs deleted file mode 100644 index ec46849d480aa..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpLearningRateScheduler.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Enum of learning rate schedulers that aligns with those supported by HF. - public readonly partial struct NlpLearningRateScheduler : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public NlpLearningRateScheduler(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string LinearValue = "Linear"; - private const string CosineValue = "Cosine"; - private const string CosineWithRestartsValue = "CosineWithRestarts"; - private const string PolynomialValue = "Polynomial"; - private const string ConstantValue = "Constant"; - private const string ConstantWithWarmupValue = "ConstantWithWarmup"; - - /// No learning rate schedule. - public static NlpLearningRateScheduler None { get; } = new NlpLearningRateScheduler(NoneValue); - /// Linear warmup and decay. - public static NlpLearningRateScheduler Linear { get; } = new NlpLearningRateScheduler(LinearValue); - /// Linear warmup then cosine decay. - public static NlpLearningRateScheduler Cosine { get; } = new NlpLearningRateScheduler(CosineValue); - /// Linear warmup, cosine decay, then restart to initial LR. - public static NlpLearningRateScheduler CosineWithRestarts { get; } = new NlpLearningRateScheduler(CosineWithRestartsValue); - /// Increase linearly then polynomially decay. - public static NlpLearningRateScheduler Polynomial { get; } = new NlpLearningRateScheduler(PolynomialValue); - /// Constant learning rate. - public static NlpLearningRateScheduler Constant { get; } = new NlpLearningRateScheduler(ConstantValue); - /// Linear warmup followed by constant value. - public static NlpLearningRateScheduler ConstantWithWarmup { get; } = new NlpLearningRateScheduler(ConstantWithWarmupValue); - /// Determines if two values are the same. - public static bool operator ==(NlpLearningRateScheduler left, NlpLearningRateScheduler right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(NlpLearningRateScheduler left, NlpLearningRateScheduler right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator NlpLearningRateScheduler(string value) => new NlpLearningRateScheduler(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is NlpLearningRateScheduler other && Equals(other); - /// - public bool Equals(NlpLearningRateScheduler 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.Serialization.cs deleted file mode 100644 index 1ef1d9c0dfc22..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.Serialization.cs +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class NlpParameterSubspace : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NlpParameterSubspace)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(GradientAccumulationSteps)) - { - if (GradientAccumulationSteps != null) - { - writer.WritePropertyName("gradientAccumulationSteps"u8); - writer.WriteStringValue(GradientAccumulationSteps); - } - else - { - writer.WriteNull("gradientAccumulationSteps"); - } - } - if (Optional.IsDefined(LearningRate)) - { - if (LearningRate != null) - { - writer.WritePropertyName("learningRate"u8); - writer.WriteStringValue(LearningRate); - } - else - { - writer.WriteNull("learningRate"); - } - } - if (Optional.IsDefined(LearningRateScheduler)) - { - if (LearningRateScheduler != null) - { - writer.WritePropertyName("learningRateScheduler"u8); - writer.WriteStringValue(LearningRateScheduler); - } - else - { - writer.WriteNull("learningRateScheduler"); - } - } - if (Optional.IsDefined(ModelName)) - { - if (ModelName != null) - { - writer.WritePropertyName("modelName"u8); - writer.WriteStringValue(ModelName); - } - else - { - writer.WriteNull("modelName"); - } - } - if (Optional.IsDefined(NumberOfEpochs)) - { - if (NumberOfEpochs != null) - { - writer.WritePropertyName("numberOfEpochs"u8); - writer.WriteStringValue(NumberOfEpochs); - } - else - { - writer.WriteNull("numberOfEpochs"); - } - } - if (Optional.IsDefined(TrainingBatchSize)) - { - if (TrainingBatchSize != null) - { - writer.WritePropertyName("trainingBatchSize"u8); - writer.WriteStringValue(TrainingBatchSize); - } - else - { - writer.WriteNull("trainingBatchSize"); - } - } - if (Optional.IsDefined(ValidationBatchSize)) - { - if (ValidationBatchSize != null) - { - writer.WritePropertyName("validationBatchSize"u8); - writer.WriteStringValue(ValidationBatchSize); - } - else - { - writer.WriteNull("validationBatchSize"); - } - } - if (Optional.IsDefined(WarmupRatio)) - { - if (WarmupRatio != null) - { - writer.WritePropertyName("warmupRatio"u8); - writer.WriteStringValue(WarmupRatio); - } - else - { - writer.WriteNull("warmupRatio"); - } - } - if (Optional.IsDefined(WeightDecay)) - { - if (WeightDecay != null) - { - writer.WritePropertyName("weightDecay"u8); - writer.WriteStringValue(WeightDecay); - } - else - { - writer.WriteNull("weightDecay"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NlpParameterSubspace 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(NlpParameterSubspace)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNlpParameterSubspace(document.RootElement, options); - } - - internal static NlpParameterSubspace DeserializeNlpParameterSubspace(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string gradientAccumulationSteps = default; - string learningRate = default; - string learningRateScheduler = default; - string modelName = default; - string numberOfEpochs = default; - string trainingBatchSize = default; - string validationBatchSize = default; - string warmupRatio = default; - string weightDecay = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("gradientAccumulationSteps"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - gradientAccumulationSteps = null; - continue; - } - gradientAccumulationSteps = property.Value.GetString(); - continue; - } - if (property.NameEquals("learningRate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - learningRate = null; - continue; - } - learningRate = property.Value.GetString(); - continue; - } - if (property.NameEquals("learningRateScheduler"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - learningRateScheduler = null; - continue; - } - learningRateScheduler = property.Value.GetString(); - continue; - } - if (property.NameEquals("modelName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - modelName = null; - continue; - } - modelName = property.Value.GetString(); - continue; - } - if (property.NameEquals("numberOfEpochs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - numberOfEpochs = null; - continue; - } - numberOfEpochs = property.Value.GetString(); - continue; - } - if (property.NameEquals("trainingBatchSize"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - trainingBatchSize = null; - continue; - } - trainingBatchSize = property.Value.GetString(); - continue; - } - if (property.NameEquals("validationBatchSize"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - validationBatchSize = null; - continue; - } - validationBatchSize = property.Value.GetString(); - continue; - } - if (property.NameEquals("warmupRatio"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - warmupRatio = null; - continue; - } - warmupRatio = property.Value.GetString(); - continue; - } - if (property.NameEquals("weightDecay"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - weightDecay = null; - continue; - } - weightDecay = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NlpParameterSubspace( - gradientAccumulationSteps, - learningRate, - learningRateScheduler, - modelName, - numberOfEpochs, - trainingBatchSize, - validationBatchSize, - warmupRatio, - weightDecay, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(NlpParameterSubspace)} does not support writing '{options.Format}' format."); - } - } - - NlpParameterSubspace IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNlpParameterSubspace(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NlpParameterSubspace)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.cs deleted file mode 100644 index 1ea73070924a1..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Stringified search spaces for each parameter. See below examples. - public partial class NlpParameterSubspace - { - /// - /// 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 . - public NlpParameterSubspace() - { - } - - /// Initializes a new instance of . - /// Number of steps to accumulate gradients over before running a backward pass. - /// The learning rate for the training procedure. - /// The type of learning rate schedule to use during the training procedure. - /// The name of the model to train. - /// Number of training epochs. - /// The batch size for the training procedure. - /// The batch size to be used during evaluation. - /// The warmup ratio, used alongside LrSchedulerType. - /// The weight decay for the training procedure. - /// Keeps track of any properties unknown to the library. - internal NlpParameterSubspace(string gradientAccumulationSteps, string learningRate, string learningRateScheduler, string modelName, string numberOfEpochs, string trainingBatchSize, string validationBatchSize, string warmupRatio, string weightDecay, IDictionary serializedAdditionalRawData) - { - GradientAccumulationSteps = gradientAccumulationSteps; - LearningRate = learningRate; - LearningRateScheduler = learningRateScheduler; - ModelName = modelName; - NumberOfEpochs = numberOfEpochs; - TrainingBatchSize = trainingBatchSize; - ValidationBatchSize = validationBatchSize; - WarmupRatio = warmupRatio; - WeightDecay = weightDecay; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Number of steps to accumulate gradients over before running a backward pass. - public string GradientAccumulationSteps { get; set; } - /// The learning rate for the training procedure. - public string LearningRate { get; set; } - /// The type of learning rate schedule to use during the training procedure. - public string LearningRateScheduler { get; set; } - /// The name of the model to train. - public string ModelName { get; set; } - /// Number of training epochs. - public string NumberOfEpochs { get; set; } - /// The batch size for the training procedure. - public string TrainingBatchSize { get; set; } - /// The batch size to be used during evaluation. - public string ValidationBatchSize { get; set; } - /// The warmup ratio, used alongside LrSchedulerType. - public string WarmupRatio { get; set; } - /// The weight decay for the training procedure. - public string WeightDecay { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.Serialization.cs deleted file mode 100644 index c3c9710ad031e..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class NlpSweepSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NlpSweepSettings)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(EarlyTermination)) - { - if (EarlyTermination != null) - { - writer.WritePropertyName("earlyTermination"u8); - writer.WriteObjectValue(EarlyTermination, options); - } - else - { - writer.WriteNull("earlyTermination"); - } - } - writer.WritePropertyName("samplingAlgorithm"u8); - writer.WriteStringValue(SamplingAlgorithm.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NlpSweepSettings 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(NlpSweepSettings)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNlpSweepSettings(document.RootElement, options); - } - - internal static NlpSweepSettings DeserializeNlpSweepSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MachineLearningEarlyTerminationPolicy earlyTermination = default; - SamplingAlgorithmType samplingAlgorithm = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("earlyTermination"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - earlyTermination = null; - continue; - } - earlyTermination = MachineLearningEarlyTerminationPolicy.DeserializeMachineLearningEarlyTerminationPolicy(property.Value, options); - continue; - } - if (property.NameEquals("samplingAlgorithm"u8)) - { - samplingAlgorithm = new SamplingAlgorithmType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NlpSweepSettings(earlyTermination, samplingAlgorithm, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(NlpSweepSettings)} does not support writing '{options.Format}' format."); - } - } - - NlpSweepSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNlpSweepSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NlpSweepSettings)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.cs deleted file mode 100644 index 4dfb5f583517d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Model sweeping and hyperparameter tuning related settings. - public partial class NlpSweepSettings - { - /// - /// 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 . - /// [Required] Type of sampling algorithm. - public NlpSweepSettings(SamplingAlgorithmType samplingAlgorithm) - { - SamplingAlgorithm = samplingAlgorithm; - } - - /// Initializes a new instance of . - /// - /// Type of early termination policy for the sweeping job. - /// 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 . - /// - /// [Required] Type of sampling algorithm. - /// Keeps track of any properties unknown to the library. - internal NlpSweepSettings(MachineLearningEarlyTerminationPolicy earlyTermination, SamplingAlgorithmType samplingAlgorithm, IDictionary serializedAdditionalRawData) - { - EarlyTermination = earlyTermination; - SamplingAlgorithm = samplingAlgorithm; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NlpSweepSettings() - { - } - - /// - /// Type of early termination policy for the sweeping job. - /// 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 MachineLearningEarlyTerminationPolicy EarlyTermination { get; set; } - /// [Required] Type of sampling algorithm. - public SamplingAlgorithmType SamplingAlgorithm { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.Serialization.cs index 94cb191571c00..8cc83bff03bc9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.Serialization.cs @@ -31,11 +31,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WritePropertyName("maxConcurrentTrials"u8); writer.WriteNumberValue(MaxConcurrentTrials.Value); } - if (Optional.IsDefined(MaxNodes)) - { - writer.WritePropertyName("maxNodes"u8); - writer.WriteNumberValue(MaxNodes.Value); - } if (Optional.IsDefined(MaxTrials)) { writer.WritePropertyName("maxTrials"u8); @@ -46,11 +41,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WritePropertyName("timeout"u8); writer.WriteStringValue(Timeout.Value, "P"); } - if (Optional.IsDefined(TrialTimeout)) - { - writer.WritePropertyName("trialTimeout"u8); - writer.WriteStringValue(TrialTimeout.Value, "P"); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -90,10 +80,8 @@ internal static NlpVerticalLimitSettings DeserializeNlpVerticalLimitSettings(Jso return null; } int? maxConcurrentTrials = default; - int? maxNodes = default; int? maxTrials = default; TimeSpan? timeout = default; - TimeSpan? trialTimeout = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -107,15 +95,6 @@ internal static NlpVerticalLimitSettings DeserializeNlpVerticalLimitSettings(Jso maxConcurrentTrials = property.Value.GetInt32(); continue; } - if (property.NameEquals("maxNodes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxNodes = property.Value.GetInt32(); - continue; - } if (property.NameEquals("maxTrials"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -134,28 +113,13 @@ internal static NlpVerticalLimitSettings DeserializeNlpVerticalLimitSettings(Jso timeout = property.Value.GetTimeSpan("P"); continue; } - if (property.NameEquals("trialTimeout"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - trialTimeout = property.Value.GetTimeSpan("P"); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new NlpVerticalLimitSettings( - maxConcurrentTrials, - maxNodes, - maxTrials, - timeout, - trialTimeout, - serializedAdditionalRawData); + return new NlpVerticalLimitSettings(maxConcurrentTrials, maxTrials, timeout, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.cs index 84e4aa3257deb..6b5393c274eb3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.cs @@ -52,30 +52,22 @@ public NlpVerticalLimitSettings() /// Initializes a new instance of . /// Maximum Concurrent AutoML iterations. - /// Maximum nodes to use for the experiment. /// Number of AutoML iterations. /// AutoML job timeout. - /// Timeout for individual HD trials. /// Keeps track of any properties unknown to the library. - internal NlpVerticalLimitSettings(int? maxConcurrentTrials, int? maxNodes, int? maxTrials, TimeSpan? timeout, TimeSpan? trialTimeout, IDictionary serializedAdditionalRawData) + internal NlpVerticalLimitSettings(int? maxConcurrentTrials, int? maxTrials, TimeSpan? timeout, IDictionary serializedAdditionalRawData) { MaxConcurrentTrials = maxConcurrentTrials; - MaxNodes = maxNodes; MaxTrials = maxTrials; Timeout = timeout; - TrialTimeout = trialTimeout; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Maximum Concurrent AutoML iterations. public int? MaxConcurrentTrials { get; set; } - /// Maximum nodes to use for the experiment. - public int? MaxNodes { get; set; } /// Number of AutoML iterations. public int? MaxTrials { get; set; } /// AutoML job timeout. public TimeSpan? Timeout { get; set; } - /// Timeout for individual HD trials. - public TimeSpan? TrialTimeout { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NodesValueType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NodesValueType.cs index 07f7196726eca..353f2c25d82c2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NodesValueType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NodesValueType.cs @@ -23,12 +23,9 @@ public NodesValueType(string value) } private const string AllValue = "All"; - private const string CustomValue = "Custom"; /// All. public static NodesValueType All { get; } = new NodesValueType(AllValue); - /// Custom. - public static NodesValueType Custom { get; } = new NodesValueType(CustomValue); /// Determines if two values are the same. public static bool operator ==(NodesValueType left, NodesValueType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.Serialization.cs new file mode 100644 index 0000000000000..fc82e1b98c278 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class OAuth2AuthTypeWorkspaceConnectionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OAuth2AuthTypeWorkspaceConnectionProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + writer.WritePropertyName("authType"u8); + writer.WriteStringValue(AuthType.ToString()); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(ExpiryOn)) + { + writer.WritePropertyName("expiryTime"u8); + writer.WriteStringValue(ExpiryOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OAuth2AuthTypeWorkspaceConnectionProperties 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(OAuth2AuthTypeWorkspaceConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOAuth2AuthTypeWorkspaceConnectionProperties(document.RootElement, options); + } + + internal static OAuth2AuthTypeWorkspaceConnectionProperties DeserializeOAuth2AuthTypeWorkspaceConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WorkspaceConnectionOAuth2 credentials = default; + MachineLearningConnectionAuthType authType = default; + MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = WorkspaceConnectionOAuth2.DeserializeWorkspaceConnectionOAuth2(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new MachineLearningConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new MachineLearningConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OAuth2AuthTypeWorkspaceConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OAuth2AuthTypeWorkspaceConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + OAuth2AuthTypeWorkspaceConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOAuth2AuthTypeWorkspaceConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OAuth2AuthTypeWorkspaceConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.cs new file mode 100644 index 0000000000000..7385aab9bbac3 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The OAuth2AuthTypeWorkspaceConnectionProperties. + public partial class OAuth2AuthTypeWorkspaceConnectionProperties : MachineLearningWorkspaceConnectionProperties + { + /// Initializes a new instance of . + public OAuth2AuthTypeWorkspaceConnectionProperties() + { + AuthType = MachineLearningConnectionAuthType.OAuth2; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + internal OAuth2AuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionOAuth2 credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + public WorkspaceConnectionOAuth2 Credentials { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs new file mode 100644 index 0000000000000..dcc3aef7e0d98 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class OSPatchingStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OSPatchingStatus)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PatchStatus)) + { + writer.WritePropertyName("patchStatus"u8); + writer.WriteStringValue(PatchStatus.Value.ToString()); + } + if (Optional.IsDefined(LatestPatchOn)) + { + writer.WritePropertyName("latestPatchTime"u8); + writer.WriteStringValue(LatestPatchOn.Value, "O"); + } + if (Optional.IsDefined(RebootPending)) + { + writer.WritePropertyName("rebootPending"u8); + writer.WriteBooleanValue(RebootPending.Value); + } + if (Optional.IsDefined(ScheduledRebootOn)) + { + writer.WritePropertyName("scheduledRebootTime"u8); + writer.WriteStringValue(ScheduledRebootOn.Value, "O"); + } + if (Optional.IsCollectionDefined(OSPatchingErrors)) + { + if (OSPatchingErrors != null) + { + writer.WritePropertyName("osPatchingErrors"u8); + writer.WriteStartArray(); + foreach (var item in OSPatchingErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("osPatchingErrors"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OSPatchingStatus 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(OSPatchingStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOSPatchingStatus(document.RootElement, options); + } + + internal static OSPatchingStatus DeserializeOSPatchingStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PatchStatus? patchStatus = default; + DateTimeOffset? latestPatchTime = default; + bool? rebootPending = default; + DateTimeOffset? scheduledRebootTime = default; + IReadOnlyList osPatchingErrors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patchStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchStatus = new PatchStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestPatchTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + latestPatchTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("rebootPending"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rebootPending = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("scheduledRebootTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledRebootTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("osPatchingErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + osPatchingErrors = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MachineLearningError.DeserializeMachineLearningError(item, options)); + } + osPatchingErrors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OSPatchingStatus( + patchStatus, + latestPatchTime, + rebootPending, + scheduledRebootTime, + osPatchingErrors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OSPatchingStatus)} does not support writing '{options.Format}' format."); + } + } + + OSPatchingStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOSPatchingStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OSPatchingStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs new file mode 100644 index 0000000000000..5f9f0d128b84b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Returns metadata about the os patching. + public partial class OSPatchingStatus + { + /// + /// 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 OSPatchingStatus() + { + OSPatchingErrors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The os patching status. + /// Time of the latest os patching. + /// Specifies whether this compute instance is pending for reboot to finish os patching. + /// Time of scheduled reboot. + /// Collection of errors encountered when doing os patching. + /// Keeps track of any properties unknown to the library. + internal OSPatchingStatus(PatchStatus? patchStatus, DateTimeOffset? latestPatchOn, bool? rebootPending, DateTimeOffset? scheduledRebootOn, IReadOnlyList osPatchingErrors, IDictionary serializedAdditionalRawData) + { + PatchStatus = patchStatus; + LatestPatchOn = latestPatchOn; + RebootPending = rebootPending; + ScheduledRebootOn = scheduledRebootOn; + OSPatchingErrors = osPatchingErrors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The os patching status. + public PatchStatus? PatchStatus { get; } + /// Time of the latest os patching. + public DateTimeOffset? LatestPatchOn { get; } + /// Specifies whether this compute instance is pending for reboot to finish os patching. + public bool? RebootPending { get; } + /// Time of scheduled reboot. + public DateTimeOffset? ScheduledRebootOn { get; } + /// Collection of errors encountered when doing os patching. + public IReadOnlyList OSPatchingErrors { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.Serialization.cs index 0285b9b1e156a..9b7bd75301988 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.Serialization.cs @@ -51,18 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -160,7 +148,6 @@ internal static OneLakeDatastore DeserializeOneLakeDatastore(JsonElement element MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default; MachineLearningDatastoreCredentials credentials = default; DatastoreType datastoreType = default; - IntellectualProperty intellectualProperty = default; bool? isDefault = default; string description = default; IDictionary properties = default; @@ -208,16 +195,6 @@ internal static OneLakeDatastore DeserializeOneLakeDatastore(JsonElement element datastoreType = new DatastoreType(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("isDefault"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -280,7 +257,6 @@ internal static OneLakeDatastore DeserializeOneLakeDatastore(JsonElement element serializedAdditionalRawData, credentials, datastoreType, - intellectualProperty, isDefault, artifact, endpoint, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.cs index d8b9806c14781..e9e567d8bdbf7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.cs @@ -17,7 +17,7 @@ public partial class OneLakeDatastore : MachineLearningDatastoreProperties /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// /// [Required] OneLake artifact backing the datastore. @@ -45,10 +45,9 @@ public OneLakeDatastore(MachineLearningDatastoreCredentials credentials, OneLake /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// /// [Required] OneLake artifact backing the datastore. @@ -58,7 +57,7 @@ public OneLakeDatastore(MachineLearningDatastoreCredentials credentials, OneLake /// OneLake endpoint to use for the datastore. /// [Required] OneLake workspace name. /// Indicates which identity to use to authenticate service data access to customer's storage. - internal OneLakeDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault, OneLakeArtifact artifact, string endpoint, string oneLakeWorkspaceName, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) + internal OneLakeDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, OneLakeArtifact artifact, string endpoint, string oneLakeWorkspaceName, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) { Artifact = artifact; Endpoint = endpoint; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.Serialization.cs deleted file mode 100644 index 46b24553366ea..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.Serialization.cs +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class OnlineInferenceConfiguration : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(OnlineInferenceConfiguration)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Configurations)) - { - if (Configurations != null) - { - writer.WritePropertyName("configurations"u8); - writer.WriteStartObject(); - foreach (var item in Configurations) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("configurations"); - } - } - if (Optional.IsDefined(EntryScript)) - { - if (EntryScript != null) - { - writer.WritePropertyName("entryScript"u8); - writer.WriteStringValue(EntryScript); - } - else - { - writer.WriteNull("entryScript"); - } - } - if (Optional.IsDefined(LivenessRoute)) - { - if (LivenessRoute != null) - { - writer.WritePropertyName("livenessRoute"u8); - writer.WriteObjectValue(LivenessRoute, options); - } - else - { - writer.WriteNull("livenessRoute"); - } - } - if (Optional.IsDefined(ReadinessRoute)) - { - if (ReadinessRoute != null) - { - writer.WritePropertyName("readinessRoute"u8); - writer.WriteObjectValue(ReadinessRoute, options); - } - else - { - writer.WriteNull("readinessRoute"); - } - } - if (Optional.IsDefined(ScoringRoute)) - { - if (ScoringRoute != null) - { - writer.WritePropertyName("scoringRoute"u8); - writer.WriteObjectValue(ScoringRoute, options); - } - else - { - writer.WriteNull("scoringRoute"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - OnlineInferenceConfiguration 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(OnlineInferenceConfiguration)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOnlineInferenceConfiguration(document.RootElement, options); - } - - internal static OnlineInferenceConfiguration DeserializeOnlineInferenceConfiguration(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary configurations = default; - string entryScript = default; - MachineLearningInferenceContainerRoute livenessRoute = default; - MachineLearningInferenceContainerRoute readinessRoute = default; - MachineLearningInferenceContainerRoute scoringRoute = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("configurations"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - configurations = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - configurations = dictionary; - continue; - } - if (property.NameEquals("entryScript"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - entryScript = null; - continue; - } - entryScript = property.Value.GetString(); - continue; - } - if (property.NameEquals("livenessRoute"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - livenessRoute = null; - continue; - } - livenessRoute = MachineLearningInferenceContainerRoute.DeserializeMachineLearningInferenceContainerRoute(property.Value, options); - continue; - } - if (property.NameEquals("readinessRoute"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - readinessRoute = null; - continue; - } - readinessRoute = MachineLearningInferenceContainerRoute.DeserializeMachineLearningInferenceContainerRoute(property.Value, options); - continue; - } - if (property.NameEquals("scoringRoute"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - scoringRoute = null; - continue; - } - scoringRoute = MachineLearningInferenceContainerRoute.DeserializeMachineLearningInferenceContainerRoute(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new OnlineInferenceConfiguration( - configurations ?? new ChangeTrackingDictionary(), - entryScript, - livenessRoute, - readinessRoute, - scoringRoute, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(OnlineInferenceConfiguration)} does not support writing '{options.Format}' format."); - } - } - - OnlineInferenceConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeOnlineInferenceConfiguration(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(OnlineInferenceConfiguration)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.cs deleted file mode 100644 index 6f4c6a6fec16c..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Online inference configuration options. - public partial class OnlineInferenceConfiguration - { - /// - /// 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 . - public OnlineInferenceConfiguration() - { - Configurations = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Additional configurations. - /// Entry script or command to invoke. - /// The route to check the liveness of the inference server container. - /// The route to check the readiness of the inference server container. - /// The port to send the scoring requests to, within the inference server container. - /// Keeps track of any properties unknown to the library. - internal OnlineInferenceConfiguration(IDictionary configurations, string entryScript, MachineLearningInferenceContainerRoute livenessRoute, MachineLearningInferenceContainerRoute readinessRoute, MachineLearningInferenceContainerRoute scoringRoute, IDictionary serializedAdditionalRawData) - { - Configurations = configurations; - EntryScript = entryScript; - LivenessRoute = livenessRoute; - ReadinessRoute = readinessRoute; - ScoringRoute = scoringRoute; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Additional configurations. - public IDictionary Configurations { get; set; } - /// Entry script or command to invoke. - public string EntryScript { get; set; } - /// The route to check the liveness of the inference server container. - public MachineLearningInferenceContainerRoute LivenessRoute { get; set; } - /// The route to check the readiness of the inference server container. - public MachineLearningInferenceContainerRoute ReadinessRoute { get; set; } - /// The port to send the scoring requests to, within the inference server container. - public MachineLearningInferenceContainerRoute ScoringRoute { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..b4fd7a3ec41a4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class OpenAIEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIEndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (Optional.IsDefined(RaiPolicyName)) + { + writer.WritePropertyName("raiPolicyName"u8); + writer.WriteStringValue(RaiPolicyName); + } + if (Optional.IsDefined(VersionUpgradeOption)) + { + writer.WritePropertyName("versionUpgradeOption"u8); + writer.WriteStringValue(VersionUpgradeOption.Value.ToString()); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OpenAIEndpointDeploymentResourceProperties 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(OpenAIEndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenAIEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static OpenAIEndpointDeploymentResourceProperties DeserializeOpenAIEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointDeploymentModel model = default; + string raiPolicyName = default; + DeploymentModelVersionUpgradeOption? versionUpgradeOption = default; + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("model"u8)) + { + model = EndpointDeploymentModel.DeserializeEndpointDeploymentModel(property.Value, options); + continue; + } + if (property.NameEquals("raiPolicyName"u8)) + { + raiPolicyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("versionUpgradeOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + versionUpgradeOption = new DeploymentModelVersionUpgradeOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenAIEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + type, + serializedAdditionalRawData, + model, + raiPolicyName, + versionUpgradeOption); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenAIEndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + OpenAIEndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenAIEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenAIEndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.cs new file mode 100644 index 0000000000000..f735423231505 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The OpenAIEndpointDeploymentResourceProperties. + public partial class OpenAIEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + /// Model used for the endpoint deployment. + /// is null. + public OpenAIEndpointDeploymentResourceProperties(EndpointDeploymentModel model) + { + Argument.AssertNotNull(model, nameof(model)); + + Model = model; + EndpointDeploymentResourcePropertiesType = "Azure.OpenAI"; + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + internal OpenAIEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData, EndpointDeploymentModel model, string raiPolicyName, DeploymentModelVersionUpgradeOption? versionUpgradeOption) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + Model = model; + RaiPolicyName = raiPolicyName; + VersionUpgradeOption = versionUpgradeOption; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "Azure.OpenAI"; + } + + /// Initializes a new instance of for deserialization. + internal OpenAIEndpointDeploymentResourceProperties() + { + } + + /// Model used for the endpoint deployment. + public EndpointDeploymentModel Model { get; set; } + /// The name of RAI policy. + public string RaiPolicyName { get; set; } + /// Deployment model version upgrade option. + public DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..b79f2cb16cda8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class OpenAIEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OpenAIEndpointResourceProperties 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(OpenAIEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenAIEndpointResourceProperties(document.RootElement, options); + } + + internal static OpenAIEndpointResourceProperties DeserializeOpenAIEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenAIEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenAIEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + OpenAIEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenAIEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenAIEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.cs new file mode 100644 index 0000000000000..fe0f3b0685768 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The OpenAIEndpointResourceProperties. + public partial class OpenAIEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public OpenAIEndpointResourceProperties() + { + EndpointType = EndpointType.AzureOpenAI; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal OpenAIEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + EndpointType = endpointType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OutboundRuleCategory.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OutboundRuleCategory.cs index 7dfcd399a7d0d..dbd01ddb0c868 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OutboundRuleCategory.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OutboundRuleCategory.cs @@ -25,6 +25,7 @@ public OutboundRuleCategory(string value) private const string RequiredValue = "Required"; private const string RecommendedValue = "Recommended"; private const string UserDefinedValue = "UserDefined"; + private const string DependencyValue = "Dependency"; /// Required. public static OutboundRuleCategory Required { get; } = new OutboundRuleCategory(RequiredValue); @@ -32,6 +33,8 @@ public OutboundRuleCategory(string value) public static OutboundRuleCategory Recommended { get; } = new OutboundRuleCategory(RecommendedValue); /// UserDefined. public static OutboundRuleCategory UserDefined { get; } = new OutboundRuleCategory(UserDefinedValue); + /// Dependency. + public static OutboundRuleCategory Dependency { get; } = new OutboundRuleCategory(DependencyValue); /// Determines if two values are the same. public static bool operator ==(OutboundRuleCategory left, OutboundRuleCategory right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageBuildState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageBuildState.cs deleted file mode 100644 index 1ab14a151d716..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageBuildState.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Package build state returned in package response. - public readonly partial struct PackageBuildState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public PackageBuildState(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"; - - /// NotStarted. - public static PackageBuildState NotStarted { get; } = new PackageBuildState(NotStartedValue); - /// Running. - public static PackageBuildState Running { get; } = new PackageBuildState(RunningValue); - /// Succeeded. - public static PackageBuildState Succeeded { get; } = new PackageBuildState(SucceededValue); - /// Failed. - public static PackageBuildState Failed { get; } = new PackageBuildState(FailedValue); - /// Determines if two values are the same. - public static bool operator ==(PackageBuildState left, PackageBuildState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PackageBuildState left, PackageBuildState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PackageBuildState(string value) => new PackageBuildState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PackageBuildState other && Equals(other); - /// - public bool Equals(PackageBuildState 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputDeliveryMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputDeliveryMode.cs deleted file mode 100644 index 5b0c9b3e57e30..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputDeliveryMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Mounting type of the model or the inputs. - public readonly partial struct PackageInputDeliveryMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public PackageInputDeliveryMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CopyValue = "Copy"; - private const string DownloadValue = "Download"; - - /// Copy. - public static PackageInputDeliveryMode Copy { get; } = new PackageInputDeliveryMode(CopyValue); - /// Download. - public static PackageInputDeliveryMode Download { get; } = new PackageInputDeliveryMode(DownloadValue); - /// Determines if two values are the same. - public static bool operator ==(PackageInputDeliveryMode left, PackageInputDeliveryMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PackageInputDeliveryMode left, PackageInputDeliveryMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PackageInputDeliveryMode(string value) => new PackageInputDeliveryMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PackageInputDeliveryMode other && Equals(other); - /// - public bool Equals(PackageInputDeliveryMode 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.Serialization.cs deleted file mode 100644 index df687ee6bbf85..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.Serialization.cs +++ /dev/null @@ -1,112 +0,0 @@ -// 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.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownPackageInputPathBase))] - public partial class PackageInputPathBase : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("inputPathType"u8); - writer.WriteStringValue(InputPathType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PackageInputPathBase 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(PackageInputPathBase)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePackageInputPathBase(document.RootElement, options); - } - - internal static PackageInputPathBase DeserializePackageInputPathBase(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("inputPathType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "PathId": return PackageInputPathId.DeserializePackageInputPathId(element, options); - case "PathVersion": return PackageInputPathVersion.DeserializePackageInputPathVersion(element, options); - case "Url": return PackageInputPathUri.DeserializePackageInputPathUri(element, options); - } - } - return UnknownPackageInputPathBase.DeserializeUnknownPackageInputPathBase(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); - default: - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support writing '{options.Format}' format."); - } - } - - PackageInputPathBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePackageInputPathBase(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.cs deleted file mode 100644 index 0a248dc409f05..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// - /// 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 PackageInputPathBase - { - /// - /// 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 PackageInputPathBase() - { - } - - /// Initializes a new instance of . - /// [Required] Input path type for package inputs. - /// Keeps track of any properties unknown to the library. - internal PackageInputPathBase(InputPathType inputPathType, IDictionary serializedAdditionalRawData) - { - InputPathType = inputPathType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// [Required] Input path type for package inputs. - internal InputPathType InputPathType { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.cs deleted file mode 100644 index 001c51424c593..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Package input path specified with a resource id. - public partial class PackageInputPathId : PackageInputPathBase - { - /// Initializes a new instance of . - public PackageInputPathId() - { - InputPathType = InputPathType.PathId; - } - - /// Initializes a new instance of . - /// [Required] Input path type for package inputs. - /// Keeps track of any properties unknown to the library. - /// Input resource id. - internal PackageInputPathId(InputPathType inputPathType, IDictionary serializedAdditionalRawData, ResourceIdentifier resourceId) : base(inputPathType, serializedAdditionalRawData) - { - ResourceId = resourceId; - InputPathType = inputPathType; - } - - /// Input resource id. - public ResourceIdentifier ResourceId { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.cs deleted file mode 100644 index d7e7796ef8dad..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Package input path specified as an url. - public partial class PackageInputPathUri : PackageInputPathBase - { - /// Initializes a new instance of . - public PackageInputPathUri() - { - InputPathType = InputPathType.Url; - } - - /// Initializes a new instance of . - /// [Required] Input path type for package inputs. - /// Keeps track of any properties unknown to the library. - /// Input path url. - internal PackageInputPathUri(InputPathType inputPathType, IDictionary serializedAdditionalRawData, Uri uri) : base(inputPathType, serializedAdditionalRawData) - { - Uri = uri; - InputPathType = inputPathType; - } - - /// Input path url. - public Uri Uri { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.cs deleted file mode 100644 index 447ed515fe2ac..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Package input path specified with name and version. - public partial class PackageInputPathVersion : PackageInputPathBase - { - /// Initializes a new instance of . - public PackageInputPathVersion() - { - InputPathType = InputPathType.PathVersion; - } - - /// Initializes a new instance of . - /// [Required] Input path type for package inputs. - /// Keeps track of any properties unknown to the library. - /// Input resource name. - /// Input resource version. - internal PackageInputPathVersion(InputPathType inputPathType, IDictionary serializedAdditionalRawData, string resourceName, string resourceVersion) : base(inputPathType, serializedAdditionalRawData) - { - ResourceName = resourceName; - ResourceVersion = resourceVersion; - InputPathType = inputPathType; - } - - /// Input resource name. - public string ResourceName { get; set; } - /// Input resource version. - public string ResourceVersion { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputType.cs deleted file mode 100644 index bbc96f6eb69ba..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Type of the inputs. - public readonly partial struct PackageInputType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public PackageInputType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UriFileValue = "UriFile"; - private const string UriFolderValue = "UriFolder"; - - /// UriFile. - public static PackageInputType UriFile { get; } = new PackageInputType(UriFileValue); - /// UriFolder. - public static PackageInputType UriFolder { get; } = new PackageInputType(UriFolderValue); - /// Determines if two values are the same. - public static bool operator ==(PackageInputType left, PackageInputType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PackageInputType left, PackageInputType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PackageInputType(string value) => new PackageInputType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PackageInputType other && Equals(other); - /// - public bool Equals(PackageInputType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.cs deleted file mode 100644 index 8beceb33a03fa..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Mutable base definition for a job. - internal partial class PartialJobBase - { - /// - /// 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 . - public PartialJobBase() - { - } - - /// Initializes a new instance of . - /// Mutable notification setting for the job. - /// Keeps track of any properties unknown to the library. - internal PartialJobBase(PartialNotificationSetting notificationSetting, IDictionary serializedAdditionalRawData) - { - NotificationSetting = notificationSetting; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Mutable notification setting for the job. - internal PartialNotificationSetting NotificationSetting { get; set; } - /// - /// Send webhook callback to a service. Key is a user-provided name for the webhook. - /// 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 . - /// - public IDictionary NotificationSettingWebhooks - { - get => NotificationSetting is null ? default : NotificationSetting.Webhooks; - set - { - if (NotificationSetting is null) - NotificationSetting = new PartialNotificationSetting(); - NotificationSetting.Webhooks = value; - } - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.cs deleted file mode 100644 index 4a30a8a6245dd..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Mutable configuration for notification. - internal partial class PartialNotificationSetting - { - /// - /// 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 . - public PartialNotificationSetting() - { - Webhooks = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// - /// Send webhook callback to a service. Key is a user-provided name for the webhook. - /// 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 . - /// - /// Keeps track of any properties unknown to the library. - internal PartialNotificationSetting(IDictionary webhooks, IDictionary serializedAdditionalRawData) - { - Webhooks = webhooks; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// - /// Send webhook callback to a service. Key is a user-provided name for the webhook. - /// 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 . - /// - public IDictionary Webhooks { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PatchStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PatchStatus.cs new file mode 100644 index 0000000000000..cf568facb6ea5 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PatchStatus.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 Azure.ResourceManager.MachineLearning.Models +{ + /// The os patching status. + public readonly partial struct PatchStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatchStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CompletedWithWarningsValue = "CompletedWithWarnings"; + private const string FailedValue = "Failed"; + private const string InProgressValue = "InProgress"; + private const string SucceededValue = "Succeeded"; + private const string UnknownValue = "Unknown"; + + /// CompletedWithWarnings. + public static PatchStatus CompletedWithWarnings { get; } = new PatchStatus(CompletedWithWarningsValue); + /// Failed. + public static PatchStatus Failed { get; } = new PatchStatus(FailedValue); + /// InProgress. + public static PatchStatus InProgress { get; } = new PatchStatus(InProgressValue); + /// Succeeded. + public static PatchStatus Succeeded { get; } = new PatchStatus(SucceededValue); + /// Unknown. + public static PatchStatus Unknown { get; } = new PatchStatus(UnknownValue); + /// Determines if two values are the same. + public static bool operator ==(PatchStatus left, PatchStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatchStatus left, PatchStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PatchStatus(string value) => new PatchStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatchStatus other && Equals(other); + /// + public bool Equals(PatchStatus 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.Serialization.cs index aaa92c6eb6f91..8b0d116bb9ad8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.Serialization.cs @@ -26,6 +26,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); + if (Optional.IsCollectionDefined(FeatureDataTypeOverride)) + { + if (FeatureDataTypeOverride != null) + { + writer.WritePropertyName("featureDataTypeOverride"u8); + writer.WriteStartObject(); + foreach (var item in FeatureDataTypeOverride) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value.ToString()); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("featureDataTypeOverride"); + } + } writer.WritePropertyName("metricThresholds"u8); writer.WriteStartArray(); foreach (var item in MetricThresholds) @@ -33,16 +51,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("modelType"u8); - writer.WriteStringValue(ModelType.ToString()); writer.WritePropertyName("productionData"u8); writer.WriteObjectValue(ProductionData, options); writer.WritePropertyName("referenceData"u8); writer.WriteObjectValue(ReferenceData, options); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -102,17 +130,32 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito { return null; } + IDictionary featureDataTypeOverride = default; IList metricThresholds = default; - MonitoringModelType modelType = default; MonitoringInputDataBase productionData = default; MonitoringInputDataBase referenceData = default; - MonitoringNotificationMode? mode = default; + IList notificationTypes = default; IDictionary properties = default; MonitoringSignalType signalType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("featureDataTypeOverride"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureDataTypeOverride = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, new MonitoringFeatureDataType(property0.Value.GetString())); + } + featureDataTypeOverride = dictionary; + continue; + } if (property.NameEquals("metricThresholds"u8)) { List array = new List(); @@ -123,11 +166,6 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito metricThresholds = array; continue; } - if (property.NameEquals("modelType"u8)) - { - modelType = new MonitoringModelType(property.Value.GetString()); - continue; - } if (property.NameEquals("productionData"u8)) { productionData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); @@ -138,13 +176,19 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); continue; } - if (property.NameEquals("mode"u8)) + if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + notificationTypes = null; continue; } - mode = new MonitoringNotificationMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MonitoringNotificationType(item.GetString())); + } + notificationTypes = array; continue; } if (property.NameEquals("properties"u8)) @@ -174,12 +218,12 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito } serializedAdditionalRawData = rawDataDictionary; return new PredictionDriftMonitoringSignal( - mode, + notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData, + featureDataTypeOverride ?? new ChangeTrackingDictionary(), metricThresholds, - modelType, productionData, referenceData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.cs index 21102724df894..f26fdd50121ba 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.cs @@ -20,56 +20,55 @@ public partial class PredictionDriftMonitoringSignal : MonitoringSignalBase /// 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 . /// - /// [Required] The type of the model monitored. /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// , or is null. - public PredictionDriftMonitoringSignal(IEnumerable metricThresholds, MonitoringModelType modelType, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) + public PredictionDriftMonitoringSignal(IEnumerable metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) { Argument.AssertNotNull(metricThresholds, nameof(metricThresholds)); Argument.AssertNotNull(productionData, nameof(productionData)); Argument.AssertNotNull(referenceData, nameof(referenceData)); + FeatureDataTypeOverride = new ChangeTrackingDictionary(); MetricThresholds = metricThresholds.ToList(); - ModelType = modelType; ProductionData = productionData; ReferenceData = referenceData; SignalType = MonitoringSignalType.PredictionDrift; } /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. + /// A dictionary that maps feature names to their respective data types. /// /// [Required] A list of metrics to calculate and their associated thresholds. /// 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 . /// - /// [Required] The type of the model monitored. /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// - internal PredictionDriftMonitoringSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IList metricThresholds, MonitoringModelType modelType, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(mode, properties, signalType, serializedAdditionalRawData) + internal PredictionDriftMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) { + FeatureDataTypeOverride = featureDataTypeOverride; MetricThresholds = metricThresholds; - ModelType = modelType; ProductionData = productionData; ReferenceData = referenceData; SignalType = signalType; @@ -80,24 +79,24 @@ internal PredictionDriftMonitoringSignal() { } + /// A dictionary that maps feature names to their respective data types. + public IDictionary FeatureDataTypeOverride { get; set; } /// /// [Required] A list of metrics to calculate and their associated thresholds. /// 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 MetricThresholds { get; } - /// [Required] The type of the model monitored. - public MonitoringModelType ModelType { get; set; } /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ProductionData { get; set; } /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ReferenceData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.Serialization.cs index 55a1a92f389ca..5504cb6b48a21 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.Serialization.cs @@ -84,7 +84,7 @@ internal static PrivateEndpointDestination DeserializePrivateEndpointDestination { return null; } - string serviceResourceId = default; + ResourceIdentifier serviceResourceId = default; bool? sparkEnabled = default; OutboundRuleStatus? sparkStatus = default; string subresourceTarget = default; @@ -94,7 +94,11 @@ internal static PrivateEndpointDestination DeserializePrivateEndpointDestination { if (property.NameEquals("serviceResourceId"u8)) { - serviceResourceId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceResourceId = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("sparkEnabled"u8)) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.cs index 29be5c6cb4878..73e8226e5e02b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -56,7 +57,7 @@ public PrivateEndpointDestination() /// Type of a managed network Outbound Rule of a machine learning workspace. /// /// Keeps track of any properties unknown to the library. - internal PrivateEndpointDestination(string serviceResourceId, bool? sparkEnabled, OutboundRuleStatus? sparkStatus, string subresourceTarget, IDictionary serializedAdditionalRawData) + internal PrivateEndpointDestination(ResourceIdentifier serviceResourceId, bool? sparkEnabled, OutboundRuleStatus? sparkStatus, string subresourceTarget, IDictionary serializedAdditionalRawData) { ServiceResourceId = serviceResourceId; SparkEnabled = sparkEnabled; @@ -66,7 +67,7 @@ internal PrivateEndpointDestination(string serviceResourceId, bool? sparkEnabled } /// Gets or sets the service resource id. - public string ServiceResourceId { get; set; } + public ResourceIdentifier ServiceResourceId { get; set; } /// Gets or sets the spark enabled. public bool? SparkEnabled { get; set; } /// Type of a managed network Outbound Rule of a machine learning workspace. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.Serialization.cs index 01e9b4c88fa7b..7e66f6fa245ea 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.Serialization.cs @@ -31,11 +31,31 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("destination"u8); writer.WriteObjectValue(Destination, options); } + if (Optional.IsCollectionDefined(Fqdns)) + { + writer.WritePropertyName("fqdns"u8); + writer.WriteStartArray(); + foreach (var item in Fqdns) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Category)) { writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -82,7 +102,9 @@ internal static PrivateEndpointOutboundRule DeserializePrivateEndpointOutboundRu return null; } PrivateEndpointDestination destination = default; + IList fqdns = default; OutboundRuleCategory? category = default; + IReadOnlyList parentRuleNames = default; OutboundRuleStatus? status = default; OutboundRuleType type = default; IDictionary serializedAdditionalRawData = default; @@ -98,6 +120,20 @@ internal static PrivateEndpointOutboundRule DeserializePrivateEndpointOutboundRu destination = PrivateEndpointDestination.DeserializePrivateEndpointDestination(property.Value, options); continue; } + if (property.NameEquals("fqdns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + fqdns = array; + continue; + } if (property.NameEquals("category"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -107,6 +143,20 @@ internal static PrivateEndpointOutboundRule DeserializePrivateEndpointOutboundRu category = new OutboundRuleCategory(property.Value.GetString()); continue; } + if (property.NameEquals("parentRuleNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parentRuleNames = array; + continue; + } if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -127,7 +177,14 @@ internal static PrivateEndpointOutboundRule DeserializePrivateEndpointOutboundRu } } serializedAdditionalRawData = rawDataDictionary; - return new PrivateEndpointOutboundRule(category, status, type, serializedAdditionalRawData, destination); + return new PrivateEndpointOutboundRule( + category, + parentRuleNames ?? new ChangeTrackingList(), + status, + type, + serializedAdditionalRawData, + destination, + fqdns ?? new ChangeTrackingList()); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.cs index 320e28bbee68a..429377fc8c6d9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.cs @@ -16,22 +16,28 @@ public partial class PrivateEndpointOutboundRule : MachineLearningOutboundRule /// Initializes a new instance of . public PrivateEndpointOutboundRule() { + Fqdns = new ChangeTrackingList(); OutboundRuleType = OutboundRuleType.PrivateEndpoint; } /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. /// Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - internal PrivateEndpointOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, PrivateEndpointDestination destination) : base(category, status, outboundRuleType, serializedAdditionalRawData) + /// + internal PrivateEndpointOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, PrivateEndpointDestination destination, IList fqdns) : base(category, parentRuleNames, status, outboundRuleType, serializedAdditionalRawData) { Destination = destination; + Fqdns = fqdns; OutboundRuleType = outboundRuleType; } /// Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. public PrivateEndpointDestination Destination { get; set; } + /// Gets the fqdns. + public IList Fqdns { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.Serialization.cs deleted file mode 100644 index b84a38300209a..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.Serialization.cs +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ProgressMetrics : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProgressMetrics)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(CompletedDatapointCount)) - { - if (CompletedDatapointCount != null) - { - writer.WritePropertyName("completedDatapointCount"u8); - writer.WriteNumberValue(CompletedDatapointCount.Value); - } - else - { - writer.WriteNull("completedDatapointCount"); - } - } - if (options.Format != "W" && Optional.IsDefined(IncrementalDataLastRefreshOn)) - { - if (IncrementalDataLastRefreshOn != null) - { - writer.WritePropertyName("incrementalDataLastRefreshDateTime"u8); - writer.WriteStringValue(IncrementalDataLastRefreshOn.Value, "O"); - } - else - { - writer.WriteNull("incrementalDataLastRefreshDateTime"); - } - } - if (options.Format != "W" && Optional.IsDefined(SkippedDatapointCount)) - { - if (SkippedDatapointCount != null) - { - writer.WritePropertyName("skippedDatapointCount"u8); - writer.WriteNumberValue(SkippedDatapointCount.Value); - } - else - { - writer.WriteNull("skippedDatapointCount"); - } - } - if (options.Format != "W" && Optional.IsDefined(TotalDatapointCount)) - { - if (TotalDatapointCount != null) - { - writer.WritePropertyName("totalDatapointCount"u8); - writer.WriteNumberValue(TotalDatapointCount.Value); - } - else - { - writer.WriteNull("totalDatapointCount"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ProgressMetrics 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(ProgressMetrics)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProgressMetrics(document.RootElement, options); - } - - internal static ProgressMetrics DeserializeProgressMetrics(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - long? completedDatapointCount = default; - DateTimeOffset? incrementalDataLastRefreshDateTime = default; - long? skippedDatapointCount = default; - long? totalDatapointCount = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("completedDatapointCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - completedDatapointCount = null; - continue; - } - completedDatapointCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("incrementalDataLastRefreshDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - incrementalDataLastRefreshDateTime = null; - continue; - } - incrementalDataLastRefreshDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("skippedDatapointCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - skippedDatapointCount = null; - continue; - } - skippedDatapointCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("totalDatapointCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - totalDatapointCount = null; - continue; - } - totalDatapointCount = property.Value.GetInt64(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ProgressMetrics(completedDatapointCount, incrementalDataLastRefreshDateTime, skippedDatapointCount, totalDatapointCount, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ProgressMetrics)} does not support writing '{options.Format}' format."); - } - } - - ProgressMetrics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProgressMetrics(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ProgressMetrics)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.cs deleted file mode 100644 index e198cc2b3f3a2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Progress metrics definition. - public partial class ProgressMetrics - { - /// - /// 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 ProgressMetrics() - { - } - - /// Initializes a new instance of . - /// The completed datapoint count. - /// The time of last successful incremental data refresh in UTC. - /// The skipped datapoint count. - /// The total datapoint count. - /// Keeps track of any properties unknown to the library. - internal ProgressMetrics(long? completedDatapointCount, DateTimeOffset? incrementalDataLastRefreshOn, long? skippedDatapointCount, long? totalDatapointCount, IDictionary serializedAdditionalRawData) - { - CompletedDatapointCount = completedDatapointCount; - IncrementalDataLastRefreshOn = incrementalDataLastRefreshOn; - SkippedDatapointCount = skippedDatapointCount; - TotalDatapointCount = totalDatapointCount; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The completed datapoint count. - public long? CompletedDatapointCount { get; } - /// The time of last successful incremental data refresh in UTC. - public DateTimeOffset? IncrementalDataLastRefreshOn { get; } - /// The skipped datapoint count. - public long? SkippedDatapointCount { get; } - /// The total datapoint count. - public long? TotalDatapointCount { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.Serialization.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.Serialization.cs index 2cf86537a7260..129c212193248 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.Serialization.cs @@ -13,33 +13,29 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class PackageInputPathId : IUtf8JsonSerializable, IJsonModel + public partial class RaiBlocklistConfig : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathId)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(ResourceId)) + if (Optional.IsDefined(Blocking)) { - if (ResourceId != null) - { - writer.WritePropertyName("resourceId"u8); - writer.WriteStringValue(ResourceId); - } - else - { - writer.WriteNull("resourceId"); - } + writer.WritePropertyName("blocking"u8); + writer.WriteBooleanValue(Blocking.Value); + } + if (Optional.IsDefined(BlocklistName)) + { + writer.WritePropertyName("blocklistName"u8); + writer.WriteStringValue(BlocklistName); } - writer.WritePropertyName("inputPathType"u8); - writer.WriteStringValue(InputPathType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - PackageInputPathId IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RaiBlocklistConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathId)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePackageInputPathId(document.RootElement, options); + return DeserializeRaiBlocklistConfig(document.RootElement, options); } - internal static PackageInputPathId DeserializePackageInputPathId(JsonElement element, ModelReaderWriterOptions options = null) + internal static RaiBlocklistConfig DeserializeRaiBlocklistConfig(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +74,24 @@ internal static PackageInputPathId DeserializePackageInputPathId(JsonElement ele { return null; } - ResourceIdentifier resourceId = default; - InputPathType inputPathType = default; + bool? blocking = default; + string blocklistName = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("resourceId"u8)) + if (property.NameEquals("blocking"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - resourceId = null; continue; } - resourceId = new ResourceIdentifier(property.Value.GetString()); + blocking = property.Value.GetBoolean(); continue; } - if (property.NameEquals("inputPathType"u8)) + if (property.NameEquals("blocklistName"u8)) { - inputPathType = new InputPathType(property.Value.GetString()); + blocklistName = property.Value.GetString(); continue; } if (options.Format != "W") @@ -105,38 +100,38 @@ internal static PackageInputPathId DeserializePackageInputPathId(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new PackageInputPathId(inputPathType, serializedAdditionalRawData, resourceId); + return new RaiBlocklistConfig(blocking, blocklistName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PackageInputPathId)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support writing '{options.Format}' format."); } } - PackageInputPathId IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RaiBlocklistConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePackageInputPathId(document.RootElement, options); + return DeserializeRaiBlocklistConfig(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PackageInputPathId)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.cs new file mode 100644 index 0000000000000..83e1be0f35feb --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure OpenAI blocklist config. + public partial class RaiBlocklistConfig + { + /// + /// 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 . + public RaiBlocklistConfig() + { + } + + /// Initializes a new instance of . + /// If blocking would occur. + /// Name of ContentFilter. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistConfig(bool? blocking, string blocklistName, IDictionary serializedAdditionalRawData) + { + Blocking = blocking; + BlocklistName = blocklistName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If blocking would occur. + public bool? Blocking { get; set; } + /// Name of ContentFilter. + public string BlocklistName { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.Serialization.cs new file mode 100644 index 0000000000000..23dade87b9638 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RaiBlocklistItemBulkRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemBulkRequest)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistItemBulkRequest 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(RaiBlocklistItemBulkRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistItemBulkRequest(document.RootElement, options); + } + + internal static RaiBlocklistItemBulkRequest DeserializeRaiBlocklistItemBulkRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + RaiBlocklistItemProperties 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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = RaiBlocklistItemProperties.DeserializeRaiBlocklistItemProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistItemBulkRequest(name, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemBulkRequest)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistItemBulkRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistItemBulkRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemBulkRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.cs new file mode 100644 index 0000000000000..b29c159c5854d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The Cognitive Services RaiBlocklist Item request body. + public partial class RaiBlocklistItemBulkRequest + { + /// + /// 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 . + public RaiBlocklistItemBulkRequest() + { + } + + /// Initializes a new instance of . + /// + /// Properties of Cognitive Services RaiBlocklist Item. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistItemBulkRequest(string name, RaiBlocklistItemProperties properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the name. + public string Name { get; set; } + /// Properties of Cognitive Services RaiBlocklist Item. + public RaiBlocklistItemProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.Serialization.cs similarity index 61% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.Serialization.cs index 8e8b847b24707..7f1f607d80f7f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.Serialization.cs @@ -13,26 +13,29 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class LabelingJobImageProperties : IUtf8JsonSerializable, IJsonModel + public partial class RaiBlocklistItemProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobImageProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistItemProperties)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(AnnotationType)) + if (Optional.IsDefined(IsRegex)) { - writer.WritePropertyName("annotationType"u8); - writer.WriteStringValue(AnnotationType.Value.ToString()); + writer.WritePropertyName("isRegex"u8); + writer.WriteBooleanValue(IsRegex.Value); + } + if (Optional.IsDefined(Pattern)) + { + writer.WritePropertyName("pattern"u8); + writer.WriteStringValue(Pattern); } - writer.WritePropertyName("mediaType"u8); - writer.WriteStringValue(MediaType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -51,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - LabelingJobImageProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RaiBlocklistItemProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobImageProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistItemProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobImageProperties(document.RootElement, options); + return DeserializeRaiBlocklistItemProperties(document.RootElement, options); } - internal static LabelingJobImageProperties DeserializeLabelingJobImageProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static RaiBlocklistItemProperties DeserializeRaiBlocklistItemProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -71,24 +74,24 @@ internal static LabelingJobImageProperties DeserializeLabelingJobImageProperties { return null; } - ImageAnnotationType? annotationType = default; - MediaType mediaType = default; + bool? isRegex = default; + string pattern = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("annotationType"u8)) + if (property.NameEquals("isRegex"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - annotationType = new ImageAnnotationType(property.Value.GetString()); + isRegex = property.Value.GetBoolean(); continue; } - if (property.NameEquals("mediaType"u8)) + if (property.NameEquals("pattern"u8)) { - mediaType = new MediaType(property.Value.GetString()); + pattern = property.Value.GetString(); continue; } if (options.Format != "W") @@ -97,38 +100,38 @@ internal static LabelingJobImageProperties DeserializeLabelingJobImageProperties } } serializedAdditionalRawData = rawDataDictionary; - return new LabelingJobImageProperties(mediaType, serializedAdditionalRawData, annotationType); + return new RaiBlocklistItemProperties(isRegex, pattern, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingJobImageProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistItemProperties)} does not support writing '{options.Format}' format."); } } - LabelingJobImageProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RaiBlocklistItemProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobImageProperties(document.RootElement, options); + return DeserializeRaiBlocklistItemProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingJobImageProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistItemProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.cs new file mode 100644 index 0000000000000..73f38f3c677c4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// RAI Custom Blocklist Item properties. + public partial class RaiBlocklistItemProperties + { + /// + /// 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 . + public RaiBlocklistItemProperties() + { + } + + /// Initializes a new instance of . + /// If the pattern is a regex pattern. + /// Pattern to match against. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistItemProperties(bool? isRegex, string pattern, IDictionary serializedAdditionalRawData) + { + IsRegex = isRegex; + Pattern = pattern; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If the pattern is a regex pattern. + public bool? IsRegex { get; set; } + /// Pattern to match against. + public string Pattern { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 0000000000000..b0cfc60cff313 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult 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(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 0000000000000..44ebeba3ee013 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult. + internal partial class RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult + { + /// + /// 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 RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.Serialization.cs similarity index 55% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.Serialization.cs index 34e84a4dc0438..13ba791cccfe3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class UnknownLabelingJobMediaProperties : IUtf8JsonSerializable, IJsonModel + public partial class RaiBlocklistProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistProperties)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("mediaType"u8); - writer.WriteStringValue(MediaType.ToString()); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - LabelingJobMediaProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RaiBlocklistProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobMediaProperties(document.RootElement, options); + return DeserializeRaiBlocklistProperties(document.RootElement, options); } - internal static UnknownLabelingJobMediaProperties DeserializeUnknownLabelingJobMediaProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static RaiBlocklistProperties DeserializeRaiBlocklistProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +69,14 @@ internal static UnknownLabelingJobMediaProperties DeserializeUnknownLabelingJobM { return null; } - MediaType mediaType = "Unknown"; + string description = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mediaType"u8)) + if (property.NameEquals("description"u8)) { - mediaType = new MediaType(property.Value.GetString()); + description = property.Value.GetString(); continue; } if (options.Format != "W") @@ -82,38 +85,38 @@ internal static UnknownLabelingJobMediaProperties DeserializeUnknownLabelingJobM } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownLabelingJobMediaProperties(mediaType, serializedAdditionalRawData); + return new RaiBlocklistProperties(description, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistProperties)} does not support writing '{options.Format}' format."); } } - LabelingJobMediaProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RaiBlocklistProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobMediaProperties(document.RootElement, options); + return DeserializeRaiBlocklistProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.cs new file mode 100644 index 0000000000000..616e6f5311a22 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// RAI Custom Blocklist properties. + public partial class RaiBlocklistProperties + { + /// + /// 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 . + public RaiBlocklistProperties() + { + } + + /// Initializes a new instance of . + /// Description of the block list. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistProperties(string description, IDictionary serializedAdditionalRawData) + { + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Description of the block list. + public string Description { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 0000000000000..bcaa0b6f547bd --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class RaiBlocklistPropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistPropertiesBasicResourceArmPaginatedResult 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(RaiBlocklistPropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static RaiBlocklistPropertiesBasicResourceArmPaginatedResult DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistPropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistPropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 0000000000000..79e77b0814ef0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The RaiBlocklistPropertiesBasicResourceArmPaginatedResult. + internal partial class RaiBlocklistPropertiesBasicResourceArmPaginatedResult + { + /// + /// 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 RaiBlocklistPropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistPropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.Serialization.cs new file mode 100644 index 0000000000000..e10035dd34c97 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.Serialization.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RaiPolicyContentFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyContentFilter)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AllowedContentLevel)) + { + writer.WritePropertyName("allowedContentLevel"u8); + writer.WriteStringValue(AllowedContentLevel.Value.ToString()); + } + if (Optional.IsDefined(Blocking)) + { + writer.WritePropertyName("blocking"u8); + writer.WriteBooleanValue(Blocking.Value); + } + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiPolicyContentFilter 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(RaiPolicyContentFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiPolicyContentFilter(document.RootElement, options); + } + + internal static RaiPolicyContentFilter DeserializeRaiPolicyContentFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AllowedContentLevel? allowedContentLevel = default; + bool? blocking = default; + bool? enabled = default; + string name = default; + RaiPolicyContentSource? source = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("allowedContentLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowedContentLevel = new AllowedContentLevel(property.Value.GetString()); + continue; + } + if (property.NameEquals("blocking"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blocking = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = new RaiPolicyContentSource(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiPolicyContentFilter( + allowedContentLevel, + blocking, + enabled, + name, + source, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiPolicyContentFilter)} does not support writing '{options.Format}' format."); + } + } + + RaiPolicyContentFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiPolicyContentFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiPolicyContentFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.cs new file mode 100644 index 0000000000000..7f552a2bd1456 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.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 Azure.ResourceManager.MachineLearning.Models +{ + /// Azure OpenAI Content Filter. + public partial class RaiPolicyContentFilter + { + /// + /// 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 . + public RaiPolicyContentFilter() + { + } + + /// Initializes a new instance of . + /// Level at which content is filtered. + /// If blocking would occur. + /// If the ContentFilter is enabled. + /// Name of ContentFilter. + /// Content source to apply the Content Filters. + /// Keeps track of any properties unknown to the library. + internal RaiPolicyContentFilter(AllowedContentLevel? allowedContentLevel, bool? blocking, bool? enabled, string name, RaiPolicyContentSource? source, IDictionary serializedAdditionalRawData) + { + AllowedContentLevel = allowedContentLevel; + Blocking = blocking; + Enabled = enabled; + Name = name; + Source = source; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Level at which content is filtered. + public AllowedContentLevel? AllowedContentLevel { get; set; } + /// If blocking would occur. + public bool? Blocking { get; set; } + /// If the ContentFilter is enabled. + public bool? Enabled { get; set; } + /// Name of ContentFilter. + public string Name { get; set; } + /// Content source to apply the Content Filters. + public RaiPolicyContentSource? Source { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentSource.cs new file mode 100644 index 0000000000000..bda93bfeeb39c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentSource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Content source to apply the Content Filters. + public readonly partial struct RaiPolicyContentSource : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RaiPolicyContentSource(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PromptValue = "Prompt"; + private const string CompletionValue = "Completion"; + + /// Prompt. + public static RaiPolicyContentSource Prompt { get; } = new RaiPolicyContentSource(PromptValue); + /// Completion. + public static RaiPolicyContentSource Completion { get; } = new RaiPolicyContentSource(CompletionValue); + /// Determines if two values are the same. + public static bool operator ==(RaiPolicyContentSource left, RaiPolicyContentSource right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RaiPolicyContentSource left, RaiPolicyContentSource right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RaiPolicyContentSource(string value) => new RaiPolicyContentSource(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RaiPolicyContentSource other && Equals(other); + /// + public bool Equals(RaiPolicyContentSource 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyMode.cs new file mode 100644 index 0000000000000..2a627aafe4adf --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyMode.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Content Filters mode. + public readonly partial struct RaiPolicyMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RaiPolicyMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string DeferredValue = "Deferred"; + private const string BlockingValue = "Blocking"; + + /// Default. + public static RaiPolicyMode Default { get; } = new RaiPolicyMode(DefaultValue); + /// Deferred. + public static RaiPolicyMode Deferred { get; } = new RaiPolicyMode(DeferredValue); + /// Blocking. + public static RaiPolicyMode Blocking { get; } = new RaiPolicyMode(BlockingValue); + /// Determines if two values are the same. + public static bool operator ==(RaiPolicyMode left, RaiPolicyMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RaiPolicyMode left, RaiPolicyMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RaiPolicyMode(string value) => new RaiPolicyMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RaiPolicyMode other && Equals(other); + /// + public bool Equals(RaiPolicyMode 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.Serialization.cs new file mode 100644 index 0000000000000..dbd6ff6d29453 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.Serialization.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RaiPolicyProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(BasePolicyName)) + { + writer.WritePropertyName("basePolicyName"u8); + writer.WriteStringValue(BasePolicyName); + } + if (Optional.IsCollectionDefined(CompletionBlocklists)) + { + writer.WritePropertyName("completionBlocklists"u8); + writer.WriteStartArray(); + foreach (var item in CompletionBlocklists) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ContentFilters)) + { + writer.WritePropertyName("contentFilters"u8); + writer.WriteStartArray(); + foreach (var item in ContentFilters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsCollectionDefined(PromptBlocklists)) + { + writer.WritePropertyName("promptBlocklists"u8); + writer.WriteStartArray(); + foreach (var item in PromptBlocklists) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PolicyType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(PolicyType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiPolicyProperties 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(RaiPolicyProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiPolicyProperties(document.RootElement, options); + } + + internal static RaiPolicyProperties DeserializeRaiPolicyProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string basePolicyName = default; + IList completionBlocklists = default; + IList contentFilters = default; + RaiPolicyMode? mode = default; + IList promptBlocklists = default; + RaiPolicyType? type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("basePolicyName"u8)) + { + basePolicyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("completionBlocklists"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistConfig.DeserializeRaiBlocklistConfig(item, options)); + } + completionBlocklists = array; + continue; + } + if (property.NameEquals("contentFilters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiPolicyContentFilter.DeserializeRaiPolicyContentFilter(item, options)); + } + contentFilters = array; + continue; + } + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new RaiPolicyMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("promptBlocklists"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistConfig.DeserializeRaiBlocklistConfig(item, options)); + } + promptBlocklists = array; + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new RaiPolicyType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiPolicyProperties( + basePolicyName, + completionBlocklists ?? new ChangeTrackingList(), + contentFilters ?? new ChangeTrackingList(), + mode, + promptBlocklists ?? new ChangeTrackingList(), + type, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiPolicyProperties)} does not support writing '{options.Format}' format."); + } + } + + RaiPolicyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiPolicyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiPolicyProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.cs new file mode 100644 index 0000000000000..051f56aa0aef9 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.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 Azure.ResourceManager.MachineLearning.Models +{ + /// Azure OpenAI Content Filters properties. + public partial class RaiPolicyProperties + { + /// + /// 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 . + public RaiPolicyProperties() + { + CompletionBlocklists = new ChangeTrackingList(); + ContentFilters = new ChangeTrackingList(); + PromptBlocklists = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Name of the base Content Filters. + /// + /// + /// Content Filters mode. + /// + /// Content Filters policy type. + /// Keeps track of any properties unknown to the library. + internal RaiPolicyProperties(string basePolicyName, IList completionBlocklists, IList contentFilters, RaiPolicyMode? mode, IList promptBlocklists, RaiPolicyType? policyType, IDictionary serializedAdditionalRawData) + { + BasePolicyName = basePolicyName; + CompletionBlocklists = completionBlocklists; + ContentFilters = contentFilters; + Mode = mode; + PromptBlocklists = promptBlocklists; + PolicyType = policyType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the base Content Filters. + public string BasePolicyName { get; set; } + /// Gets the completion blocklists. + public IList CompletionBlocklists { get; } + /// Gets the content filters. + public IList ContentFilters { get; } + /// Content Filters mode. + public RaiPolicyMode? Mode { get; set; } + /// Gets the prompt blocklists. + public IList PromptBlocklists { get; } + /// Content Filters policy type. + public RaiPolicyType? PolicyType { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 0000000000000..5b9391b3a2208 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class RaiPolicyPropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiPolicyPropertiesBasicResourceArmPaginatedResult 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(RaiPolicyPropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static RaiPolicyPropertiesBasicResourceArmPaginatedResult DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiPolicyPropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + RaiPolicyPropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 0000000000000..7085d0e21698b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure OpenAI Content Filters resource list. + internal partial class RaiPolicyPropertiesBasicResourceArmPaginatedResult + { + /// + /// 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 RaiPolicyPropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal RaiPolicyPropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyType.cs new file mode 100644 index 0000000000000..1c9f489932e26 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Content Filters policy type. + public readonly partial struct RaiPolicyType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RaiPolicyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UserManagedValue = "UserManaged"; + private const string SystemManagedValue = "SystemManaged"; + + /// UserManaged. + public static RaiPolicyType UserManaged { get; } = new RaiPolicyType(UserManagedValue); + /// SystemManaged. + public static RaiPolicyType SystemManaged { get; } = new RaiPolicyType(SystemManagedValue); + /// Determines if two values are the same. + public static bool operator ==(RaiPolicyType left, RaiPolicyType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RaiPolicyType left, RaiPolicyType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RaiPolicyType(string value) => new RaiPolicyType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RaiPolicyType other && Equals(other); + /// + public bool Equals(RaiPolicyType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.Serialization.cs index 756b40e47aa96..da96a39ca4c31 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.Serialization.cs @@ -26,18 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteStartObject(); - if (Optional.IsDefined(Logbase)) - { - if (Logbase != null) - { - writer.WritePropertyName("logbase"u8); - writer.WriteStringValue(Logbase); - } - else - { - writer.WriteNull("logbase"); - } - } if (Optional.IsDefined(Rule)) { writer.WritePropertyName("rule"u8); @@ -95,7 +83,6 @@ internal static RandomSamplingAlgorithm DeserializeRandomSamplingAlgorithm(JsonE { return null; } - string logbase = default; RandomSamplingAlgorithmRule? rule = default; int? seed = default; SamplingAlgorithmType samplingAlgorithmType = default; @@ -103,16 +90,6 @@ internal static RandomSamplingAlgorithm DeserializeRandomSamplingAlgorithm(JsonE Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("logbase"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - logbase = null; - continue; - } - logbase = property.Value.GetString(); - continue; - } if (property.NameEquals("rule"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -143,7 +120,7 @@ internal static RandomSamplingAlgorithm DeserializeRandomSamplingAlgorithm(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new RandomSamplingAlgorithm(samplingAlgorithmType, serializedAdditionalRawData, logbase, rule, seed); + return new RandomSamplingAlgorithm(samplingAlgorithmType, serializedAdditionalRawData, rule, seed); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.cs index f2f2c323ba796..cc0c965c2faae 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.cs @@ -22,19 +22,15 @@ public RandomSamplingAlgorithm() /// Initializes a new instance of . /// [Required] The algorithm used for generating hyperparameter values, along with configuration properties. /// Keeps track of any properties unknown to the library. - /// An optional positive number or e in string format to be used as base for log based random sampling. /// The specific type of random algorithm. /// An optional integer to use as the seed for random number generation. - internal RandomSamplingAlgorithm(SamplingAlgorithmType samplingAlgorithmType, IDictionary serializedAdditionalRawData, string logbase, RandomSamplingAlgorithmRule? rule, int? seed) : base(samplingAlgorithmType, serializedAdditionalRawData) + internal RandomSamplingAlgorithm(SamplingAlgorithmType samplingAlgorithmType, IDictionary serializedAdditionalRawData, RandomSamplingAlgorithmRule? rule, int? seed) : base(samplingAlgorithmType, serializedAdditionalRawData) { - Logbase = logbase; Rule = rule; Seed = seed; SamplingAlgorithmType = samplingAlgorithmType; } - /// An optional positive number or e in string format to be used as base for log based random sampling. - public string Logbase { get; set; } /// The specific type of random algorithm. public RandomSamplingAlgorithmRule? Rule { get; set; } /// An optional integer to use as the seed for random number generation. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.Serialization.cs deleted file mode 100644 index 71ceff665cebc..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.Serialization.cs +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class RayDistributionConfiguration : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RayDistributionConfiguration)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Address)) - { - if (Address != null) - { - writer.WritePropertyName("address"u8); - writer.WriteStringValue(Address); - } - else - { - writer.WriteNull("address"); - } - } - if (Optional.IsDefined(DashboardPort)) - { - if (DashboardPort != null) - { - writer.WritePropertyName("dashboardPort"u8); - writer.WriteNumberValue(DashboardPort.Value); - } - else - { - writer.WriteNull("dashboardPort"); - } - } - if (Optional.IsDefined(HeadNodeAdditionalArgs)) - { - if (HeadNodeAdditionalArgs != null) - { - writer.WritePropertyName("headNodeAdditionalArgs"u8); - writer.WriteStringValue(HeadNodeAdditionalArgs); - } - else - { - writer.WriteNull("headNodeAdditionalArgs"); - } - } - if (Optional.IsDefined(IncludeDashboard)) - { - if (IncludeDashboard != null) - { - writer.WritePropertyName("includeDashboard"u8); - writer.WriteBooleanValue(IncludeDashboard.Value); - } - else - { - writer.WriteNull("includeDashboard"); - } - } - if (Optional.IsDefined(Port)) - { - if (Port != null) - { - writer.WritePropertyName("port"u8); - writer.WriteNumberValue(Port.Value); - } - else - { - writer.WriteNull("port"); - } - } - if (Optional.IsDefined(WorkerNodeAdditionalArgs)) - { - if (WorkerNodeAdditionalArgs != null) - { - writer.WritePropertyName("workerNodeAdditionalArgs"u8); - writer.WriteStringValue(WorkerNodeAdditionalArgs); - } - else - { - writer.WriteNull("workerNodeAdditionalArgs"); - } - } - writer.WritePropertyName("distributionType"u8); - writer.WriteStringValue(DistributionType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RayDistributionConfiguration 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(RayDistributionConfiguration)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRayDistributionConfiguration(document.RootElement, options); - } - - internal static RayDistributionConfiguration DeserializeRayDistributionConfiguration(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string address = default; - int? dashboardPort = default; - string headNodeAdditionalArgs = default; - bool? includeDashboard = default; - int? port = default; - string workerNodeAdditionalArgs = default; - DistributionType distributionType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("address"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - address = null; - continue; - } - address = property.Value.GetString(); - continue; - } - if (property.NameEquals("dashboardPort"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - dashboardPort = null; - continue; - } - dashboardPort = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("headNodeAdditionalArgs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - headNodeAdditionalArgs = null; - continue; - } - headNodeAdditionalArgs = property.Value.GetString(); - continue; - } - if (property.NameEquals("includeDashboard"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - includeDashboard = null; - continue; - } - includeDashboard = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("port"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - port = null; - continue; - } - port = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("workerNodeAdditionalArgs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - workerNodeAdditionalArgs = null; - continue; - } - workerNodeAdditionalArgs = property.Value.GetString(); - continue; - } - if (property.NameEquals("distributionType"u8)) - { - distributionType = new DistributionType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RayDistributionConfiguration( - distributionType, - serializedAdditionalRawData, - address, - dashboardPort, - headNodeAdditionalArgs, - includeDashboard, - port, - workerNodeAdditionalArgs); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RayDistributionConfiguration)} does not support writing '{options.Format}' format."); - } - } - - RayDistributionConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRayDistributionConfiguration(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RayDistributionConfiguration)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.cs deleted file mode 100644 index ca0e99714bec9..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Ray distribution configuration. - public partial class RayDistributionConfiguration : MachineLearningDistributionConfiguration - { - /// Initializes a new instance of . - public RayDistributionConfiguration() - { - DistributionType = DistributionType.Ray; - } - - /// Initializes a new instance of . - /// [Required] Specifies the type of distribution framework. - /// Keeps track of any properties unknown to the library. - /// The address of Ray head node. - /// The port to bind the dashboard server to. - /// Additional arguments passed to ray start in head node. - /// Provide this argument to start the Ray dashboard GUI. - /// The port of the head ray process. - /// Additional arguments passed to ray start in worker node. - internal RayDistributionConfiguration(DistributionType distributionType, IDictionary serializedAdditionalRawData, string address, int? dashboardPort, string headNodeAdditionalArgs, bool? includeDashboard, int? port, string workerNodeAdditionalArgs) : base(distributionType, serializedAdditionalRawData) - { - Address = address; - DashboardPort = dashboardPort; - HeadNodeAdditionalArgs = headNodeAdditionalArgs; - IncludeDashboard = includeDashboard; - Port = port; - WorkerNodeAdditionalArgs = workerNodeAdditionalArgs; - DistributionType = distributionType; - } - - /// The address of Ray head node. - public string Address { get; set; } - /// The port to bind the dashboard server to. - public int? DashboardPort { get; set; } - /// Additional arguments passed to ray start in head node. - public string HeadNodeAdditionalArgs { get; set; } - /// Provide this argument to start the Ray dashboard GUI. - public bool? IncludeDashboard { get; set; } - /// The port of the head ray process. - public int? Port { get; set; } - /// Additional arguments passed to ray start in worker node. - public string WorkerNodeAdditionalArgs { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.Serialization.cs similarity index 58% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.Serialization.cs index 76d7c151968ee..8d991ab0329e0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class UnknownMLAssistConfiguration : IUtf8JsonSerializable, IJsonModel + public partial class RegenerateServiceAccountKeyContent : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RegenerateServiceAccountKeyContent)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("mlAssist"u8); - writer.WriteStringValue(MlAssist.ToString()); + if (Optional.IsDefined(KeyName)) + { + writer.WritePropertyName("keyName"u8); + writer.WriteStringValue(KeyName.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteEndObject(); } - MachineLearningAssistConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RegenerateServiceAccountKeyContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RegenerateServiceAccountKeyContent)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningAssistConfiguration(document.RootElement, options); + return DeserializeRegenerateServiceAccountKeyContent(document.RootElement, options); } - internal static UnknownMLAssistConfiguration DeserializeUnknownMLAssistConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + internal static RegenerateServiceAccountKeyContent DeserializeRegenerateServiceAccountKeyContent(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +69,18 @@ internal static UnknownMLAssistConfiguration DeserializeUnknownMLAssistConfigura { return null; } - MLAssistConfigurationType mlAssist = "Unknown"; + ServiceAccountKeyName? keyName = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mlAssist"u8)) + if (property.NameEquals("keyName"u8)) { - mlAssist = new MLAssistConfigurationType(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyName = new ServiceAccountKeyName(property.Value.GetString()); continue; } if (options.Format != "W") @@ -82,38 +89,38 @@ internal static UnknownMLAssistConfiguration DeserializeUnknownMLAssistConfigura } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownMLAssistConfiguration(mlAssist, serializedAdditionalRawData); + return new RegenerateServiceAccountKeyContent(keyName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RegenerateServiceAccountKeyContent)} does not support writing '{options.Format}' format."); } } - MachineLearningAssistConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RegenerateServiceAccountKeyContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMachineLearningAssistConfiguration(document.RootElement, options); + return DeserializeRegenerateServiceAccountKeyContent(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RegenerateServiceAccountKeyContent)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.cs new file mode 100644 index 0000000000000..a4d96f697c97b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The RegenerateServiceAccountKeyContent. + public partial class RegenerateServiceAccountKeyContent + { + /// + /// 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 . + public RegenerateServiceAccountKeyContent() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal RegenerateServiceAccountKeyContent(ServiceAccountKeyName? keyName, IDictionary serializedAdditionalRawData) + { + KeyName = keyName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the key name. + public ServiceAccountKeyName? KeyName { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryAcrDetails.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryAcrDetails.cs index 0d1d1d58e8fc6..c017ebc19c377 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryAcrDetails.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryAcrDetails.cs @@ -53,7 +53,7 @@ public RegistryAcrDetails() /// Initializes a new instance of . /// Details of system created ACR account to be used for the Registry. - /// Details of user created ACR account to be used for the Registry. Not supported in most cases and will throw 400 error if provided. + /// Details of user created ACR account to be used for the Registry. /// Keeps track of any properties unknown to the library. internal RegistryAcrDetails(SystemCreatedAcrAccount systemCreatedAcrAccount, UserCreatedAcrAccount userCreatedAcrAccount, IDictionary serializedAdditionalRawData) { @@ -64,7 +64,7 @@ internal RegistryAcrDetails(SystemCreatedAcrAccount systemCreatedAcrAccount, Use /// Details of system created ACR account to be used for the Registry. public SystemCreatedAcrAccount SystemCreatedAcrAccount { get; set; } - /// Details of user created ACR account to be used for the Registry. Not supported in most cases and will throw 400 error if provided. + /// Details of user created ACR account to be used for the Registry. internal UserCreatedAcrAccount UserCreatedAcrAccount { get; set; } /// /// Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.Serialization.cs index 04c79ad19b697..9608d93540544 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.Serialization.cs @@ -81,16 +81,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteNull("privateEndpoint"); } } - if (Optional.IsDefined(PrivateLinkServiceConnectionState)) + if (Optional.IsDefined(RegistryPrivateLinkServiceConnectionState)) { - if (PrivateLinkServiceConnectionState != null) + if (RegistryPrivateLinkServiceConnectionState != null) { - writer.WritePropertyName("privateLinkServiceConnectionState"u8); - writer.WriteObjectValue(PrivateLinkServiceConnectionState, options); + writer.WritePropertyName("registryPrivateLinkServiceConnectionState"u8); + writer.WriteObjectValue(RegistryPrivateLinkServiceConnectionState, options); } else { - writer.WriteNull("privateLinkServiceConnectionState"); + writer.WriteNull("registryPrivateLinkServiceConnectionState"); } } if (Optional.IsDefined(ProvisioningState)) @@ -148,7 +148,7 @@ internal static RegistryPrivateEndpointConnection DeserializeRegistryPrivateEndp AzureLocation? location = default; IList groupIds = default; RegistryPrivateEndpoint privateEndpoint = default; - RegistryPrivateLinkServiceConnectionState privateLinkServiceConnectionState = default; + RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState = default; string provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -208,14 +208,14 @@ internal static RegistryPrivateEndpointConnection DeserializeRegistryPrivateEndp privateEndpoint = RegistryPrivateEndpoint.DeserializeRegistryPrivateEndpoint(property0.Value, options); continue; } - if (property0.NameEquals("privateLinkServiceConnectionState"u8)) + if (property0.NameEquals("registryPrivateLinkServiceConnectionState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { - privateLinkServiceConnectionState = null; + registryPrivateLinkServiceConnectionState = null; continue; } - privateLinkServiceConnectionState = RegistryPrivateLinkServiceConnectionState.DeserializeRegistryPrivateLinkServiceConnectionState(property0.Value, options); + registryPrivateLinkServiceConnectionState = RegistryPrivateLinkServiceConnectionState.DeserializeRegistryPrivateLinkServiceConnectionState(property0.Value, options); continue; } if (property0.NameEquals("provisioningState"u8)) @@ -242,7 +242,7 @@ internal static RegistryPrivateEndpointConnection DeserializeRegistryPrivateEndp location, groupIds ?? new ChangeTrackingList(), privateEndpoint, - privateLinkServiceConnectionState, + registryPrivateLinkServiceConnectionState, provisioningState, serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.cs index e27f21db02757..cb96f9ef2eb71 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.cs @@ -55,28 +55,28 @@ public RegistryPrivateEndpointConnection() /// Initializes a new instance of . /// /// This is the private endpoint connection name created on SRP - /// Full resource id: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/privateEndpointConnections/{peConnectionName} + /// Full resource id: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName} /// /// Same as workspace location. /// The group ids. /// The PE network resource that is linked to this PE connection. - /// The connection state. + /// The connection state. /// One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's null. /// Keeps track of any properties unknown to the library. - internal RegistryPrivateEndpointConnection(ResourceIdentifier id, AzureLocation? location, IList groupIds, RegistryPrivateEndpoint privateEndpoint, RegistryPrivateLinkServiceConnectionState privateLinkServiceConnectionState, string provisioningState, IDictionary serializedAdditionalRawData) + internal RegistryPrivateEndpointConnection(ResourceIdentifier id, AzureLocation? location, IList groupIds, RegistryPrivateEndpoint privateEndpoint, RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState, string provisioningState, IDictionary serializedAdditionalRawData) { Id = id; Location = location; GroupIds = groupIds; PrivateEndpoint = privateEndpoint; - PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + RegistryPrivateLinkServiceConnectionState = registryPrivateLinkServiceConnectionState; ProvisioningState = provisioningState; _serializedAdditionalRawData = serializedAdditionalRawData; } /// /// This is the private endpoint connection name created on SRP - /// Full resource id: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/privateEndpointConnections/{peConnectionName} + /// Full resource id: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName} /// public ResourceIdentifier Id { get; set; } /// Same as workspace location. @@ -86,7 +86,7 @@ internal RegistryPrivateEndpointConnection(ResourceIdentifier id, AzureLocation? /// The PE network resource that is linked to this PE connection. public RegistryPrivateEndpoint PrivateEndpoint { get; set; } /// The connection state. - public RegistryPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + public RegistryPrivateLinkServiceConnectionState RegistryPrivateLinkServiceConnectionState { get; set; } /// One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's null. public string ProvisioningState { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetric.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetric.cs deleted file mode 100644 index f214114f7630a..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetric.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The RegressionModelPerformanceMetric. - public readonly partial struct RegressionModelPerformanceMetric : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RegressionModelPerformanceMetric(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string MeanAbsoluteErrorValue = "MeanAbsoluteError"; - private const string RootMeanSquaredErrorValue = "RootMeanSquaredError"; - private const string MeanSquaredErrorValue = "MeanSquaredError"; - - /// The Mean Absolute Error (MAE) metric. - public static RegressionModelPerformanceMetric MeanAbsoluteError { get; } = new RegressionModelPerformanceMetric(MeanAbsoluteErrorValue); - /// The Root Mean Squared Error (RMSE) metric. - public static RegressionModelPerformanceMetric RootMeanSquaredError { get; } = new RegressionModelPerformanceMetric(RootMeanSquaredErrorValue); - /// The Mean Squared Error (MSE) metric. - public static RegressionModelPerformanceMetric MeanSquaredError { get; } = new RegressionModelPerformanceMetric(MeanSquaredErrorValue); - /// Determines if two values are the same. - public static bool operator ==(RegressionModelPerformanceMetric left, RegressionModelPerformanceMetric right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RegressionModelPerformanceMetric left, RegressionModelPerformanceMetric right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator RegressionModelPerformanceMetric(string value) => new RegressionModelPerformanceMetric(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RegressionModelPerformanceMetric other && Equals(other); - /// - public bool Equals(RegressionModelPerformanceMetric 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.Serialization.cs deleted file mode 100644 index 26b939ebda5eb..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.Serialization.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class RegressionModelPerformanceMetricThreshold : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RegressionModelPerformanceMetricThreshold)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("metric"u8); - writer.WriteStringValue(Metric.ToString()); - writer.WritePropertyName("modelType"u8); - writer.WriteStringValue(ModelType.ToString()); - if (Optional.IsDefined(Threshold)) - { - if (Threshold != null) - { - writer.WritePropertyName("threshold"u8); - writer.WriteObjectValue(Threshold, options); - } - else - { - writer.WriteNull("threshold"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RegressionModelPerformanceMetricThreshold 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(RegressionModelPerformanceMetricThreshold)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRegressionModelPerformanceMetricThreshold(document.RootElement, options); - } - - internal static RegressionModelPerformanceMetricThreshold DeserializeRegressionModelPerformanceMetricThreshold(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - RegressionModelPerformanceMetric metric = default; - MonitoringModelType modelType = default; - MonitoringThreshold threshold = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metric"u8)) - { - metric = new RegressionModelPerformanceMetric(property.Value.GetString()); - continue; - } - if (property.NameEquals("modelType"u8)) - { - modelType = new MonitoringModelType(property.Value.GetString()); - continue; - } - if (property.NameEquals("threshold"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - threshold = null; - continue; - } - threshold = MonitoringThreshold.DeserializeMonitoringThreshold(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RegressionModelPerformanceMetricThreshold(modelType, threshold, serializedAdditionalRawData, metric); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RegressionModelPerformanceMetricThreshold)} does not support writing '{options.Format}' format."); - } - } - - RegressionModelPerformanceMetricThreshold IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRegressionModelPerformanceMetricThreshold(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RegressionModelPerformanceMetricThreshold)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.cs deleted file mode 100644 index 127589b7c7d4b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The RegressionModelPerformanceMetricThreshold. - public partial class RegressionModelPerformanceMetricThreshold : ModelPerformanceMetricThresholdBase - { - /// Initializes a new instance of . - /// [Required] The regression model performance metric to calculate. - public RegressionModelPerformanceMetricThreshold(RegressionModelPerformanceMetric metric) - { - Metric = metric; - ModelType = MonitoringModelType.Regression; - } - - /// Initializes a new instance of . - /// [Required] Specifies the data type of the metric threshold. - /// The threshold value. If null, a default value will be set depending on the selected metric. - /// Keeps track of any properties unknown to the library. - /// [Required] The regression model performance metric to calculate. - internal RegressionModelPerformanceMetricThreshold(MonitoringModelType modelType, MonitoringThreshold threshold, IDictionary serializedAdditionalRawData, RegressionModelPerformanceMetric metric) : base(modelType, threshold, serializedAdditionalRawData) - { - Metric = metric; - ModelType = modelType; - } - - /// Initializes a new instance of for deserialization. - internal RegressionModelPerformanceMetricThreshold() - { - } - - /// [Required] The regression model performance metric to calculate. - public RegressionModelPerformanceMetric Metric { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.Serialization.cs index 209108e3139d0..72329643c50f5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.Serialization.cs @@ -102,11 +102,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteNull("stackEnsembleSettings"); } } - if (Optional.IsDefined(TrainingMode)) - { - writer.WritePropertyName("trainingMode"u8); - writer.WriteStringValue(TrainingMode.Value.ToString()); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -154,7 +149,6 @@ internal static RegressionTrainingSettings DeserializeRegressionTrainingSettings bool? enableVoteEnsemble = default; TimeSpan? ensembleModelDownloadTimeout = default; MachineLearningStackEnsembleSettings stackEnsembleSettings = default; - TrainingMode? trainingMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -253,15 +247,6 @@ internal static RegressionTrainingSettings DeserializeRegressionTrainingSettings stackEnsembleSettings = MachineLearningStackEnsembleSettings.DeserializeMachineLearningStackEnsembleSettings(property.Value, options); continue; } - if (property.NameEquals("trainingMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - trainingMode = new TrainingMode(property.Value.GetString()); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -276,7 +261,6 @@ internal static RegressionTrainingSettings DeserializeRegressionTrainingSettings enableVoteEnsemble, ensembleModelDownloadTimeout, stackEnsembleSettings, - trainingMode, serializedAdditionalRawData, allowedTrainingAlgorithms ?? new ChangeTrackingList(), blockedTrainingAlgorithms ?? new ChangeTrackingList()); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.cs index b619cfb4ada3e..05f8f2bf88839 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.cs @@ -31,15 +31,10 @@ public RegressionTrainingSettings() /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// /// Stack ensemble settings for stack ensemble run. - /// - /// TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' for now, however in the future may result in mixed mode or heuristics based mode selection. Default is 'auto'. - /// If 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. - /// If 'NonDistributed' then only non distributed algorithms are chosen. - /// /// Keeps track of any properties unknown to the library. /// Allowed models for regression task. /// Blocked models for regression task. - internal RegressionTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, TrainingMode? trainingMode, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, trainingMode, serializedAdditionalRawData) + internal RegressionTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, serializedAdditionalRawData) { AllowedTrainingAlgorithms = allowedTrainingAlgorithms; BlockedTrainingAlgorithms = blockedTrainingAlgorithms; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.Serialization.cs similarity index 55% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.Serialization.cs index f76372c4a651d..8f3648662266d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class UnknownPackageInputPathBase : IUtf8JsonSerializable, IJsonModel + public partial class ResizeSchema : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ResizeSchema)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("inputPathType"u8); - writer.WriteStringValue(InputPathType.ToString()); + if (Optional.IsDefined(TargetVmSize)) + { + writer.WritePropertyName("targetVMSize"u8); + writer.WriteStringValue(TargetVmSize); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteEndObject(); } - PackageInputPathBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ResizeSchema IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ResizeSchema)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePackageInputPathBase(document.RootElement, options); + return DeserializeResizeSchema(document.RootElement, options); } - internal static UnknownPackageInputPathBase DeserializeUnknownPackageInputPathBase(JsonElement element, ModelReaderWriterOptions options = null) + internal static ResizeSchema DeserializeResizeSchema(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +69,14 @@ internal static UnknownPackageInputPathBase DeserializeUnknownPackageInputPathBa { return null; } - InputPathType inputPathType = "Unknown"; + string targetVmSize = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("inputPathType"u8)) + if (property.NameEquals("targetVMSize"u8)) { - inputPathType = new InputPathType(property.Value.GetString()); + targetVmSize = property.Value.GetString(); continue; } if (options.Format != "W") @@ -82,38 +85,38 @@ internal static UnknownPackageInputPathBase DeserializeUnknownPackageInputPathBa } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownPackageInputPathBase(inputPathType, serializedAdditionalRawData); + return new ResizeSchema(targetVmSize, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ResizeSchema)} does not support writing '{options.Format}' format."); } } - PackageInputPathBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ResizeSchema IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePackageInputPathBase(document.RootElement, options); + return DeserializeResizeSchema(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ResizeSchema)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.cs new file mode 100644 index 0000000000000..be33ee73ef451 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Schema for Compute Instance resize. + public partial class ResizeSchema + { + /// + /// 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 . + public ResizeSchema() + { + } + + /// Initializes a new instance of . + /// The name of the virtual machine size. + /// Keeps track of any properties unknown to the library. + internal ResizeSchema(string targetVmSize, IDictionary serializedAdditionalRawData) + { + TargetVmSize = targetVmSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the virtual machine size. + public string TargetVmSize { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrailingInputData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.Serialization.cs similarity index 81% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrailingInputData.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.Serialization.cs index 96b8cd971bf52..b428af659a974 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrailingInputData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class TrailingInputData : IUtf8JsonSerializable, IJsonModel + public partial class RollingInputData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrailingInputData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RollingInputData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -96,19 +96,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WriteEndObject(); } - TrailingInputData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RollingInputData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrailingInputData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RollingInputData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrailingInputData(document.RootElement, options); + return DeserializeRollingInputData(document.RootElement, options); } - internal static TrailingInputData DeserializeTrailingInputData(JsonElement element, ModelReaderWriterOptions options = null) + internal static RollingInputData DeserializeRollingInputData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -194,7 +194,7 @@ internal static TrailingInputData DeserializeTrailingInputData(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new TrailingInputData( + return new RollingInputData( columns ?? new ChangeTrackingDictionary(), dataContext, inputDataType, @@ -206,35 +206,35 @@ internal static TrailingInputData DeserializeTrailingInputData(JsonElement eleme windowSize); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(TrailingInputData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RollingInputData)} does not support writing '{options.Format}' format."); } } - TrailingInputData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RollingInputData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTrailingInputData(document.RootElement, options); + return DeserializeRollingInputData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(TrailingInputData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RollingInputData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrailingInputData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrailingInputData.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.cs index 592914fb6666c..119e830fadadc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrailingInputData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.cs @@ -10,35 +10,35 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Trailing input data definition. - public partial class TrailingInputData : MonitoringInputDataBase + /// Rolling input data definition. + public partial class RollingInputData : MonitoringInputDataBase { - /// Initializes a new instance of . + /// Initializes a new instance of . /// [Required] Specifies the type of job. /// [Required] Input Asset URI. /// [Required] The time offset between the end of the data window and the monitor's current run time. - /// [Required] The size of the trailing data window. + /// [Required] The size of the rolling data window. /// is null. - public TrailingInputData(JobInputType jobInputType, Uri uri, TimeSpan windowOffset, TimeSpan windowSize) : base(jobInputType, uri) + public RollingInputData(JobInputType jobInputType, Uri uri, TimeSpan windowOffset, TimeSpan windowSize) : base(jobInputType, uri) { Argument.AssertNotNull(uri, nameof(uri)); WindowOffset = windowOffset; WindowSize = windowSize; - InputDataType = MonitoringInputDataType.Trailing; + InputDataType = MonitoringInputDataType.Rolling; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Mapping of column names to special uses. /// The context metadata of the data source. /// [Required] Specifies the type of signal to monitor. /// [Required] Specifies the type of job. /// [Required] Input Asset URI. /// Keeps track of any properties unknown to the library. - /// The ARM resource ID of the component resource used to preprocess the data. + /// Reference to the component asset used to preprocess the data. /// [Required] The time offset between the end of the data window and the monitor's current run time. - /// [Required] The size of the trailing data window. - internal TrailingInputData(IDictionary columns, string dataContext, MonitoringInputDataType inputDataType, JobInputType jobInputType, Uri uri, IDictionary serializedAdditionalRawData, string preprocessingComponentId, TimeSpan windowOffset, TimeSpan windowSize) : base(columns, dataContext, inputDataType, jobInputType, uri, serializedAdditionalRawData) + /// [Required] The size of the rolling data window. + internal RollingInputData(IDictionary columns, string dataContext, MonitoringInputDataType inputDataType, JobInputType jobInputType, Uri uri, IDictionary serializedAdditionalRawData, string preprocessingComponentId, TimeSpan windowOffset, TimeSpan windowSize) : base(columns, dataContext, inputDataType, jobInputType, uri, serializedAdditionalRawData) { PreprocessingComponentId = preprocessingComponentId; WindowOffset = windowOffset; @@ -46,16 +46,16 @@ internal TrailingInputData(IDictionary columns, string dataConte InputDataType = inputDataType; } - /// Initializes a new instance of for deserialization. - internal TrailingInputData() + /// Initializes a new instance of for deserialization. + internal RollingInputData() { } - /// The ARM resource ID of the component resource used to preprocess the data. + /// Reference to the component asset used to preprocess the data. public string PreprocessingComponentId { get; set; } /// [Required] The time offset between the end of the data window and the monitor's current run time. public TimeSpan WindowOffset { get; set; } - /// [Required] The size of the trailing data window. + /// [Required] The size of the rolling data window. public TimeSpan WindowSize { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.Serialization.cs similarity index 54% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.Serialization.cs index 202c03fcb67d3..c16b7075364b4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.Serialization.cs @@ -13,33 +13,33 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class PackageInputPathUri : IUtf8JsonSerializable, IJsonModel + public partial class SasCredential : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathUri)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(SasCredential)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Uri)) + if (Optional.IsDefined(SasUri)) { - if (Uri != null) + if (SasUri != null) { - writer.WritePropertyName("url"u8); - writer.WriteStringValue(Uri.AbsoluteUri); + writer.WritePropertyName("sasUri"u8); + writer.WriteStringValue(SasUri.AbsoluteUri); } else { - writer.WriteNull("url"); + writer.WriteNull("sasUri"); } } - writer.WritePropertyName("inputPathType"u8); - writer.WriteStringValue(InputPathType.ToString()); + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +58,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - PackageInputPathUri IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + SasCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathUri)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(SasCredential)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePackageInputPathUri(document.RootElement, options); + return DeserializeSasCredential(document.RootElement, options); } - internal static PackageInputPathUri DeserializePackageInputPathUri(JsonElement element, ModelReaderWriterOptions options = null) + internal static SasCredential DeserializeSasCredential(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +78,25 @@ internal static PackageInputPathUri DeserializePackageInputPathUri(JsonElement e { return null; } - Uri url = default; - InputPathType inputPathType = default; + Uri sasUri = default; + DataReferenceCredentialType credentialType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("url"u8)) + if (property.NameEquals("sasUri"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - url = null; + sasUri = null; continue; } - url = new Uri(property.Value.GetString()); + sasUri = new Uri(property.Value.GetString()); continue; } - if (property.NameEquals("inputPathType"u8)) + if (property.NameEquals("credentialType"u8)) { - inputPathType = new InputPathType(property.Value.GetString()); + credentialType = new DataReferenceCredentialType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -105,38 +105,38 @@ internal static PackageInputPathUri DeserializePackageInputPathUri(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new PackageInputPathUri(inputPathType, serializedAdditionalRawData, url); + return new SasCredential(credentialType, serializedAdditionalRawData, sasUri); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PackageInputPathUri)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(SasCredential)} does not support writing '{options.Format}' format."); } } - PackageInputPathUri IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + SasCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePackageInputPathUri(document.RootElement, options); + return DeserializeSasCredential(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PackageInputPathUri)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(SasCredential)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.cs new file mode 100644 index 0000000000000..5e5cef9ed4e5b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Access with full SAS uri. + public partial class SasCredential : DataReferenceCredential + { + /// Initializes a new instance of . + internal SasCredential() + { + CredentialType = DataReferenceCredentialType.Sas; + } + + /// Initializes a new instance of . + /// [Required] Credential type used to authentication with storage. + /// Keeps track of any properties unknown to the library. + /// Full SAS Uri, including the storage, container/blob path and SAS token. + internal SasCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData, Uri sasUri) : base(credentialType, serializedAdditionalRawData) + { + SasUri = sasUri; + CredentialType = credentialType; + } + + /// Full SAS Uri, including the storage, container/blob path and SAS token. + public Uri SasUri { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ScheduleActionType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ScheduleActionType.cs index ec6173543186b..a780d1dbe21df 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ScheduleActionType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ScheduleActionType.cs @@ -24,15 +24,12 @@ public ScheduleActionType(string value) private const string CreateJobValue = "CreateJob"; private const string InvokeBatchEndpointValue = "InvokeBatchEndpoint"; - private const string ImportDataValue = "ImportData"; private const string CreateMonitorValue = "CreateMonitor"; /// CreateJob. public static ScheduleActionType CreateJob { get; } = new ScheduleActionType(CreateJobValue); /// InvokeBatchEndpoint. public static ScheduleActionType InvokeBatchEndpoint { get; } = new ScheduleActionType(InvokeBatchEndpointValue); - /// ImportData. - public static ScheduleActionType ImportData { get; } = new ScheduleActionType(ImportDataValue); /// CreateMonitor. public static ScheduleActionType CreateMonitor { get; } = new ScheduleActionType(CreateMonitorValue); /// Determines if two values are the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteSetting.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.Serialization.cs similarity index 54% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteSetting.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.Serialization.cs index 03691de2af90a..309ee71ea33a1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteSetting.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.Serialization.cs @@ -13,35 +13,28 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class AutoDeleteSetting : IUtf8JsonSerializable, IJsonModel + public partial class SecretExpiry : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AutoDeleteSetting)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(SecretExpiry)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Condition)) + if (Optional.IsDefined(ExpirableSecret)) { - writer.WritePropertyName("condition"u8); - writer.WriteStringValue(Condition.Value.ToString()); + writer.WritePropertyName("expirableSecret"u8); + writer.WriteBooleanValue(ExpirableSecret.Value); } - if (Optional.IsDefined(Value)) + if (Optional.IsDefined(ExpireAfterHours)) { - if (Value != null) - { - writer.WritePropertyName("value"u8); - writer.WriteStringValue(Value); - } - else - { - writer.WriteNull("value"); - } + writer.WritePropertyName("expireAfterHours"u8); + writer.WriteNumberValue(ExpireAfterHours.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -61,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WriteEndObject(); } - AutoDeleteSetting IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + SecretExpiry IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AutoDeleteSetting)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(SecretExpiry)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAutoDeleteSetting(document.RootElement, options); + return DeserializeSecretExpiry(document.RootElement, options); } - internal static AutoDeleteSetting DeserializeAutoDeleteSetting(JsonElement element, ModelReaderWriterOptions options = null) + internal static SecretExpiry DeserializeSecretExpiry(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -81,29 +74,28 @@ internal static AutoDeleteSetting DeserializeAutoDeleteSetting(JsonElement eleme { return null; } - AutoDeleteCondition? condition = default; - string value = default; + bool? expirableSecret = default; + int? expireAfterHours = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("condition"u8)) + if (property.NameEquals("expirableSecret"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - condition = new AutoDeleteCondition(property.Value.GetString()); + expirableSecret = property.Value.GetBoolean(); continue; } - if (property.NameEquals("value"u8)) + if (property.NameEquals("expireAfterHours"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - value = null; continue; } - value = property.Value.GetString(); + expireAfterHours = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -112,38 +104,38 @@ internal static AutoDeleteSetting DeserializeAutoDeleteSetting(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new AutoDeleteSetting(condition, value, serializedAdditionalRawData); + return new SecretExpiry(expirableSecret, expireAfterHours, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AutoDeleteSetting)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(SecretExpiry)} does not support writing '{options.Format}' format."); } } - AutoDeleteSetting IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + SecretExpiry IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAutoDeleteSetting(document.RootElement, options); + return DeserializeSecretExpiry(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AutoDeleteSetting)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(SecretExpiry)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs similarity index 66% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretConfiguration.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs index 653ce6f4bf72e..cdb6e2f1079ce 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Secret Configuration definition. - public partial class SecretConfiguration + /// Secret expiration configuration. + public partial class SecretExpiry { /// /// Keeps track of any properties unknown to the library. @@ -45,31 +45,25 @@ public partial class SecretConfiguration /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public SecretConfiguration() + /// Initializes a new instance of . + public SecretExpiry() { } - /// Initializes a new instance of . - /// - /// Secret Uri. - /// Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion - /// - /// Name of secret in workspace key vault. + /// Initializes a new instance of . + /// Indicates if the secret is expirable. + /// Number of hours after which the secret will expire. /// Keeps track of any properties unknown to the library. - internal SecretConfiguration(Uri uri, string workspaceSecretName, IDictionary serializedAdditionalRawData) + internal SecretExpiry(bool? expirableSecret, int? expireAfterHours, IDictionary serializedAdditionalRawData) { - Uri = uri; - WorkspaceSecretName = workspaceSecretName; + ExpirableSecret = expirableSecret; + ExpireAfterHours = expireAfterHours; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// - /// Secret Uri. - /// Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion - /// - public Uri Uri { get; set; } - /// Name of secret in workspace key vault. - public string WorkspaceSecretName { get; set; } + /// Indicates if the secret is expirable. + public bool? ExpirableSecret { get; set; } + /// Number of hours after which the secret will expire. + public int? ExpireAfterHours { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretsType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretsType.cs index 40057e6cef52f..d683296c8ca71 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretsType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretsType.cs @@ -26,8 +26,6 @@ public SecretsType(string value) private const string CertificateValue = "Certificate"; private const string SasValue = "Sas"; private const string ServicePrincipalValue = "ServicePrincipal"; - private const string KerberosPasswordValue = "KerberosPassword"; - private const string KerberosKeytabValue = "KerberosKeytab"; /// AccountKey. public static SecretsType AccountKey { get; } = new SecretsType(AccountKeyValue); @@ -37,10 +35,6 @@ public SecretsType(string value) public static SecretsType Sas { get; } = new SecretsType(SasValue); /// ServicePrincipal. public static SecretsType ServicePrincipal { get; } = new SecretsType(ServicePrincipalValue); - /// KerberosPassword. - public static SecretsType KerberosPassword { get; } = new SecretsType(KerberosPasswordValue); - /// KerberosKeytab. - public static SecretsType KerberosKeytab { get; } = new SecretsType(KerberosKeytabValue); /// Determines if two values are the same. public static bool operator ==(SecretsType left, SecretsType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs index bc36506f08d5a..69489e0b57f7f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs @@ -13,26 +13,29 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class LabelingJobTextProperties : IUtf8JsonSerializable, IJsonModel + public partial class ServerlessComputeSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobTextProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessComputeSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(AnnotationType)) + if (Optional.IsDefined(ServerlessComputeCustomSubnet)) { - writer.WritePropertyName("annotationType"u8); - writer.WriteStringValue(AnnotationType.Value.ToString()); + writer.WritePropertyName("serverlessComputeCustomSubnet"u8); + writer.WriteStringValue(ServerlessComputeCustomSubnet); + } + if (Optional.IsDefined(HasNoPublicIP)) + { + writer.WritePropertyName("serverlessComputeNoPublicIP"u8); + writer.WriteBooleanValue(HasNoPublicIP.Value); } - writer.WritePropertyName("mediaType"u8); - writer.WriteStringValue(MediaType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -51,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteEndObject(); } - LabelingJobTextProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServerlessComputeSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobTextProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessComputeSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobTextProperties(document.RootElement, options); + return DeserializeServerlessComputeSettings(document.RootElement, options); } - internal static LabelingJobTextProperties DeserializeLabelingJobTextProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServerlessComputeSettings DeserializeServerlessComputeSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -71,24 +74,28 @@ internal static LabelingJobTextProperties DeserializeLabelingJobTextProperties(J { return null; } - TextAnnotationType? annotationType = default; - MediaType mediaType = default; + ResourceIdentifier serverlessComputeCustomSubnet = default; + bool? serverlessComputeNoPublicIP = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("annotationType"u8)) + if (property.NameEquals("serverlessComputeCustomSubnet"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - annotationType = new TextAnnotationType(property.Value.GetString()); + serverlessComputeCustomSubnet = new ResourceIdentifier(property.Value.GetString()); continue; } - if (property.NameEquals("mediaType"u8)) + if (property.NameEquals("serverlessComputeNoPublicIP"u8)) { - mediaType = new MediaType(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverlessComputeNoPublicIP = property.Value.GetBoolean(); continue; } if (options.Format != "W") @@ -97,38 +104,38 @@ internal static LabelingJobTextProperties DeserializeLabelingJobTextProperties(J } } serializedAdditionalRawData = rawDataDictionary; - return new LabelingJobTextProperties(mediaType, serializedAdditionalRawData, annotationType); + return new ServerlessComputeSettings(serverlessComputeCustomSubnet, serverlessComputeNoPublicIP, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingJobTextProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessComputeSettings)} does not support writing '{options.Format}' format."); } } - LabelingJobTextProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServerlessComputeSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobTextProperties(document.RootElement, options); + return DeserializeServerlessComputeSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingJobTextProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessComputeSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs new file mode 100644 index 0000000000000..d67ba34046456 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessComputeSettings. + public partial class ServerlessComputeSettings + { + /// + /// 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 . + public ServerlessComputeSettings() + { + } + + /// Initializes a new instance of . + /// The resource ID of an existing virtual network subnet in which serverless compute nodes should be deployed. + /// The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP addresses for a workspace with private endpoint. + /// Keeps track of any properties unknown to the library. + internal ServerlessComputeSettings(ResourceIdentifier serverlessComputeCustomSubnet, bool? hasNoPublicIP, IDictionary serializedAdditionalRawData) + { + ServerlessComputeCustomSubnet = serverlessComputeCustomSubnet; + HasNoPublicIP = hasNoPublicIP; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource ID of an existing virtual network subnet in which serverless compute nodes should be deployed. + public ResourceIdentifier ServerlessComputeCustomSubnet { get; set; } + /// The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP addresses for a workspace with private endpoint. + public bool? HasNoPublicIP { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.Serialization.cs new file mode 100644 index 0000000000000..554e4ef639657 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ServerlessEndpointCapacityReservation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointCapacityReservation)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("capacityReservationGroupId"u8); + writer.WriteStringValue(CapacityReservationGroupId); + if (Optional.IsDefined(EndpointReservedCapacity)) + { + writer.WritePropertyName("endpointReservedCapacity"u8); + writer.WriteNumberValue(EndpointReservedCapacity.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointCapacityReservation 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(ServerlessEndpointCapacityReservation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointCapacityReservation(document.RootElement, options); + } + + internal static ServerlessEndpointCapacityReservation DeserializeServerlessEndpointCapacityReservation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string capacityReservationGroupId = default; + int? endpointReservedCapacity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capacityReservationGroupId"u8)) + { + capacityReservationGroupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpointReservedCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointReservedCapacity = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointCapacityReservation(capacityReservationGroupId, endpointReservedCapacity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointCapacityReservation)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointCapacityReservation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointCapacityReservation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointCapacityReservation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobPatch.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.cs similarity index 52% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobPatch.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.cs index f8f1962da25c1..98f81305c7224 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobPatch.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Azure Resource Manager resource envelope strictly used in update requests. - public partial class MachineLearningJobPatch + /// The ServerlessEndpointCapacityReservation. + public partial class ServerlessEndpointCapacityReservation { /// /// Keeps track of any properties unknown to the library. @@ -45,36 +45,35 @@ public partial class MachineLearningJobPatch /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public MachineLearningJobPatch() + /// Initializes a new instance of . + /// + /// is null. + public ServerlessEndpointCapacityReservation(string capacityReservationGroupId) { + Argument.AssertNotNull(capacityReservationGroupId, nameof(capacityReservationGroupId)); + + CapacityReservationGroupId = capacityReservationGroupId; } - /// Initializes a new instance of . - /// Additional attributes of the entity. + /// Initializes a new instance of . + /// + /// /// Keeps track of any properties unknown to the library. - internal MachineLearningJobPatch(PartialJobBase properties, IDictionary serializedAdditionalRawData) + internal ServerlessEndpointCapacityReservation(string capacityReservationGroupId, int? endpointReservedCapacity, IDictionary serializedAdditionalRawData) { - Properties = properties; + CapacityReservationGroupId = capacityReservationGroupId; + EndpointReservedCapacity = endpointReservedCapacity; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Additional attributes of the entity. - internal PartialJobBase Properties { get; set; } - /// - /// Send webhook callback to a service. Key is a user-provided name for the webhook. - /// 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 . - /// - public IDictionary NotificationSettingWebhooks + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointCapacityReservation() { - get => Properties is null ? default : Properties.NotificationSettingWebhooks; - set - { - if (Properties is null) - Properties = new PartialJobBase(); - Properties.NotificationSettingWebhooks = value; - } } + + /// Gets or sets the capacity reservation group id. + public string CapacityReservationGroupId { get; set; } + /// Gets or sets the endpoint reserved capacity. + public int? EndpointReservedCapacity { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.Serialization.cs new file mode 100644 index 0000000000000..4aa4b25d79b85 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class ServerlessEndpointContentSafety : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointContentSafety)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("contentSafetyStatus"u8); + writer.WriteStringValue(ContentSafetyStatus.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointContentSafety 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(ServerlessEndpointContentSafety)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointContentSafety(document.RootElement, options); + } + + internal static ServerlessEndpointContentSafety DeserializeServerlessEndpointContentSafety(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContentSafetyStatus contentSafetyStatus = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("contentSafetyStatus"u8)) + { + contentSafetyStatus = new ContentSafetyStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointContentSafety(contentSafetyStatus, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointContentSafety)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointContentSafety IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointContentSafety(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointContentSafety)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutologgerSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs similarity index 60% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutologgerSettings.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs index 7132feb9c94a1..e6dca65e1513b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutologgerSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Settings for Autologger. - internal partial class AutologgerSettings + /// The ServerlessEndpointContentSafety. + internal partial class ServerlessEndpointContentSafety { /// /// Keeps track of any properties unknown to the library. @@ -45,28 +45,28 @@ internal partial class AutologgerSettings /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// [Required] Indicates whether mlflow autologger is enabled. - public AutologgerSettings(MachineLearningFlowAutoLoggerState mlflowAutologger) + /// Initializes a new instance of . + /// Specifies the status of content safety. + public ServerlessEndpointContentSafety(ContentSafetyStatus contentSafetyStatus) { - MlflowAutologger = mlflowAutologger; + ContentSafetyStatus = contentSafetyStatus; } - /// Initializes a new instance of . - /// [Required] Indicates whether mlflow autologger is enabled. + /// Initializes a new instance of . + /// Specifies the status of content safety. /// Keeps track of any properties unknown to the library. - internal AutologgerSettings(MachineLearningFlowAutoLoggerState mlflowAutologger, IDictionary serializedAdditionalRawData) + internal ServerlessEndpointContentSafety(ContentSafetyStatus contentSafetyStatus, IDictionary serializedAdditionalRawData) { - MlflowAutologger = mlflowAutologger; + ContentSafetyStatus = contentSafetyStatus; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AutologgerSettings() + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointContentSafety() { } - /// [Required] Indicates whether mlflow autologger is enabled. - public MachineLearningFlowAutoLoggerState MlflowAutologger { get; set; } + /// Specifies the status of content safety. + public ContentSafetyStatus ContentSafetyStatus { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.Serialization.cs similarity index 54% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.Serialization.cs index bcf0e14efae05..a6b10fe0200f5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.Serialization.cs @@ -13,33 +13,32 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class UnknownModelPerformanceMetricThresholdBase : IUtf8JsonSerializable, IJsonModel + public partial class ServerlessEndpointInferenceEndpoint : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointInferenceEndpoint)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("modelType"u8); - writer.WriteStringValue(ModelType.ToString()); - if (Optional.IsDefined(Threshold)) + if (options.Format != "W" && Optional.IsCollectionDefined(Headers)) { - if (Threshold != null) + writer.WritePropertyName("headers"u8); + writer.WriteStartObject(); + foreach (var item in Headers) { - writer.WritePropertyName("threshold"u8); - writer.WriteObjectValue(Threshold, options); - } - else - { - writer.WriteNull("threshold"); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } + writer.WriteEndObject(); } + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +57,19 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WriteEndObject(); } - ModelPerformanceMetricThresholdBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServerlessEndpointInferenceEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointInferenceEndpoint)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelPerformanceMetricThresholdBase(document.RootElement, options); + return DeserializeServerlessEndpointInferenceEndpoint(document.RootElement, options); } - internal static UnknownModelPerformanceMetricThresholdBase DeserializeUnknownModelPerformanceMetricThresholdBase(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServerlessEndpointInferenceEndpoint DeserializeServerlessEndpointInferenceEndpoint(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +77,29 @@ internal static UnknownModelPerformanceMetricThresholdBase DeserializeUnknownMod { return null; } - MonitoringModelType modelType = "Unknown"; - MonitoringThreshold threshold = default; + IReadOnlyDictionary headers = default; + Uri uri = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("modelType"u8)) - { - modelType = new MonitoringModelType(property.Value.GetString()); - continue; - } - if (property.NameEquals("threshold"u8)) + if (property.NameEquals("headers"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - threshold = null; continue; } - threshold = MonitoringThreshold.DeserializeMonitoringThreshold(property.Value, options); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + headers = dictionary; + continue; + } + if (property.NameEquals("uri"u8)) + { + uri = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -105,38 +108,38 @@ internal static UnknownModelPerformanceMetricThresholdBase DeserializeUnknownMod } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownModelPerformanceMetricThresholdBase(modelType, threshold, serializedAdditionalRawData); + return new ServerlessEndpointInferenceEndpoint(headers ?? new ChangeTrackingDictionary(), uri, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointInferenceEndpoint)} does not support writing '{options.Format}' format."); } } - ModelPerformanceMetricThresholdBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServerlessEndpointInferenceEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelPerformanceMetricThresholdBase(document.RootElement, options); + return DeserializeServerlessEndpointInferenceEndpoint(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointInferenceEndpoint)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.cs new file mode 100644 index 0000000000000..eb530c9162ab4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessEndpointInferenceEndpoint. + public partial class ServerlessEndpointInferenceEndpoint + { + /// + /// 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 . + /// + /// is null. + public ServerlessEndpointInferenceEndpoint(Uri uri) + { + Argument.AssertNotNull(uri, nameof(uri)); + + Headers = new ChangeTrackingDictionary(); + Uri = uri; + } + + /// Initializes a new instance of . + /// Dictionary of <string>. + /// + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointInferenceEndpoint(IReadOnlyDictionary headers, Uri uri, IDictionary serializedAdditionalRawData) + { + Headers = headers; + Uri = uri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointInferenceEndpoint() + { + } + + /// Dictionary of <string>. + public IReadOnlyDictionary Headers { get; } + /// Gets or sets the uri. + public Uri Uri { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.Serialization.cs similarity index 54% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.Serialization.cs index 34ecd1edae807..33387b645913e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.Serialization.cs @@ -13,21 +13,21 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class UnknownBaseEnvironmentSource : IUtf8JsonSerializable, IJsonModel + internal partial class ServerlessEndpointModelSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointModelSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("baseEnvironmentSourceType"u8); - writer.WriteStringValue(BaseEnvironmentSourceType.ToString()); + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +46,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteEndObject(); } - BaseEnvironmentSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServerlessEndpointModelSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointModelSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBaseEnvironmentSource(document.RootElement, options); + return DeserializeServerlessEndpointModelSettings(document.RootElement, options); } - internal static UnknownBaseEnvironmentSource DeserializeUnknownBaseEnvironmentSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServerlessEndpointModelSettings DeserializeServerlessEndpointModelSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +66,14 @@ internal static UnknownBaseEnvironmentSource DeserializeUnknownBaseEnvironmentSo { return null; } - BaseEnvironmentSourceType baseEnvironmentSourceType = "Unknown"; + string modelId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("baseEnvironmentSourceType"u8)) + if (property.NameEquals("modelId"u8)) { - baseEnvironmentSourceType = new BaseEnvironmentSourceType(property.Value.GetString()); + modelId = property.Value.GetString(); continue; } if (options.Format != "W") @@ -82,38 +82,38 @@ internal static UnknownBaseEnvironmentSource DeserializeUnknownBaseEnvironmentSo } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownBaseEnvironmentSource(baseEnvironmentSourceType, serializedAdditionalRawData); + return new ServerlessEndpointModelSettings(modelId, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointModelSettings)} does not support writing '{options.Format}' format."); } } - BaseEnvironmentSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServerlessEndpointModelSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBaseEnvironmentSource(document.RootElement, options); + return DeserializeServerlessEndpointModelSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointModelSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingDataConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs similarity index 61% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingDataConfiguration.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs index 1fc50b67c3972..8971c72c55109 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingDataConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Labeling data configuration definition. - public partial class LabelingDataConfiguration + /// The ServerlessEndpointModelSettings. + internal partial class ServerlessEndpointModelSettings { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,31 @@ public partial class LabelingDataConfiguration /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public LabelingDataConfiguration() + /// Initializes a new instance of . + /// + /// is null. + public ServerlessEndpointModelSettings(string modelId) { + Argument.AssertNotNull(modelId, nameof(modelId)); + + ModelId = modelId; } - /// Initializes a new instance of . - /// Resource Id of the data asset to perform labeling. - /// Indicates whether to enable incremental data refresh. + /// Initializes a new instance of . + /// /// Keeps track of any properties unknown to the library. - internal LabelingDataConfiguration(string dataId, IncrementalDataRefresh? incrementalDataRefresh, IDictionary serializedAdditionalRawData) + internal ServerlessEndpointModelSettings(string modelId, IDictionary serializedAdditionalRawData) { - DataId = dataId; - IncrementalDataRefresh = incrementalDataRefresh; + ModelId = modelId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Resource Id of the data asset to perform labeling. - public string DataId { get; set; } - /// Indicates whether to enable incremental data refresh. - public IncrementalDataRefresh? IncrementalDataRefresh { get; set; } + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointModelSettings() + { + } + + /// Gets or sets the model id. + public string ModelId { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.Serialization.cs similarity index 52% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.Serialization.cs index 197f1fd5d2ac3..df1c9acd0a4c2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.Serialization.cs @@ -13,45 +13,40 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class PackageInputPathVersion : IUtf8JsonSerializable, IJsonModel + public partial class ServerlessEndpointPatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathVersion)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointPatch)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(ResourceName)) + if (Optional.IsDefined(Identity)) { - if (ResourceName != null) - { - writer.WritePropertyName("resourceName"u8); - writer.WriteStringValue(ResourceName); - } - else - { - writer.WriteNull("resourceName"); - } + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); } - if (Optional.IsDefined(ResourceVersion)) + if (Optional.IsDefined(Sku)) { - if (ResourceVersion != null) - { - writer.WritePropertyName("resourceVersion"u8); - writer.WriteStringValue(ResourceVersion); - } - else + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) { - writer.WriteNull("resourceVersion"); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } + writer.WriteEndObject(); } - writer.WritePropertyName("inputPathType"u8); - writer.WriteStringValue(InputPathType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -70,19 +65,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndObject(); } - PackageInputPathVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServerlessEndpointPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathVersion)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointPatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePackageInputPathVersion(document.RootElement, options); + return DeserializeServerlessEndpointPatch(document.RootElement, options); } - internal static PackageInputPathVersion DeserializePackageInputPathVersion(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServerlessEndpointPatch DeserializeServerlessEndpointPatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -90,36 +85,43 @@ internal static PackageInputPathVersion DeserializePackageInputPathVersion(JsonE { return null; } - string resourceName = default; - string resourceVersion = default; - InputPathType inputPathType = default; + MachineLearningPartialManagedServiceIdentity identity = default; + MachineLearningSkuPatch sku = default; + IDictionary tags = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("resourceName"u8)) + if (property.NameEquals("identity"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - resourceName = null; continue; } - resourceName = property.Value.GetString(); + identity = MachineLearningPartialManagedServiceIdentity.DeserializeMachineLearningPartialManagedServiceIdentity(property.Value, options); continue; } - if (property.NameEquals("resourceVersion"u8)) + if (property.NameEquals("sku"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - resourceVersion = null; continue; } - resourceVersion = property.Value.GetString(); + sku = MachineLearningSkuPatch.DeserializeMachineLearningSkuPatch(property.Value, options); continue; } - if (property.NameEquals("inputPathType"u8)) + if (property.NameEquals("tags"u8)) { - inputPathType = new InputPathType(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; continue; } if (options.Format != "W") @@ -128,38 +130,38 @@ internal static PackageInputPathVersion DeserializePackageInputPathVersion(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new PackageInputPathVersion(inputPathType, serializedAdditionalRawData, resourceName, resourceVersion); + return new ServerlessEndpointPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, identity, sku); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PackageInputPathVersion)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointPatch)} does not support writing '{options.Format}' format."); } } - PackageInputPathVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServerlessEndpointPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePackageInputPathVersion(document.RootElement, options); + return DeserializeServerlessEndpointPatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PackageInputPathVersion)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointPatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.cs new file mode 100644 index 0000000000000..137336fae71e7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Strictly used in update requests. + public partial class ServerlessEndpointPatch : MachineLearningResourcePatch + { + /// Initializes a new instance of . + public ServerlessEndpointPatch() + { + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + /// Managed service identity (system assigned and/or user assigned identities). + /// Sku details required for ARM contract for Autoscaling. + internal ServerlessEndpointPatch(IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningPartialManagedServiceIdentity identity, MachineLearningSkuPatch sku) : base(tags, serializedAdditionalRawData) + { + Identity = identity; + Sku = sku; + } + + /// Managed service identity (system assigned and/or user assigned identities). + public MachineLearningPartialManagedServiceIdentity Identity { get; set; } + /// Sku details required for ARM contract for Autoscaling. + public MachineLearningSkuPatch Sku { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.Serialization.cs new file mode 100644 index 0000000000000..dbf0dcccaa49c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.Serialization.cs @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ServerlessEndpointProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("authMode"u8); + writer.WriteStringValue(AuthMode.ToString()); + if (Optional.IsDefined(ContentSafety)) + { + if (ContentSafety != null) + { + writer.WritePropertyName("contentSafety"u8); + writer.WriteObjectValue(ContentSafety, options); + } + else + { + writer.WriteNull("contentSafety"); + } + } + if (options.Format != "W" && Optional.IsDefined(EndpointState)) + { + writer.WritePropertyName("endpointState"u8); + writer.WriteStringValue(EndpointState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(InferenceEndpoint)) + { + if (InferenceEndpoint != null) + { + writer.WritePropertyName("inferenceEndpoint"u8); + writer.WriteObjectValue(InferenceEndpoint, options); + } + else + { + writer.WriteNull("inferenceEndpoint"); + } + } + if (options.Format != "W" && Optional.IsDefined(MarketplaceSubscriptionId)) + { + if (MarketplaceSubscriptionId != null) + { + writer.WritePropertyName("marketplaceSubscriptionId"u8); + writer.WriteStringValue(MarketplaceSubscriptionId); + } + else + { + writer.WriteNull("marketplaceSubscriptionId"); + } + } + if (Optional.IsDefined(ModelSettings)) + { + if (ModelSettings != null) + { + writer.WritePropertyName("modelSettings"u8); + writer.WriteObjectValue(ModelSettings, options); + } + else + { + writer.WriteNull("modelSettings"); + } + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointProperties 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(ServerlessEndpointProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointProperties(document.RootElement, options); + } + + internal static ServerlessEndpointProperties DeserializeServerlessEndpointProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServerlessInferenceEndpointAuthMode authMode = default; + ContentSafety contentSafety = default; + ServerlessEndpointState? endpointState = default; + ServerlessInferenceEndpoint inferenceEndpoint = default; + string marketplaceSubscriptionId = default; + ModelSettings modelSettings = default; + MachineLearningEndpointProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authMode"u8)) + { + authMode = new ServerlessInferenceEndpointAuthMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("contentSafety"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + contentSafety = null; + continue; + } + contentSafety = ContentSafety.DeserializeContentSafety(property.Value, options); + continue; + } + if (property.NameEquals("endpointState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointState = new ServerlessEndpointState(property.Value.GetString()); + continue; + } + if (property.NameEquals("inferenceEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + inferenceEndpoint = null; + continue; + } + inferenceEndpoint = ServerlessInferenceEndpoint.DeserializeServerlessInferenceEndpoint(property.Value, options); + continue; + } + if (property.NameEquals("marketplaceSubscriptionId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + marketplaceSubscriptionId = null; + continue; + } + marketplaceSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + modelSettings = null; + continue; + } + modelSettings = ModelSettings.DeserializeModelSettings(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MachineLearningEndpointProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointProperties( + authMode, + contentSafety, + endpointState, + inferenceEndpoint, + marketplaceSubscriptionId, + modelSettings, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointProperties)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.cs new file mode 100644 index 0000000000000..e3db0035b547c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessEndpointProperties. + public partial class ServerlessEndpointProperties + { + /// + /// 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 . + /// [Required] Specifies the authentication mode for the Serverless endpoint. + public ServerlessEndpointProperties(ServerlessInferenceEndpointAuthMode authMode) + { + AuthMode = authMode; + } + + /// Initializes a new instance of . + /// [Required] Specifies the authentication mode for the Serverless endpoint. + /// Specifies the content safety options. If omitted, the default content safety settings will be configured. + /// The current state of the ServerlessEndpoint. + /// The inference uri to target when making requests against the serverless endpoint. + /// The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint. + /// The model settings (model id) for the model being serviced on the ServerlessEndpoint. + /// Provisioning state for the endpoint. + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointProperties(ServerlessInferenceEndpointAuthMode authMode, ContentSafety contentSafety, ServerlessEndpointState? endpointState, ServerlessInferenceEndpoint inferenceEndpoint, string marketplaceSubscriptionId, ModelSettings modelSettings, MachineLearningEndpointProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + AuthMode = authMode; + ContentSafety = contentSafety; + EndpointState = endpointState; + InferenceEndpoint = inferenceEndpoint; + MarketplaceSubscriptionId = marketplaceSubscriptionId; + ModelSettings = modelSettings; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointProperties() + { + } + + /// [Required] Specifies the authentication mode for the Serverless endpoint. + public ServerlessInferenceEndpointAuthMode AuthMode { get; set; } + /// Specifies the content safety options. If omitted, the default content safety settings will be configured. + internal ContentSafety ContentSafety { get; set; } + /// [Required] Specifies the status of content safety. + public ContentSafetyStatus? ContentSafetyStatus + { + get => ContentSafety is null ? default(ContentSafetyStatus?) : ContentSafety.ContentSafetyStatus; + set + { + ContentSafety = value.HasValue ? new ContentSafety(value.Value) : null; + } + } + + /// The current state of the ServerlessEndpoint. + public ServerlessEndpointState? EndpointState { get; } + /// The inference uri to target when making requests against the serverless endpoint. + public ServerlessInferenceEndpoint InferenceEndpoint { get; } + /// The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint. + public string MarketplaceSubscriptionId { get; } + /// The model settings (model id) for the model being serviced on the ServerlessEndpoint. + internal ModelSettings ModelSettings { get; set; } + /// The unique model identifier that this ServerlessEndpoint should provision. + public string ModelId + { + get => ModelSettings is null ? default : ModelSettings.ModelId; + set + { + if (ModelSettings is null) + ModelSettings = new ModelSettings(); + ModelSettings.ModelId = value; + } + } + + /// Provisioning state for the endpoint. + public MachineLearningEndpointProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..52b5229b2826d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.Serialization.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ServerlessEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AuthMode)) + { + writer.WritePropertyName("authMode"u8); + writer.WriteStringValue(AuthMode.Value.ToString()); + } + if (Optional.IsDefined(CapacityReservation)) + { + writer.WritePropertyName("capacityReservation"u8); + writer.WriteObjectValue(CapacityReservation, options); + } + if (Optional.IsDefined(ContentSafety)) + { + writer.WritePropertyName("contentSafety"u8); + writer.WriteObjectValue(ContentSafety, options); + } + if (Optional.IsDefined(EndpointState)) + { + writer.WritePropertyName("endpointState"u8); + writer.WriteStringValue(EndpointState.Value.ToString()); + } + if (Optional.IsDefined(InferenceEndpoint)) + { + writer.WritePropertyName("inferenceEndpoint"u8); + writer.WriteObjectValue(InferenceEndpoint, options); + } + if (Optional.IsDefined(MarketplaceSubscriptionId)) + { + writer.WritePropertyName("marketplaceSubscriptionId"u8); + writer.WriteStringValue(MarketplaceSubscriptionId); + } + if (Optional.IsDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Metadata); +#else + using (JsonDocument document = JsonDocument.Parse(Metadata)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(ModelSettings)) + { + writer.WritePropertyName("modelSettings"u8); + writer.WriteObjectValue(ModelSettings, options); + } + if (Optional.IsDefined(Offer)) + { + writer.WritePropertyName("offer"u8); + writer.WriteObjectValue(Offer, options); + } + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointResourceProperties 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(ServerlessEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointResourceProperties(document.RootElement, options); + } + + internal static ServerlessEndpointResourceProperties DeserializeServerlessEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServerlessInferenceEndpointAuthMode? authMode = default; + ServerlessEndpointCapacityReservation capacityReservation = default; + ServerlessEndpointContentSafety contentSafety = default; + ServerlessEndpointState? endpointState = default; + ServerlessEndpointInferenceEndpoint inferenceEndpoint = default; + string marketplaceSubscriptionId = default; + BinaryData metadata = default; + ServerlessEndpointModelSettings modelSettings = default; + ServerlessOffer offer = default; + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new ServerlessInferenceEndpointAuthMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("capacityReservation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityReservation = ServerlessEndpointCapacityReservation.DeserializeServerlessEndpointCapacityReservation(property.Value, options); + continue; + } + if (property.NameEquals("contentSafety"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + contentSafety = ServerlessEndpointContentSafety.DeserializeServerlessEndpointContentSafety(property.Value, options); + continue; + } + if (property.NameEquals("endpointState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointState = new ServerlessEndpointState(property.Value.GetString()); + continue; + } + if (property.NameEquals("inferenceEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inferenceEndpoint = ServerlessEndpointInferenceEndpoint.DeserializeServerlessEndpointInferenceEndpoint(property.Value, options); + continue; + } + if (property.NameEquals("marketplaceSubscriptionId"u8)) + { + marketplaceSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metadata = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("modelSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + modelSettings = ServerlessEndpointModelSettings.DeserializeServerlessEndpointModelSettings(property.Value, options); + continue; + } + if (property.NameEquals("offer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offer = ServerlessOffer.DeserializeServerlessOffer(property.Value, options); + continue; + } + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData, + authMode, + capacityReservation, + contentSafety, + endpointState, + inferenceEndpoint, + marketplaceSubscriptionId, + metadata, + modelSettings, + offer); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.cs new file mode 100644 index 0000000000000..3a4142dae258c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessEndpointResourceProperties. + public partial class ServerlessEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public ServerlessEndpointResourceProperties() + { + EndpointType = EndpointType.ServerlessEndpoint; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + /// + /// + /// + /// State of the Serverless Endpoint. + /// + /// + /// Anything. + /// + /// + internal ServerlessEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData, ServerlessInferenceEndpointAuthMode? authMode, ServerlessEndpointCapacityReservation capacityReservation, ServerlessEndpointContentSafety contentSafety, ServerlessEndpointState? endpointState, ServerlessEndpointInferenceEndpoint inferenceEndpoint, string marketplaceSubscriptionId, BinaryData metadata, ServerlessEndpointModelSettings modelSettings, ServerlessOffer offer) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + AuthMode = authMode; + CapacityReservation = capacityReservation; + ContentSafety = contentSafety; + EndpointState = endpointState; + InferenceEndpoint = inferenceEndpoint; + MarketplaceSubscriptionId = marketplaceSubscriptionId; + Metadata = metadata; + ModelSettings = modelSettings; + Offer = offer; + EndpointType = endpointType; + } + + /// Gets or sets the auth mode. + public ServerlessInferenceEndpointAuthMode? AuthMode { get; set; } + /// Gets or sets the capacity reservation. + public ServerlessEndpointCapacityReservation CapacityReservation { get; set; } + /// Gets or sets the content safety. + internal ServerlessEndpointContentSafety ContentSafety { get; set; } + /// Specifies the status of content safety. + public ContentSafetyStatus? ContentSafetyStatus + { + get => ContentSafety is null ? default(ContentSafetyStatus?) : ContentSafety.ContentSafetyStatus; + set + { + ContentSafety = value.HasValue ? new ServerlessEndpointContentSafety(value.Value) : null; + } + } + + /// State of the Serverless Endpoint. + public ServerlessEndpointState? EndpointState { get; set; } + /// Gets or sets the inference endpoint. + public ServerlessEndpointInferenceEndpoint InferenceEndpoint { get; set; } + /// Gets or sets the marketplace subscription id. + public string MarketplaceSubscriptionId { get; set; } + /// + /// Anything + /// + /// 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 Metadata { get; set; } + /// Gets or sets the model settings. + internal ServerlessEndpointModelSettings ModelSettings { get; set; } + /// Gets or sets the model id. + public string ModelId + { + get => ModelSettings is null ? default : ModelSettings.ModelId; + set => ModelSettings = new ServerlessEndpointModelSettings(value); + } + + /// Gets or sets the offer. + public ServerlessOffer Offer { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointState.cs new file mode 100644 index 0000000000000..20ed358358e1f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointState.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// State of the Serverless Endpoint. + public readonly partial struct ServerlessEndpointState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServerlessEndpointState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string CreatingValue = "Creating"; + private const string DeletingValue = "Deleting"; + private const string SuspendingValue = "Suspending"; + private const string ReinstatingValue = "Reinstating"; + private const string OnlineValue = "Online"; + private const string SuspendedValue = "Suspended"; + private const string CreationFailedValue = "CreationFailed"; + private const string DeletionFailedValue = "DeletionFailed"; + + /// Unknown. + public static ServerlessEndpointState Unknown { get; } = new ServerlessEndpointState(UnknownValue); + /// Creating. + public static ServerlessEndpointState Creating { get; } = new ServerlessEndpointState(CreatingValue); + /// Deleting. + public static ServerlessEndpointState Deleting { get; } = new ServerlessEndpointState(DeletingValue); + /// Suspending. + public static ServerlessEndpointState Suspending { get; } = new ServerlessEndpointState(SuspendingValue); + /// Reinstating. + public static ServerlessEndpointState Reinstating { get; } = new ServerlessEndpointState(ReinstatingValue); + /// Online. + public static ServerlessEndpointState Online { get; } = new ServerlessEndpointState(OnlineValue); + /// Suspended. + public static ServerlessEndpointState Suspended { get; } = new ServerlessEndpointState(SuspendedValue); + /// CreationFailed. + public static ServerlessEndpointState CreationFailed { get; } = new ServerlessEndpointState(CreationFailedValue); + /// DeletionFailed. + public static ServerlessEndpointState DeletionFailed { get; } = new ServerlessEndpointState(DeletionFailedValue); + /// Determines if two values are the same. + public static bool operator ==(ServerlessEndpointState left, ServerlessEndpointState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServerlessEndpointState left, ServerlessEndpointState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ServerlessEndpointState(string value) => new ServerlessEndpointState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServerlessEndpointState other && Equals(other); + /// + public bool Equals(ServerlessEndpointState 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 0000000000000..dc873f503bf42 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class ServerlessEndpointTrackedResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointTrackedResourceArmPaginatedResult 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(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement, options); + } + + internal static ServerlessEndpointTrackedResourceArmPaginatedResult DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ServerlessEndpointData.DeserializeServerlessEndpointData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointTrackedResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointTrackedResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.cs similarity index 62% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobResourceArmPaginatedResult.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.cs index 916d2df9caa61..e51f01c2ded01 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobResourceArmPaginatedResult.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// A paginated list of LabelingJob entities. - internal partial class LabelingJobResourceArmPaginatedResult + /// A paginated list of ServerlessEndpoint entities. + internal partial class ServerlessEndpointTrackedResourceArmPaginatedResult { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,26 @@ internal partial class LabelingJobResourceArmPaginatedResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal LabelingJobResourceArmPaginatedResult() + /// Initializes a new instance of . + internal ServerlessEndpointTrackedResourceArmPaginatedResult() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The link to the next page of LabelingJob objects. If null, there are no additional pages. - /// An array of objects of type LabelingJob. + /// Initializes a new instance of . + /// The link to the next page of ServerlessEndpoint objects. If null, there are no additional pages. + /// An array of objects of type ServerlessEndpoint. /// Keeps track of any properties unknown to the library. - internal LabelingJobResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal ServerlessEndpointTrackedResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) { NextLink = nextLink; Value = value; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The link to the next page of LabelingJob objects. If null, there are no additional pages. + /// The link to the next page of ServerlessEndpoint objects. If null, there are no additional pages. public string NextLink { get; } - /// An array of objects of type LabelingJob. - public IReadOnlyList Value { get; } + /// An array of objects of type ServerlessEndpoint. + public IReadOnlyList Value { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs similarity index 52% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs index e83af705645c7..18fda5b97b887 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs @@ -13,37 +13,39 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class PartialNotificationSetting : IUtf8JsonSerializable, IJsonModel + public partial class ServerlessInferenceEndpoint : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PartialNotificationSetting)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Webhooks)) + if (options.Format != "W" && Optional.IsCollectionDefined(Headers)) { - if (Webhooks != null) + if (Headers != null) { - writer.WritePropertyName("webhooks"u8); + writer.WritePropertyName("headers"u8); writer.WriteStartObject(); - foreach (var item in Webhooks) + foreach (var item in Headers) { writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); + writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } else { - writer.WriteNull("webhooks"); + writer.WriteNull("headers"); } } + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -62,19 +64,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - PartialNotificationSetting IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServerlessInferenceEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PartialNotificationSetting)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePartialNotificationSetting(document.RootElement, options); + return DeserializeServerlessInferenceEndpoint(document.RootElement, options); } - internal static PartialNotificationSetting DeserializePartialNotificationSetting(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServerlessInferenceEndpoint DeserializeServerlessInferenceEndpoint(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -82,24 +84,30 @@ internal static PartialNotificationSetting DeserializePartialNotificationSetting { return null; } - IDictionary webhooks = default; + IReadOnlyDictionary headers = default; + Uri uri = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("webhooks"u8)) + if (property.NameEquals("headers"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - webhooks = null; + headers = null; continue; } - Dictionary dictionary = new Dictionary(); + Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { - dictionary.Add(property0.Name, MachineLearningWebhook.DeserializeMachineLearningWebhook(property0.Value, options)); + dictionary.Add(property0.Name, property0.Value.GetString()); } - webhooks = dictionary; + headers = dictionary; + continue; + } + if (property.NameEquals("uri"u8)) + { + uri = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -108,38 +116,38 @@ internal static PartialNotificationSetting DeserializePartialNotificationSetting } } serializedAdditionalRawData = rawDataDictionary; - return new PartialNotificationSetting(webhooks ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new ServerlessInferenceEndpoint(headers ?? new ChangeTrackingDictionary(), uri, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PartialNotificationSetting)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support writing '{options.Format}' format."); } } - PartialNotificationSetting IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServerlessInferenceEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePartialNotificationSetting(document.RootElement, options); + return DeserializeServerlessInferenceEndpoint(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PartialNotificationSetting)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs new file mode 100644 index 0000000000000..759d80976d6d6 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessInferenceEndpoint. + public partial class ServerlessInferenceEndpoint + { + /// + /// 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 . + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + /// is null. + internal ServerlessInferenceEndpoint(Uri uri) + { + Argument.AssertNotNull(uri, nameof(uri)); + + Headers = new ChangeTrackingDictionary(); + Uri = uri; + } + + /// Initializes a new instance of . + /// Specifies any required headers to target this serverless endpoint. + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + /// Keeps track of any properties unknown to the library. + internal ServerlessInferenceEndpoint(IReadOnlyDictionary headers, Uri uri, IDictionary serializedAdditionalRawData) + { + Headers = headers; + Uri = uri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessInferenceEndpoint() + { + } + + /// Specifies any required headers to target this serverless endpoint. + public IReadOnlyDictionary Headers { get; } + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + public Uri Uri { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpointAuthMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpointAuthMode.cs new file mode 100644 index 0000000000000..13b4dd94ff67b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpointAuthMode.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessInferenceEndpointAuthMode. + public readonly partial struct ServerlessInferenceEndpointAuthMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServerlessInferenceEndpointAuthMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string KeyValue = "Key"; + + /// Key. + public static ServerlessInferenceEndpointAuthMode Key { get; } = new ServerlessInferenceEndpointAuthMode(KeyValue); + /// Determines if two values are the same. + public static bool operator ==(ServerlessInferenceEndpointAuthMode left, ServerlessInferenceEndpointAuthMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServerlessInferenceEndpointAuthMode left, ServerlessInferenceEndpointAuthMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ServerlessInferenceEndpointAuthMode(string value) => new ServerlessInferenceEndpointAuthMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServerlessInferenceEndpointAuthMode other && Equals(other); + /// + public bool Equals(ServerlessInferenceEndpointAuthMode 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProperty.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.Serialization.cs similarity index 55% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProperty.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.Serialization.cs index 05ae363c37dd7..3d5ffbd62a5df 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProperty.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.Serialization.cs @@ -13,24 +13,21 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class IntellectualProperty : IUtf8JsonSerializable, IJsonModel + public partial class ServerlessOffer : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IntellectualProperty)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessOffer)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(ProtectionLevel)) - { - writer.WritePropertyName("protectionLevel"u8); - writer.WriteStringValue(ProtectionLevel.Value.ToString()); - } + writer.WritePropertyName("offerName"u8); + writer.WriteStringValue(OfferName); writer.WritePropertyName("publisher"u8); writer.WriteStringValue(Publisher); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -51,19 +48,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteEndObject(); } - IntellectualProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServerlessOffer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IntellectualProperty)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessOffer)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIntellectualProperty(document.RootElement, options); + return DeserializeServerlessOffer(document.RootElement, options); } - internal static IntellectualProperty DeserializeIntellectualProperty(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServerlessOffer DeserializeServerlessOffer(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -71,19 +68,15 @@ internal static IntellectualProperty DeserializeIntellectualProperty(JsonElement { return null; } - IntellectualProtectionLevel? protectionLevel = default; + string offerName = default; string publisher = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("protectionLevel"u8)) + if (property.NameEquals("offerName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - protectionLevel = new IntellectualProtectionLevel(property.Value.GetString()); + offerName = property.Value.GetString(); continue; } if (property.NameEquals("publisher"u8)) @@ -97,38 +90,38 @@ internal static IntellectualProperty DeserializeIntellectualProperty(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new IntellectualProperty(protectionLevel, publisher, serializedAdditionalRawData); + return new ServerlessOffer(offerName, publisher, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(IntellectualProperty)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessOffer)} does not support writing '{options.Format}' format."); } } - IntellectualProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServerlessOffer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeIntellectualProperty(document.RootElement, options); + return DeserializeServerlessOffer(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IntellectualProperty)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessOffer)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProperty.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProperty.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs index 203461ef52013..faf4d027440c9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProperty.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Intellectual Property details for a resource. - public partial class IntellectualProperty + /// The ServerlessOffer. + public partial class ServerlessOffer { /// /// Keeps track of any properties unknown to the library. @@ -45,35 +45,38 @@ public partial class IntellectualProperty /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// [Required] Publisher of the Intellectual Property. Must be the same as Registry publisher name. - /// is null. - public IntellectualProperty(string publisher) + /// Initializes a new instance of . + /// + /// + /// or is null. + public ServerlessOffer(string offerName, string publisher) { + Argument.AssertNotNull(offerName, nameof(offerName)); Argument.AssertNotNull(publisher, nameof(publisher)); + OfferName = offerName; Publisher = publisher; } - /// Initializes a new instance of . - /// Protection level of the Intellectual Property. - /// [Required] Publisher of the Intellectual Property. Must be the same as Registry publisher name. + /// Initializes a new instance of . + /// + /// /// Keeps track of any properties unknown to the library. - internal IntellectualProperty(IntellectualProtectionLevel? protectionLevel, string publisher, IDictionary serializedAdditionalRawData) + internal ServerlessOffer(string offerName, string publisher, IDictionary serializedAdditionalRawData) { - ProtectionLevel = protectionLevel; + OfferName = offerName; Publisher = publisher; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal IntellectualProperty() + /// Initializes a new instance of for deserialization. + internal ServerlessOffer() { } - /// Protection level of the Intellectual Property. - public IntellectualProtectionLevel? ProtectionLevel { get; set; } - /// [Required] Publisher of the Intellectual Property. Must be the same as Registry publisher name. + /// Gets or sets the offer name. + public string OfferName { get; set; } + /// Gets or sets the publisher. public string Publisher { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceAccountKeyName.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceAccountKeyName.cs new file mode 100644 index 0000000000000..651f2dd032cf7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceAccountKeyName.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServiceAccountKeyName. + public readonly partial struct ServiceAccountKeyName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServiceAccountKeyName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Key1Value = "Key1"; + private const string Key2Value = "Key2"; + + /// Key1. + public static ServiceAccountKeyName Key1 { get; } = new ServiceAccountKeyName(Key1Value); + /// Key2. + public static ServiceAccountKeyName Key2 { get; } = new ServiceAccountKeyName(Key2Value); + /// Determines if two values are the same. + public static bool operator ==(ServiceAccountKeyName left, ServiceAccountKeyName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServiceAccountKeyName left, ServiceAccountKeyName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ServiceAccountKeyName(string value) => new ServiceAccountKeyName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServiceAccountKeyName other && Equals(other); + /// + public bool Equals(ServiceAccountKeyName 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.Serialization.cs index d68a9abe87d5e..6be65baab1336 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write(Utf writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ WorkspaceConnectionServicePrincipal credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ return new ServicePrincipalAuthTypeWorkspaceConnectionProperties( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.cs index b61e38060f39d..d23a13d1d53ea 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,12 +23,20 @@ public ServicePrincipalAuthTypeWorkspaceConnectionProperties() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// - internal ServicePrincipalAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, WorkspaceConnectionServicePrincipal credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal ServicePrincipalAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionServicePrincipal credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.Serialization.cs index e3e25ed2f533b..899a9cd602418 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.Serialization.cs @@ -36,6 +36,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -83,6 +93,7 @@ internal static ServiceTagOutboundRule DeserializeServiceTagOutboundRule(JsonEle } ServiceTagDestination destination = default; OutboundRuleCategory? category = default; + IReadOnlyList parentRuleNames = default; OutboundRuleStatus? status = default; OutboundRuleType type = default; IDictionary serializedAdditionalRawData = default; @@ -107,6 +118,20 @@ internal static ServiceTagOutboundRule DeserializeServiceTagOutboundRule(JsonEle category = new OutboundRuleCategory(property.Value.GetString()); continue; } + if (property.NameEquals("parentRuleNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parentRuleNames = array; + continue; + } if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -127,7 +152,13 @@ internal static ServiceTagOutboundRule DeserializeServiceTagOutboundRule(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new ServiceTagOutboundRule(category, status, type, serializedAdditionalRawData, destination); + return new ServiceTagOutboundRule( + category, + parentRuleNames ?? new ChangeTrackingList(), + status, + type, + serializedAdditionalRawData, + destination); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.cs index 3044028f3dbff..91e02ffc49d27 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.cs @@ -21,11 +21,12 @@ public ServiceTagOutboundRule() /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. /// Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - internal ServiceTagOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, ServiceTagDestination destination) : base(category, status, outboundRuleType, serializedAdditionalRawData) + internal ServiceTagOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, ServiceTagDestination destination) : base(category, parentRuleNames, status, outboundRuleType, serializedAdditionalRawData) { Destination = destination; OutboundRuleType = outboundRuleType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.Serialization.cs index b0044007767ae..08ed4c9ccfa9f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.Serialization.cs @@ -89,6 +89,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions writer.WriteNull("environmentId"); } } + if (Optional.IsCollectionDefined(EnvironmentVariables)) + { + if (EnvironmentVariables != null) + { + writer.WritePropertyName("environmentVariables"u8); + writer.WriteStartObject(); + foreach (var item in EnvironmentVariables) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("environmentVariables"); + } + } if (Optional.IsCollectionDefined(Files)) { if (Files != null) @@ -272,24 +290,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -401,10 +401,11 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri } IList archives = default; string args = default; - string codeId = default; + ResourceIdentifier codeId = default; IDictionary conf = default; SparkJobEntry entry = default; - string environmentId = default; + ResourceIdentifier environmentId = default; + IDictionary environmentVariables = default; IList files = default; IDictionary inputs = default; IList jars = default; @@ -420,7 +421,6 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri bool? isArchived = default; JobType jobType = default; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -457,7 +457,7 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri } if (property.NameEquals("codeId"u8)) { - codeId = property.Value.GetString(); + codeId = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("conf"u8)) @@ -487,7 +487,22 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri environmentId = null; continue; } - environmentId = property.Value.GetString(); + environmentId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("environmentVariables"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + environmentVariables = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + environmentVariables = dictionary; continue; } if (property.NameEquals("files"u8)) @@ -654,21 +669,6 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -752,7 +752,6 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status, archives ?? new ChangeTrackingList(), @@ -761,6 +760,7 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri conf ?? new ChangeTrackingDictionary(), entry, environmentId, + environmentVariables ?? new ChangeTrackingDictionary(), files ?? new ChangeTrackingList(), inputs ?? new ChangeTrackingDictionary(), jars ?? new ChangeTrackingList(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.cs index db3414d23c5eb..6ac19e0aeb67c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.cs @@ -15,14 +15,14 @@ namespace Azure.ResourceManager.MachineLearning.Models public partial class SparkJob : MachineLearningJobProperties { /// Initializes a new instance of . - /// [Required] ARM resource ID of the code asset. + /// [Required] arm-id of the code asset. /// /// [Required] The entry to execute on startup of the job. /// 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 . /// /// or is null. - public SparkJob(string codeId, SparkJobEntry entry) + public SparkJob(ResourceIdentifier codeId, SparkJobEntry entry) { Argument.AssertNotNull(codeId, nameof(codeId)); Argument.AssertNotNull(entry, nameof(entry)); @@ -31,6 +31,7 @@ public SparkJob(string codeId, SparkJobEntry entry) CodeId = codeId; Conf = new ChangeTrackingDictionary(); Entry = entry; + EnvironmentVariables = new ChangeTrackingDictionary(); Files = new ChangeTrackingList(); Inputs = new ChangeTrackingDictionary(); Jars = new ChangeTrackingList(); @@ -57,7 +58,6 @@ public SparkJob(string codeId, SparkJobEntry entry) /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -65,7 +65,7 @@ public SparkJob(string codeId, SparkJobEntry entry) /// Status of the job. /// Archive files used in the job. /// Arguments for the job. - /// [Required] ARM resource ID of the code asset. + /// [Required] arm-id of the code asset. /// Spark configured properties. /// /// [Required] The entry to execute on startup of the job. @@ -73,6 +73,7 @@ public SparkJob(string codeId, SparkJobEntry entry) /// The available derived classes include and . /// /// The ARM resource ID of the Environment specification for the job. + /// Environment variables included in the job. /// Files used in the job. /// /// Mapping of input data bindings used in the job. @@ -88,7 +89,7 @@ public SparkJob(string codeId, SparkJobEntry entry) /// Python files used in the job. /// Queue settings for the job. /// Compute Resource configuration for the job. - internal SparkJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status, IList archives, string args, string codeId, IDictionary conf, SparkJobEntry entry, string environmentId, IList files, IDictionary inputs, IList jars, IDictionary outputs, IList pyFiles, JobQueueSettings queueSettings, SparkResourceConfiguration resources) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) + internal SparkJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, IList archives, string args, ResourceIdentifier codeId, IDictionary conf, SparkJobEntry entry, ResourceIdentifier environmentId, IDictionary environmentVariables, IList files, IDictionary inputs, IList jars, IDictionary outputs, IList pyFiles, JobQueueSettings queueSettings, SparkResourceConfiguration resources) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) { Archives = archives; Args = args; @@ -96,6 +97,7 @@ internal SparkJob(string description, IDictionary properties, ID Conf = conf; Entry = entry; EnvironmentId = environmentId; + EnvironmentVariables = environmentVariables; Files = files; Inputs = inputs; Jars = jars; @@ -115,8 +117,8 @@ internal SparkJob() public IList Archives { get; set; } /// Arguments for the job. public string Args { get; set; } - /// [Required] ARM resource ID of the code asset. - public string CodeId { get; set; } + /// [Required] arm-id of the code asset. + public ResourceIdentifier CodeId { get; set; } /// Spark configured properties. public IDictionary Conf { get; set; } /// @@ -126,7 +128,9 @@ internal SparkJob() /// public SparkJobEntry Entry { get; set; } /// The ARM resource ID of the Environment specification for the job. - public string EnvironmentId { get; set; } + public ResourceIdentifier EnvironmentId { get; set; } + /// Environment variables included in the job. + public IDictionary EnvironmentVariables { get; set; } /// Files used in the job. public IList Files { get; set; } /// @@ -146,7 +150,19 @@ internal SparkJob() /// Python files used in the job. public IList PyFiles { get; set; } /// Queue settings for the job. - public JobQueueSettings QueueSettings { get; set; } + internal JobQueueSettings QueueSettings { get; set; } + /// Controls the compute job tier. + public JobTier? QueueJobTier + { + get => QueueSettings is null ? default : QueueSettings.JobTier; + set + { + if (QueueSettings is null) + QueueSettings = new JobQueueSettings(); + QueueSettings.JobTier = value; + } + } + /// Compute Resource configuration for the job. public SparkResourceConfiguration Resources { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..2ef1472d3ea19 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class SpeechEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpeechEndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (Optional.IsDefined(RaiPolicyName)) + { + writer.WritePropertyName("raiPolicyName"u8); + writer.WriteStringValue(RaiPolicyName); + } + if (Optional.IsDefined(VersionUpgradeOption)) + { + writer.WritePropertyName("versionUpgradeOption"u8); + writer.WriteStringValue(VersionUpgradeOption.Value.ToString()); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SpeechEndpointDeploymentResourceProperties 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(SpeechEndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpeechEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static SpeechEndpointDeploymentResourceProperties DeserializeSpeechEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointDeploymentModel model = default; + string raiPolicyName = default; + DeploymentModelVersionUpgradeOption? versionUpgradeOption = default; + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("model"u8)) + { + model = EndpointDeploymentModel.DeserializeEndpointDeploymentModel(property.Value, options); + continue; + } + if (property.NameEquals("raiPolicyName"u8)) + { + raiPolicyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("versionUpgradeOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + versionUpgradeOption = new DeploymentModelVersionUpgradeOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SpeechEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + type, + serializedAdditionalRawData, + model, + raiPolicyName, + versionUpgradeOption); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SpeechEndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + SpeechEndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSpeechEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SpeechEndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.cs new file mode 100644 index 0000000000000..a683fbee428d8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The SpeechEndpointDeploymentResourceProperties. + public partial class SpeechEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + /// Model used for the endpoint deployment. + /// is null. + public SpeechEndpointDeploymentResourceProperties(EndpointDeploymentModel model) + { + Argument.AssertNotNull(model, nameof(model)); + + Model = model; + EndpointDeploymentResourcePropertiesType = "Azure.Speech"; + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + internal SpeechEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData, EndpointDeploymentModel model, string raiPolicyName, DeploymentModelVersionUpgradeOption? versionUpgradeOption) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + Model = model; + RaiPolicyName = raiPolicyName; + VersionUpgradeOption = versionUpgradeOption; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "Azure.Speech"; + } + + /// Initializes a new instance of for deserialization. + internal SpeechEndpointDeploymentResourceProperties() + { + } + + /// Model used for the endpoint deployment. + public EndpointDeploymentModel Model { get; set; } + /// The name of RAI policy. + public string RaiPolicyName { get; set; } + /// Deployment model version upgrade option. + public DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..82b4200464e19 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class SpeechEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpeechEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SpeechEndpointResourceProperties 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(SpeechEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpeechEndpointResourceProperties(document.RootElement, options); + } + + internal static SpeechEndpointResourceProperties DeserializeSpeechEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SpeechEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SpeechEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + SpeechEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSpeechEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SpeechEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.cs new file mode 100644 index 0000000000000..7270ce4db5afa --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The SpeechEndpointResourceProperties. + public partial class SpeechEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public SpeechEndpointResourceProperties() + { + EndpointType = EndpointType.AzureSpeech; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal SpeechEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + EndpointType = endpointType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StaticInputData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StaticInputData.cs index 3a28979c22bb3..66bb5c6cce714 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StaticInputData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StaticInputData.cs @@ -35,7 +35,7 @@ public StaticInputData(JobInputType jobInputType, Uri uri, DateTimeOffset window /// [Required] Specifies the type of job. /// [Required] Input Asset URI. /// Keeps track of any properties unknown to the library. - /// The ARM resource ID of the component resource used to preprocess the data. + /// Reference to the component asset used to preprocess the data. /// [Required] The end date of the data window. /// [Required] The start date of the data window. internal StaticInputData(IDictionary columns, string dataContext, MonitoringInputDataType inputDataType, JobInputType jobInputType, Uri uri, IDictionary serializedAdditionalRawData, string preprocessingComponentId, DateTimeOffset windowEnd, DateTimeOffset windowStart) : base(columns, dataContext, inputDataType, jobInputType, uri, serializedAdditionalRawData) @@ -51,7 +51,7 @@ internal StaticInputData() { } - /// The ARM resource ID of the component resource used to preprocess the data. + /// Reference to the component asset used to preprocess the data. public string PreprocessingComponentId { get; set; } /// [Required] The end date of the data window. public DateTimeOffset WindowEnd { get; set; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StorageAccountDetails.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StorageAccountDetails.cs index e2c5fe1ec91a2..f43e117cd8ad7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StorageAccountDetails.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StorageAccountDetails.cs @@ -53,7 +53,7 @@ public StorageAccountDetails() /// Initializes a new instance of . /// Details of system created storage account to be used for the registry. - /// Details of user created storage account to be used for the registry. Not supported in most cases and will throw 400 error if provided. + /// Details of user created storage account to be used for the registry. /// Keeps track of any properties unknown to the library. internal StorageAccountDetails(SystemCreatedStorageAccount systemCreatedStorageAccount, UserCreatedStorageAccount userCreatedStorageAccount, IDictionary serializedAdditionalRawData) { @@ -64,7 +64,7 @@ internal StorageAccountDetails(SystemCreatedStorageAccount systemCreatedStorageA /// Details of system created storage account to be used for the registry. public SystemCreatedStorageAccount SystemCreatedStorageAccount { get; set; } - /// Details of user created storage account to be used for the registry. Not supported in most cases and will throw 400 error if provided. + /// Details of user created storage account to be used for the registry. internal UserCreatedStorageAccount UserCreatedStorageAccount { get; set; } /// /// Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.Serialization.cs deleted file mode 100644 index 7506941223ec7..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.Serialization.cs +++ /dev/null @@ -1,576 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class TableFixedParameters : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableFixedParameters)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Booster)) - { - if (Booster != null) - { - writer.WritePropertyName("booster"u8); - writer.WriteStringValue(Booster); - } - else - { - writer.WriteNull("booster"); - } - } - if (Optional.IsDefined(BoostingType)) - { - if (BoostingType != null) - { - writer.WritePropertyName("boostingType"u8); - writer.WriteStringValue(BoostingType); - } - else - { - writer.WriteNull("boostingType"); - } - } - if (Optional.IsDefined(GrowPolicy)) - { - if (GrowPolicy != null) - { - writer.WritePropertyName("growPolicy"u8); - writer.WriteStringValue(GrowPolicy); - } - else - { - writer.WriteNull("growPolicy"); - } - } - if (Optional.IsDefined(LearningRate)) - { - if (LearningRate != null) - { - writer.WritePropertyName("learningRate"u8); - writer.WriteNumberValue(LearningRate.Value); - } - else - { - writer.WriteNull("learningRate"); - } - } - if (Optional.IsDefined(MaxBin)) - { - if (MaxBin != null) - { - writer.WritePropertyName("maxBin"u8); - writer.WriteNumberValue(MaxBin.Value); - } - else - { - writer.WriteNull("maxBin"); - } - } - if (Optional.IsDefined(MaxDepth)) - { - if (MaxDepth != null) - { - writer.WritePropertyName("maxDepth"u8); - writer.WriteNumberValue(MaxDepth.Value); - } - else - { - writer.WriteNull("maxDepth"); - } - } - if (Optional.IsDefined(MaxLeaves)) - { - if (MaxLeaves != null) - { - writer.WritePropertyName("maxLeaves"u8); - writer.WriteNumberValue(MaxLeaves.Value); - } - else - { - writer.WriteNull("maxLeaves"); - } - } - if (Optional.IsDefined(MinDataInLeaf)) - { - if (MinDataInLeaf != null) - { - writer.WritePropertyName("minDataInLeaf"u8); - writer.WriteNumberValue(MinDataInLeaf.Value); - } - else - { - writer.WriteNull("minDataInLeaf"); - } - } - if (Optional.IsDefined(MinSplitGain)) - { - if (MinSplitGain != null) - { - writer.WritePropertyName("minSplitGain"u8); - writer.WriteNumberValue(MinSplitGain.Value); - } - else - { - writer.WriteNull("minSplitGain"); - } - } - if (Optional.IsDefined(ModelName)) - { - if (ModelName != null) - { - writer.WritePropertyName("modelName"u8); - writer.WriteStringValue(ModelName); - } - else - { - writer.WriteNull("modelName"); - } - } - if (Optional.IsDefined(NEstimators)) - { - if (NEstimators != null) - { - writer.WritePropertyName("nEstimators"u8); - writer.WriteNumberValue(NEstimators.Value); - } - else - { - writer.WriteNull("nEstimators"); - } - } - if (Optional.IsDefined(NumLeaves)) - { - if (NumLeaves != null) - { - writer.WritePropertyName("numLeaves"u8); - writer.WriteNumberValue(NumLeaves.Value); - } - else - { - writer.WriteNull("numLeaves"); - } - } - if (Optional.IsDefined(PreprocessorName)) - { - if (PreprocessorName != null) - { - writer.WritePropertyName("preprocessorName"u8); - writer.WriteStringValue(PreprocessorName); - } - else - { - writer.WriteNull("preprocessorName"); - } - } - if (Optional.IsDefined(RegAlpha)) - { - if (RegAlpha != null) - { - writer.WritePropertyName("regAlpha"u8); - writer.WriteNumberValue(RegAlpha.Value); - } - else - { - writer.WriteNull("regAlpha"); - } - } - if (Optional.IsDefined(RegLambda)) - { - if (RegLambda != null) - { - writer.WritePropertyName("regLambda"u8); - writer.WriteNumberValue(RegLambda.Value); - } - else - { - writer.WriteNull("regLambda"); - } - } - if (Optional.IsDefined(Subsample)) - { - if (Subsample != null) - { - writer.WritePropertyName("subsample"u8); - writer.WriteNumberValue(Subsample.Value); - } - else - { - writer.WriteNull("subsample"); - } - } - if (Optional.IsDefined(SubsampleFreq)) - { - if (SubsampleFreq != null) - { - writer.WritePropertyName("subsampleFreq"u8); - writer.WriteNumberValue(SubsampleFreq.Value); - } - else - { - writer.WriteNull("subsampleFreq"); - } - } - if (Optional.IsDefined(TreeMethod)) - { - if (TreeMethod != null) - { - writer.WritePropertyName("treeMethod"u8); - writer.WriteStringValue(TreeMethod); - } - else - { - writer.WriteNull("treeMethod"); - } - } - if (Optional.IsDefined(WithMean)) - { - writer.WritePropertyName("withMean"u8); - writer.WriteBooleanValue(WithMean.Value); - } - if (Optional.IsDefined(WithStd)) - { - writer.WritePropertyName("withStd"u8); - writer.WriteBooleanValue(WithStd.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - TableFixedParameters 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(TableFixedParameters)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTableFixedParameters(document.RootElement, options); - } - - internal static TableFixedParameters DeserializeTableFixedParameters(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string booster = default; - string boostingType = default; - string growPolicy = default; - double? learningRate = default; - int? maxBin = default; - int? maxDepth = default; - int? maxLeaves = default; - int? minDataInLeaf = default; - double? minSplitGain = default; - string modelName = default; - int? nEstimators = default; - int? numLeaves = default; - string preprocessorName = default; - double? regAlpha = default; - double? regLambda = default; - double? subsample = default; - double? subsampleFreq = default; - string treeMethod = default; - bool? withMean = default; - bool? withStd = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("booster"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - booster = null; - continue; - } - booster = property.Value.GetString(); - continue; - } - if (property.NameEquals("boostingType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - boostingType = null; - continue; - } - boostingType = property.Value.GetString(); - continue; - } - if (property.NameEquals("growPolicy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - growPolicy = null; - continue; - } - growPolicy = property.Value.GetString(); - continue; - } - if (property.NameEquals("learningRate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - learningRate = null; - continue; - } - learningRate = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("maxBin"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxBin = null; - continue; - } - maxBin = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxDepth"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxDepth = null; - continue; - } - maxDepth = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxLeaves"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxLeaves = null; - continue; - } - maxLeaves = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("minDataInLeaf"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - minDataInLeaf = null; - continue; - } - minDataInLeaf = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("minSplitGain"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - minSplitGain = null; - continue; - } - minSplitGain = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("modelName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - modelName = null; - continue; - } - modelName = property.Value.GetString(); - continue; - } - if (property.NameEquals("nEstimators"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - nEstimators = null; - continue; - } - nEstimators = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("numLeaves"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - numLeaves = null; - continue; - } - numLeaves = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("preprocessorName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - preprocessorName = null; - continue; - } - preprocessorName = property.Value.GetString(); - continue; - } - if (property.NameEquals("regAlpha"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - regAlpha = null; - continue; - } - regAlpha = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("regLambda"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - regLambda = null; - continue; - } - regLambda = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("subsample"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - subsample = null; - continue; - } - subsample = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("subsampleFreq"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - subsampleFreq = null; - continue; - } - subsampleFreq = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("treeMethod"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - treeMethod = null; - continue; - } - treeMethod = property.Value.GetString(); - continue; - } - if (property.NameEquals("withMean"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - withMean = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("withStd"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - withStd = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TableFixedParameters( - booster, - boostingType, - growPolicy, - learningRate, - maxBin, - maxDepth, - maxLeaves, - minDataInLeaf, - minSplitGain, - modelName, - nEstimators, - numLeaves, - preprocessorName, - regAlpha, - regLambda, - subsample, - subsampleFreq, - treeMethod, - withMean, - withStd, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TableFixedParameters)} does not support writing '{options.Format}' format."); - } - } - - TableFixedParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTableFixedParameters(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TableFixedParameters)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.cs deleted file mode 100644 index fddd314303ecf..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Fixed training parameters that won't be swept over during AutoML Table training. - public partial class TableFixedParameters - { - /// - /// 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 . - public TableFixedParameters() - { - } - - /// Initializes a new instance of . - /// Specify the boosting type, e.g gbdt for XGBoost. - /// Specify the boosting type, e.g gbdt for LightGBM. - /// Specify the grow policy, which controls the way new nodes are added to the tree. - /// The learning rate for the training procedure. - /// Specify the Maximum number of discrete bins to bucket continuous features . - /// Specify the max depth to limit the tree depth explicitly. - /// Specify the max leaves to limit the tree leaves explicitly. - /// The minimum number of data per leaf. - /// Minimum loss reduction required to make a further partition on a leaf node of the tree. - /// The name of the model to train. - /// Specify the number of trees (or rounds) in an model. - /// Specify the number of leaves. - /// The name of the preprocessor to use. - /// L1 regularization term on weights. - /// L2 regularization term on weights. - /// Subsample ratio of the training instance. - /// Frequency of subsample. - /// Specify the tree method. - /// If true, center before scaling the data with StandardScalar. - /// If true, scaling the data with Unit Variance with StandardScalar. - /// Keeps track of any properties unknown to the library. - internal TableFixedParameters(string booster, string boostingType, string growPolicy, double? learningRate, int? maxBin, int? maxDepth, int? maxLeaves, int? minDataInLeaf, double? minSplitGain, string modelName, int? nEstimators, int? numLeaves, string preprocessorName, double? regAlpha, double? regLambda, double? subsample, double? subsampleFreq, string treeMethod, bool? withMean, bool? withStd, IDictionary serializedAdditionalRawData) - { - Booster = booster; - BoostingType = boostingType; - GrowPolicy = growPolicy; - LearningRate = learningRate; - MaxBin = maxBin; - MaxDepth = maxDepth; - MaxLeaves = maxLeaves; - MinDataInLeaf = minDataInLeaf; - MinSplitGain = minSplitGain; - ModelName = modelName; - NEstimators = nEstimators; - NumLeaves = numLeaves; - PreprocessorName = preprocessorName; - RegAlpha = regAlpha; - RegLambda = regLambda; - Subsample = subsample; - SubsampleFreq = subsampleFreq; - TreeMethod = treeMethod; - WithMean = withMean; - WithStd = withStd; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Specify the boosting type, e.g gbdt for XGBoost. - public string Booster { get; set; } - /// Specify the boosting type, e.g gbdt for LightGBM. - public string BoostingType { get; set; } - /// Specify the grow policy, which controls the way new nodes are added to the tree. - public string GrowPolicy { get; set; } - /// The learning rate for the training procedure. - public double? LearningRate { get; set; } - /// Specify the Maximum number of discrete bins to bucket continuous features . - public int? MaxBin { get; set; } - /// Specify the max depth to limit the tree depth explicitly. - public int? MaxDepth { get; set; } - /// Specify the max leaves to limit the tree leaves explicitly. - public int? MaxLeaves { get; set; } - /// The minimum number of data per leaf. - public int? MinDataInLeaf { get; set; } - /// Minimum loss reduction required to make a further partition on a leaf node of the tree. - public double? MinSplitGain { get; set; } - /// The name of the model to train. - public string ModelName { get; set; } - /// Specify the number of trees (or rounds) in an model. - public int? NEstimators { get; set; } - /// Specify the number of leaves. - public int? NumLeaves { get; set; } - /// The name of the preprocessor to use. - public string PreprocessorName { get; set; } - /// L1 regularization term on weights. - public double? RegAlpha { get; set; } - /// L2 regularization term on weights. - public double? RegLambda { get; set; } - /// Subsample ratio of the training instance. - public double? Subsample { get; set; } - /// Frequency of subsample. - public double? SubsampleFreq { get; set; } - /// Specify the tree method. - public string TreeMethod { get; set; } - /// If true, center before scaling the data with StandardScalar. - public bool? WithMean { get; set; } - /// If true, scaling the data with Unit Variance with StandardScalar. - public bool? WithStd { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.Serialization.cs deleted file mode 100644 index d8623eb3c794f..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.Serialization.cs +++ /dev/null @@ -1,592 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class TableParameterSubspace : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableParameterSubspace)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Booster)) - { - if (Booster != null) - { - writer.WritePropertyName("booster"u8); - writer.WriteStringValue(Booster); - } - else - { - writer.WriteNull("booster"); - } - } - if (Optional.IsDefined(BoostingType)) - { - if (BoostingType != null) - { - writer.WritePropertyName("boostingType"u8); - writer.WriteStringValue(BoostingType); - } - else - { - writer.WriteNull("boostingType"); - } - } - if (Optional.IsDefined(GrowPolicy)) - { - if (GrowPolicy != null) - { - writer.WritePropertyName("growPolicy"u8); - writer.WriteStringValue(GrowPolicy); - } - else - { - writer.WriteNull("growPolicy"); - } - } - if (Optional.IsDefined(LearningRate)) - { - if (LearningRate != null) - { - writer.WritePropertyName("learningRate"u8); - writer.WriteStringValue(LearningRate); - } - else - { - writer.WriteNull("learningRate"); - } - } - if (Optional.IsDefined(MaxBin)) - { - if (MaxBin != null) - { - writer.WritePropertyName("maxBin"u8); - writer.WriteStringValue(MaxBin); - } - else - { - writer.WriteNull("maxBin"); - } - } - if (Optional.IsDefined(MaxDepth)) - { - if (MaxDepth != null) - { - writer.WritePropertyName("maxDepth"u8); - writer.WriteStringValue(MaxDepth); - } - else - { - writer.WriteNull("maxDepth"); - } - } - if (Optional.IsDefined(MaxLeaves)) - { - if (MaxLeaves != null) - { - writer.WritePropertyName("maxLeaves"u8); - writer.WriteStringValue(MaxLeaves); - } - else - { - writer.WriteNull("maxLeaves"); - } - } - if (Optional.IsDefined(MinDataInLeaf)) - { - if (MinDataInLeaf != null) - { - writer.WritePropertyName("minDataInLeaf"u8); - writer.WriteStringValue(MinDataInLeaf); - } - else - { - writer.WriteNull("minDataInLeaf"); - } - } - if (Optional.IsDefined(MinSplitGain)) - { - if (MinSplitGain != null) - { - writer.WritePropertyName("minSplitGain"u8); - writer.WriteStringValue(MinSplitGain); - } - else - { - writer.WriteNull("minSplitGain"); - } - } - if (Optional.IsDefined(ModelName)) - { - if (ModelName != null) - { - writer.WritePropertyName("modelName"u8); - writer.WriteStringValue(ModelName); - } - else - { - writer.WriteNull("modelName"); - } - } - if (Optional.IsDefined(NEstimators)) - { - if (NEstimators != null) - { - writer.WritePropertyName("nEstimators"u8); - writer.WriteStringValue(NEstimators); - } - else - { - writer.WriteNull("nEstimators"); - } - } - if (Optional.IsDefined(NumLeaves)) - { - if (NumLeaves != null) - { - writer.WritePropertyName("numLeaves"u8); - writer.WriteStringValue(NumLeaves); - } - else - { - writer.WriteNull("numLeaves"); - } - } - if (Optional.IsDefined(PreprocessorName)) - { - if (PreprocessorName != null) - { - writer.WritePropertyName("preprocessorName"u8); - writer.WriteStringValue(PreprocessorName); - } - else - { - writer.WriteNull("preprocessorName"); - } - } - if (Optional.IsDefined(RegAlpha)) - { - if (RegAlpha != null) - { - writer.WritePropertyName("regAlpha"u8); - writer.WriteStringValue(RegAlpha); - } - else - { - writer.WriteNull("regAlpha"); - } - } - if (Optional.IsDefined(RegLambda)) - { - if (RegLambda != null) - { - writer.WritePropertyName("regLambda"u8); - writer.WriteStringValue(RegLambda); - } - else - { - writer.WriteNull("regLambda"); - } - } - if (Optional.IsDefined(Subsample)) - { - if (Subsample != null) - { - writer.WritePropertyName("subsample"u8); - writer.WriteStringValue(Subsample); - } - else - { - writer.WriteNull("subsample"); - } - } - if (Optional.IsDefined(SubsampleFreq)) - { - if (SubsampleFreq != null) - { - writer.WritePropertyName("subsampleFreq"u8); - writer.WriteStringValue(SubsampleFreq); - } - else - { - writer.WriteNull("subsampleFreq"); - } - } - if (Optional.IsDefined(TreeMethod)) - { - if (TreeMethod != null) - { - writer.WritePropertyName("treeMethod"u8); - writer.WriteStringValue(TreeMethod); - } - else - { - writer.WriteNull("treeMethod"); - } - } - if (Optional.IsDefined(WithMean)) - { - if (WithMean != null) - { - writer.WritePropertyName("withMean"u8); - writer.WriteStringValue(WithMean); - } - else - { - writer.WriteNull("withMean"); - } - } - if (Optional.IsDefined(WithStd)) - { - if (WithStd != null) - { - writer.WritePropertyName("withStd"u8); - writer.WriteStringValue(WithStd); - } - else - { - writer.WriteNull("withStd"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - TableParameterSubspace 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(TableParameterSubspace)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTableParameterSubspace(document.RootElement, options); - } - - internal static TableParameterSubspace DeserializeTableParameterSubspace(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string booster = default; - string boostingType = default; - string growPolicy = default; - string learningRate = default; - string maxBin = default; - string maxDepth = default; - string maxLeaves = default; - string minDataInLeaf = default; - string minSplitGain = default; - string modelName = default; - string nEstimators = default; - string numLeaves = default; - string preprocessorName = default; - string regAlpha = default; - string regLambda = default; - string subsample = default; - string subsampleFreq = default; - string treeMethod = default; - string withMean = default; - string withStd = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("booster"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - booster = null; - continue; - } - booster = property.Value.GetString(); - continue; - } - if (property.NameEquals("boostingType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - boostingType = null; - continue; - } - boostingType = property.Value.GetString(); - continue; - } - if (property.NameEquals("growPolicy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - growPolicy = null; - continue; - } - growPolicy = property.Value.GetString(); - continue; - } - if (property.NameEquals("learningRate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - learningRate = null; - continue; - } - learningRate = property.Value.GetString(); - continue; - } - if (property.NameEquals("maxBin"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxBin = null; - continue; - } - maxBin = property.Value.GetString(); - continue; - } - if (property.NameEquals("maxDepth"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxDepth = null; - continue; - } - maxDepth = property.Value.GetString(); - continue; - } - if (property.NameEquals("maxLeaves"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxLeaves = null; - continue; - } - maxLeaves = property.Value.GetString(); - continue; - } - if (property.NameEquals("minDataInLeaf"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - minDataInLeaf = null; - continue; - } - minDataInLeaf = property.Value.GetString(); - continue; - } - if (property.NameEquals("minSplitGain"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - minSplitGain = null; - continue; - } - minSplitGain = property.Value.GetString(); - continue; - } - if (property.NameEquals("modelName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - modelName = null; - continue; - } - modelName = property.Value.GetString(); - continue; - } - if (property.NameEquals("nEstimators"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - nEstimators = null; - continue; - } - nEstimators = property.Value.GetString(); - continue; - } - if (property.NameEquals("numLeaves"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - numLeaves = null; - continue; - } - numLeaves = property.Value.GetString(); - continue; - } - if (property.NameEquals("preprocessorName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - preprocessorName = null; - continue; - } - preprocessorName = property.Value.GetString(); - continue; - } - if (property.NameEquals("regAlpha"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - regAlpha = null; - continue; - } - regAlpha = property.Value.GetString(); - continue; - } - if (property.NameEquals("regLambda"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - regLambda = null; - continue; - } - regLambda = property.Value.GetString(); - continue; - } - if (property.NameEquals("subsample"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - subsample = null; - continue; - } - subsample = property.Value.GetString(); - continue; - } - if (property.NameEquals("subsampleFreq"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - subsampleFreq = null; - continue; - } - subsampleFreq = property.Value.GetString(); - continue; - } - if (property.NameEquals("treeMethod"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - treeMethod = null; - continue; - } - treeMethod = property.Value.GetString(); - continue; - } - if (property.NameEquals("withMean"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - withMean = null; - continue; - } - withMean = property.Value.GetString(); - continue; - } - if (property.NameEquals("withStd"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - withStd = null; - continue; - } - withStd = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TableParameterSubspace( - booster, - boostingType, - growPolicy, - learningRate, - maxBin, - maxDepth, - maxLeaves, - minDataInLeaf, - minSplitGain, - modelName, - nEstimators, - numLeaves, - preprocessorName, - regAlpha, - regLambda, - subsample, - subsampleFreq, - treeMethod, - withMean, - withStd, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TableParameterSubspace)} does not support writing '{options.Format}' format."); - } - } - - TableParameterSubspace IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTableParameterSubspace(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TableParameterSubspace)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.cs deleted file mode 100644 index f866d59f05902..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The TableParameterSubspace. - public partial class TableParameterSubspace - { - /// - /// 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 . - public TableParameterSubspace() - { - } - - /// Initializes a new instance of . - /// Specify the boosting type, e.g gbdt for XGBoost. - /// Specify the boosting type, e.g gbdt for LightGBM. - /// Specify the grow policy, which controls the way new nodes are added to the tree. - /// The learning rate for the training procedure. - /// Specify the Maximum number of discrete bins to bucket continuous features . - /// Specify the max depth to limit the tree depth explicitly. - /// Specify the max leaves to limit the tree leaves explicitly. - /// The minimum number of data per leaf. - /// Minimum loss reduction required to make a further partition on a leaf node of the tree. - /// The name of the model to train. - /// Specify the number of trees (or rounds) in an model. - /// Specify the number of leaves. - /// The name of the preprocessor to use. - /// L1 regularization term on weights. - /// L2 regularization term on weights. - /// Subsample ratio of the training instance. - /// Frequency of subsample. - /// Specify the tree method. - /// If true, center before scaling the data with StandardScalar. - /// If true, scaling the data with Unit Variance with StandardScalar. - /// Keeps track of any properties unknown to the library. - internal TableParameterSubspace(string booster, string boostingType, string growPolicy, string learningRate, string maxBin, string maxDepth, string maxLeaves, string minDataInLeaf, string minSplitGain, string modelName, string nEstimators, string numLeaves, string preprocessorName, string regAlpha, string regLambda, string subsample, string subsampleFreq, string treeMethod, string withMean, string withStd, IDictionary serializedAdditionalRawData) - { - Booster = booster; - BoostingType = boostingType; - GrowPolicy = growPolicy; - LearningRate = learningRate; - MaxBin = maxBin; - MaxDepth = maxDepth; - MaxLeaves = maxLeaves; - MinDataInLeaf = minDataInLeaf; - MinSplitGain = minSplitGain; - ModelName = modelName; - NEstimators = nEstimators; - NumLeaves = numLeaves; - PreprocessorName = preprocessorName; - RegAlpha = regAlpha; - RegLambda = regLambda; - Subsample = subsample; - SubsampleFreq = subsampleFreq; - TreeMethod = treeMethod; - WithMean = withMean; - WithStd = withStd; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Specify the boosting type, e.g gbdt for XGBoost. - public string Booster { get; set; } - /// Specify the boosting type, e.g gbdt for LightGBM. - public string BoostingType { get; set; } - /// Specify the grow policy, which controls the way new nodes are added to the tree. - public string GrowPolicy { get; set; } - /// The learning rate for the training procedure. - public string LearningRate { get; set; } - /// Specify the Maximum number of discrete bins to bucket continuous features . - public string MaxBin { get; set; } - /// Specify the max depth to limit the tree depth explicitly. - public string MaxDepth { get; set; } - /// Specify the max leaves to limit the tree leaves explicitly. - public string MaxLeaves { get; set; } - /// The minimum number of data per leaf. - public string MinDataInLeaf { get; set; } - /// Minimum loss reduction required to make a further partition on a leaf node of the tree. - public string MinSplitGain { get; set; } - /// The name of the model to train. - public string ModelName { get; set; } - /// Specify the number of trees (or rounds) in an model. - public string NEstimators { get; set; } - /// Specify the number of leaves. - public string NumLeaves { get; set; } - /// The name of the preprocessor to use. - public string PreprocessorName { get; set; } - /// L1 regularization term on weights. - public string RegAlpha { get; set; } - /// L2 regularization term on weights. - public string RegLambda { get; set; } - /// Subsample ratio of the training instance. - public string Subsample { get; set; } - /// Frequency of subsample. - public string SubsampleFreq { get; set; } - /// Specify the tree method. - public string TreeMethod { get; set; } - /// If true, center before scaling the data with StandardScalar. - public string WithMean { get; set; } - /// If true, scaling the data with Unit Variance with StandardScalar. - public string WithStd { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.Serialization.cs deleted file mode 100644 index fa9260d3aa5b5..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class TableSweepSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableSweepSettings)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(EarlyTermination)) - { - if (EarlyTermination != null) - { - writer.WritePropertyName("earlyTermination"u8); - writer.WriteObjectValue(EarlyTermination, options); - } - else - { - writer.WriteNull("earlyTermination"); - } - } - writer.WritePropertyName("samplingAlgorithm"u8); - writer.WriteStringValue(SamplingAlgorithm.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - TableSweepSettings 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(TableSweepSettings)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTableSweepSettings(document.RootElement, options); - } - - internal static TableSweepSettings DeserializeTableSweepSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MachineLearningEarlyTerminationPolicy earlyTermination = default; - SamplingAlgorithmType samplingAlgorithm = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("earlyTermination"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - earlyTermination = null; - continue; - } - earlyTermination = MachineLearningEarlyTerminationPolicy.DeserializeMachineLearningEarlyTerminationPolicy(property.Value, options); - continue; - } - if (property.NameEquals("samplingAlgorithm"u8)) - { - samplingAlgorithm = new SamplingAlgorithmType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TableSweepSettings(earlyTermination, samplingAlgorithm, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TableSweepSettings)} does not support writing '{options.Format}' format."); - } - } - - TableSweepSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTableSweepSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TableSweepSettings)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.cs deleted file mode 100644 index b9051d2ef6952..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The TableSweepSettings. - public partial class TableSweepSettings - { - /// - /// 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 . - /// [Required] Type of sampling algorithm. - public TableSweepSettings(SamplingAlgorithmType samplingAlgorithm) - { - SamplingAlgorithm = samplingAlgorithm; - } - - /// Initializes a new instance of . - /// - /// Type of early termination policy for the sweeping job. - /// 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 . - /// - /// [Required] Type of sampling algorithm. - /// Keeps track of any properties unknown to the library. - internal TableSweepSettings(MachineLearningEarlyTerminationPolicy earlyTermination, SamplingAlgorithmType samplingAlgorithm, IDictionary serializedAdditionalRawData) - { - EarlyTermination = earlyTermination; - SamplingAlgorithm = samplingAlgorithm; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal TableSweepSettings() - { - } - - /// - /// Type of early termination policy for the sweeping job. - /// 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 MachineLearningEarlyTerminationPolicy EarlyTermination { get; set; } - /// [Required] Type of sampling algorithm. - public SamplingAlgorithmType SamplingAlgorithm { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.Serialization.cs index 86389889a0bef..66488dcaf71da 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.Serialization.cs @@ -53,26 +53,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WritePropertyName("maxCoresPerTrial"u8); writer.WriteNumberValue(MaxCoresPerTrial.Value); } - if (Optional.IsDefined(MaxNodes)) - { - writer.WritePropertyName("maxNodes"u8); - writer.WriteNumberValue(MaxNodes.Value); - } if (Optional.IsDefined(MaxTrials)) { writer.WritePropertyName("maxTrials"u8); writer.WriteNumberValue(MaxTrials.Value); } - if (Optional.IsDefined(SweepConcurrentTrials)) - { - writer.WritePropertyName("sweepConcurrentTrials"u8); - writer.WriteNumberValue(SweepConcurrentTrials.Value); - } - if (Optional.IsDefined(SweepTrials)) - { - writer.WritePropertyName("sweepTrials"u8); - writer.WriteNumberValue(SweepTrials.Value); - } if (Optional.IsDefined(Timeout)) { writer.WritePropertyName("timeout"u8); @@ -125,10 +110,7 @@ internal static TableVerticalLimitSettings DeserializeTableVerticalLimitSettings double? exitScore = default; int? maxConcurrentTrials = default; int? maxCoresPerTrial = default; - int? maxNodes = default; int? maxTrials = default; - int? sweepConcurrentTrials = default; - int? sweepTrials = default; TimeSpan? timeout = default; TimeSpan? trialTimeout = default; IDictionary serializedAdditionalRawData = default; @@ -172,15 +154,6 @@ internal static TableVerticalLimitSettings DeserializeTableVerticalLimitSettings maxCoresPerTrial = property.Value.GetInt32(); continue; } - if (property.NameEquals("maxNodes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxNodes = property.Value.GetInt32(); - continue; - } if (property.NameEquals("maxTrials"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -190,24 +163,6 @@ internal static TableVerticalLimitSettings DeserializeTableVerticalLimitSettings maxTrials = property.Value.GetInt32(); continue; } - if (property.NameEquals("sweepConcurrentTrials"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sweepConcurrentTrials = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("sweepTrials"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sweepTrials = property.Value.GetInt32(); - continue; - } if (property.NameEquals("timeout"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -237,10 +192,7 @@ internal static TableVerticalLimitSettings DeserializeTableVerticalLimitSettings exitScore, maxConcurrentTrials, maxCoresPerTrial, - maxNodes, maxTrials, - sweepConcurrentTrials, - sweepTrials, timeout, trialTimeout, serializedAdditionalRawData); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.cs index 161c66504ac4e..f58865b884080 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.cs @@ -55,23 +55,17 @@ public TableVerticalLimitSettings() /// Exit score for the AutoML job. /// Maximum Concurrent iterations. /// Max cores per iteration. - /// Maximum nodes to use for the experiment. /// Number of iterations. - /// Number of concurrent sweeping runs that user wants to trigger. - /// Number of sweeping runs that user wants to trigger. /// AutoML job timeout. /// Iteration timeout. /// Keeps track of any properties unknown to the library. - internal TableVerticalLimitSettings(bool? enableEarlyTermination, double? exitScore, int? maxConcurrentTrials, int? maxCoresPerTrial, int? maxNodes, int? maxTrials, int? sweepConcurrentTrials, int? sweepTrials, TimeSpan? timeout, TimeSpan? trialTimeout, IDictionary serializedAdditionalRawData) + internal TableVerticalLimitSettings(bool? enableEarlyTermination, double? exitScore, int? maxConcurrentTrials, int? maxCoresPerTrial, int? maxTrials, TimeSpan? timeout, TimeSpan? trialTimeout, IDictionary serializedAdditionalRawData) { EnableEarlyTermination = enableEarlyTermination; ExitScore = exitScore; MaxConcurrentTrials = maxConcurrentTrials; MaxCoresPerTrial = maxCoresPerTrial; - MaxNodes = maxNodes; MaxTrials = maxTrials; - SweepConcurrentTrials = sweepConcurrentTrials; - SweepTrials = sweepTrials; Timeout = timeout; TrialTimeout = trialTimeout; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -85,14 +79,8 @@ internal TableVerticalLimitSettings(bool? enableEarlyTermination, double? exitSc public int? MaxConcurrentTrials { get; set; } /// Max cores per iteration. public int? MaxCoresPerTrial { get; set; } - /// Maximum nodes to use for the experiment. - public int? MaxNodes { get; set; } /// Number of iterations. public int? MaxTrials { get; set; } - /// Number of concurrent sweeping runs that user wants to trigger. - public int? SweepConcurrentTrials { get; set; } - /// Number of sweeping runs that user wants to trigger. - public int? SweepTrials { get; set; } /// AutoML job timeout. public TimeSpan? Timeout { get; set; } /// Iteration timeout. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextAnnotationType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextAnnotationType.cs deleted file mode 100644 index aba8b04118684..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextAnnotationType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Annotation type of text data. - public readonly partial struct TextAnnotationType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public TextAnnotationType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ClassificationValue = "Classification"; - private const string NamedEntityRecognitionValue = "NamedEntityRecognition"; - - /// Classification. - public static TextAnnotationType Classification { get; } = new TextAnnotationType(ClassificationValue); - /// NamedEntityRecognition. - public static TextAnnotationType NamedEntityRecognition { get; } = new TextAnnotationType(NamedEntityRecognitionValue); - /// Determines if two values are the same. - public static bool operator ==(TextAnnotationType left, TextAnnotationType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(TextAnnotationType left, TextAnnotationType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator TextAnnotationType(string value) => new TextAnnotationType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is TextAnnotationType other && Equals(other); - /// - public bool Equals(TextAnnotationType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.Serialization.cs index 28b094eb612bd..4a46ae7bc00da 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.Serialization.cs @@ -43,18 +43,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("featurizationSettings"); } } - if (Optional.IsDefined(FixedParameters)) - { - if (FixedParameters != null) - { - writer.WritePropertyName("fixedParameters"u8); - writer.WriteObjectValue(FixedParameters, options); - } - else - { - writer.WriteNull("fixedParameters"); - } - } if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -67,35 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("limitSettings"); } } - if (Optional.IsCollectionDefined(SearchSpace)) - { - if (SearchSpace != null) - { - writer.WritePropertyName("searchSpace"u8); - writer.WriteStartArray(); - foreach (var item in SearchSpace) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("searchSpace"); - } - } - if (Optional.IsDefined(SweepSettings)) - { - if (SweepSettings != null) - { - writer.WritePropertyName("sweepSettings"u8); - writer.WriteObjectValue(SweepSettings, options); - } - else - { - writer.WriteNull("sweepSettings"); - } - } if (Optional.IsDefined(ValidationData)) { if (ValidationData != null) @@ -169,10 +128,7 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele } ClassificationPrimaryMetric? primaryMetric = default; NlpVerticalFeaturizationSettings featurizationSettings = default; - NlpFixedParameters fixedParameters = default; NlpVerticalLimitSettings limitSettings = default; - IList searchSpace = default; - NlpSweepSettings sweepSettings = default; MachineLearningTableJobInput validationData = default; MachineLearningLogVerbosity? logVerbosity = default; string targetColumnName = default; @@ -201,16 +157,6 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value, options); continue; } - if (property.NameEquals("fixedParameters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fixedParameters = null; - continue; - } - fixedParameters = NlpFixedParameters.DeserializeNlpFixedParameters(property.Value, options); - continue; - } if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -221,31 +167,6 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele limitSettings = NlpVerticalLimitSettings.DeserializeNlpVerticalLimitSettings(property.Value, options); continue; } - if (property.NameEquals("searchSpace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchSpace = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NlpParameterSubspace.DeserializeNlpParameterSubspace(item, options)); - } - searchSpace = array; - continue; - } - if (property.NameEquals("sweepSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sweepSettings = null; - continue; - } - sweepSettings = NlpSweepSettings.DeserializeNlpSweepSettings(property.Value, options); - continue; - } if (property.NameEquals("validationData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -299,10 +220,7 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele serializedAdditionalRawData, primaryMetric, featurizationSettings, - fixedParameters, limitSettings, - searchSpace ?? new ChangeTrackingList(), - sweepSettings, validationData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.cs index 26c16340bc85d..22cf9fcea45fb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.cs @@ -23,7 +23,6 @@ public TextClassification(MachineLearningTableJobInput trainingData) : base(trai { Argument.AssertNotNull(trainingData, nameof(trainingData)); - SearchSpace = new ChangeTrackingList(); TaskType = TaskType.TextClassification; } @@ -38,19 +37,13 @@ public TextClassification(MachineLearningTableJobInput trainingData) : base(trai /// Keeps track of any properties unknown to the library. /// Primary metric for Text-Classification task. /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Validation data inputs. - internal TextClassification(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpFixedParameters fixedParameters, NlpVerticalLimitSettings limitSettings, IList searchSpace, NlpSweepSettings sweepSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + internal TextClassification(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpVerticalLimitSettings limitSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) { PrimaryMetric = primaryMetric; FeaturizationSettings = featurizationSettings; - FixedParameters = fixedParameters; LimitSettings = limitSettings; - SearchSpace = searchSpace; - SweepSettings = sweepSettings; ValidationData = validationData; TaskType = taskType; } @@ -76,14 +69,8 @@ public string FeaturizationDatasetLanguage } } - /// Model/training parameters that will remain constant throughout training. - public NlpFixedParameters FixedParameters { get; set; } /// Execution constraints for AutoMLJob. public NlpVerticalLimitSettings LimitSettings { get; set; } - /// Search space for sampling different combinations of models and their hyperparameters. - public IList SearchSpace { get; set; } - /// Settings for model sweeping and hyperparameter tuning. - public NlpSweepSettings SweepSettings { get; set; } /// Validation data inputs. public MachineLearningTableJobInput ValidationData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.Serialization.cs index 5f97e68452b38..2b00747058a1b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.Serialization.cs @@ -43,18 +43,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("featurizationSettings"); } } - if (Optional.IsDefined(FixedParameters)) - { - if (FixedParameters != null) - { - writer.WritePropertyName("fixedParameters"u8); - writer.WriteObjectValue(FixedParameters, options); - } - else - { - writer.WriteNull("fixedParameters"); - } - } if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -67,35 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("limitSettings"); } } - if (Optional.IsCollectionDefined(SearchSpace)) - { - if (SearchSpace != null) - { - writer.WritePropertyName("searchSpace"u8); - writer.WriteStartArray(); - foreach (var item in SearchSpace) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("searchSpace"); - } - } - if (Optional.IsDefined(SweepSettings)) - { - if (SweepSettings != null) - { - writer.WritePropertyName("sweepSettings"u8); - writer.WriteObjectValue(SweepSettings, options); - } - else - { - writer.WriteNull("sweepSettings"); - } - } if (Optional.IsDefined(ValidationData)) { if (ValidationData != null) @@ -169,10 +128,7 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil } ClassificationMultilabelPrimaryMetric? primaryMetric = default; NlpVerticalFeaturizationSettings featurizationSettings = default; - NlpFixedParameters fixedParameters = default; NlpVerticalLimitSettings limitSettings = default; - IList searchSpace = default; - NlpSweepSettings sweepSettings = default; MachineLearningTableJobInput validationData = default; MachineLearningLogVerbosity? logVerbosity = default; string targetColumnName = default; @@ -201,16 +157,6 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value, options); continue; } - if (property.NameEquals("fixedParameters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fixedParameters = null; - continue; - } - fixedParameters = NlpFixedParameters.DeserializeNlpFixedParameters(property.Value, options); - continue; - } if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -221,31 +167,6 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil limitSettings = NlpVerticalLimitSettings.DeserializeNlpVerticalLimitSettings(property.Value, options); continue; } - if (property.NameEquals("searchSpace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchSpace = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NlpParameterSubspace.DeserializeNlpParameterSubspace(item, options)); - } - searchSpace = array; - continue; - } - if (property.NameEquals("sweepSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sweepSettings = null; - continue; - } - sweepSettings = NlpSweepSettings.DeserializeNlpSweepSettings(property.Value, options); - continue; - } if (property.NameEquals("validationData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -299,10 +220,7 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil serializedAdditionalRawData, primaryMetric, featurizationSettings, - fixedParameters, limitSettings, - searchSpace ?? new ChangeTrackingList(), - sweepSettings, validationData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.cs index 3baca6fe2380d..64180f34e8eb8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.cs @@ -23,7 +23,6 @@ public TextClassificationMultilabel(MachineLearningTableJobInput trainingData) : { Argument.AssertNotNull(trainingData, nameof(trainingData)); - SearchSpace = new ChangeTrackingList(); TaskType = TaskType.TextClassificationMultilabel; } @@ -41,19 +40,13 @@ public TextClassificationMultilabel(MachineLearningTableJobInput trainingData) : /// Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. /// /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Validation data inputs. - internal TextClassificationMultilabel(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationMultilabelPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpFixedParameters fixedParameters, NlpVerticalLimitSettings limitSettings, IList searchSpace, NlpSweepSettings sweepSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + internal TextClassificationMultilabel(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationMultilabelPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpVerticalLimitSettings limitSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) { PrimaryMetric = primaryMetric; FeaturizationSettings = featurizationSettings; - FixedParameters = fixedParameters; LimitSettings = limitSettings; - SearchSpace = searchSpace; - SweepSettings = sweepSettings; ValidationData = validationData; TaskType = taskType; } @@ -82,14 +75,8 @@ public string FeaturizationDatasetLanguage } } - /// Model/training parameters that will remain constant throughout training. - public NlpFixedParameters FixedParameters { get; set; } /// Execution constraints for AutoMLJob. public NlpVerticalLimitSettings LimitSettings { get; set; } - /// Search space for sampling different combinations of models and their hyperparameters. - public IList SearchSpace { get; set; } - /// Settings for model sweeping and hyperparameter tuning. - public NlpSweepSettings SweepSettings { get; set; } /// Validation data inputs. public MachineLearningTableJobInput ValidationData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.Serialization.cs index b829899c00fb1..8cf7134c1e389 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.Serialization.cs @@ -43,18 +43,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions o writer.WriteNull("featurizationSettings"); } } - if (Optional.IsDefined(FixedParameters)) - { - if (FixedParameters != null) - { - writer.WritePropertyName("fixedParameters"u8); - writer.WriteObjectValue(FixedParameters, options); - } - else - { - writer.WriteNull("fixedParameters"); - } - } if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -67,35 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions o writer.WriteNull("limitSettings"); } } - if (Optional.IsCollectionDefined(SearchSpace)) - { - if (SearchSpace != null) - { - writer.WritePropertyName("searchSpace"u8); - writer.WriteStartArray(); - foreach (var item in SearchSpace) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("searchSpace"); - } - } - if (Optional.IsDefined(SweepSettings)) - { - if (SweepSettings != null) - { - writer.WritePropertyName("sweepSettings"u8); - writer.WriteObjectValue(SweepSettings, options); - } - else - { - writer.WriteNull("sweepSettings"); - } - } if (Optional.IsDefined(ValidationData)) { if (ValidationData != null) @@ -169,10 +128,7 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite } ClassificationPrimaryMetric? primaryMetric = default; NlpVerticalFeaturizationSettings featurizationSettings = default; - NlpFixedParameters fixedParameters = default; NlpVerticalLimitSettings limitSettings = default; - IList searchSpace = default; - NlpSweepSettings sweepSettings = default; MachineLearningTableJobInput validationData = default; MachineLearningLogVerbosity? logVerbosity = default; string targetColumnName = default; @@ -201,16 +157,6 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value, options); continue; } - if (property.NameEquals("fixedParameters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fixedParameters = null; - continue; - } - fixedParameters = NlpFixedParameters.DeserializeNlpFixedParameters(property.Value, options); - continue; - } if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -221,31 +167,6 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite limitSettings = NlpVerticalLimitSettings.DeserializeNlpVerticalLimitSettings(property.Value, options); continue; } - if (property.NameEquals("searchSpace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchSpace = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NlpParameterSubspace.DeserializeNlpParameterSubspace(item, options)); - } - searchSpace = array; - continue; - } - if (property.NameEquals("sweepSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sweepSettings = null; - continue; - } - sweepSettings = NlpSweepSettings.DeserializeNlpSweepSettings(property.Value, options); - continue; - } if (property.NameEquals("validationData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -299,10 +220,7 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite serializedAdditionalRawData, primaryMetric, featurizationSettings, - fixedParameters, limitSettings, - searchSpace ?? new ChangeTrackingList(), - sweepSettings, validationData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.cs index 856be85a972da..0e7a659de83fc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.cs @@ -24,7 +24,6 @@ public TextNer(MachineLearningTableJobInput trainingData) : base(trainingData) { Argument.AssertNotNull(trainingData, nameof(trainingData)); - SearchSpace = new ChangeTrackingList(); TaskType = TaskType.TextNER; } @@ -42,19 +41,13 @@ public TextNer(MachineLearningTableJobInput trainingData) : base(trainingData) /// Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. /// /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Validation data inputs. - internal TextNer(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpFixedParameters fixedParameters, NlpVerticalLimitSettings limitSettings, IList searchSpace, NlpSweepSettings sweepSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + internal TextNer(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpVerticalLimitSettings limitSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) { PrimaryMetric = primaryMetric; FeaturizationSettings = featurizationSettings; - FixedParameters = fixedParameters; LimitSettings = limitSettings; - SearchSpace = searchSpace; - SweepSettings = sweepSettings; ValidationData = validationData; TaskType = taskType; } @@ -83,14 +76,8 @@ public string FeaturizationDatasetLanguage } } - /// Model/training parameters that will remain constant throughout training. - public NlpFixedParameters FixedParameters { get; set; } /// Execution constraints for AutoMLJob. public NlpVerticalLimitSettings LimitSettings { get; set; } - /// Search space for sampling different combinations of models and their hyperparameters. - public IList SearchSpace { get; set; } - /// Settings for model sweeping and hyperparameter tuning. - public NlpSweepSettings SweepSettings { get; set; } /// Validation data inputs. public MachineLearningTableJobInput ValidationData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrainingMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrainingMode.cs deleted file mode 100644 index 46f8ec943f312..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrainingMode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Training mode dictates whether to use distributed training or not. - public readonly partial struct TrainingMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public TrainingMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AutoValue = "Auto"; - private const string DistributedValue = "Distributed"; - private const string NonDistributedValue = "NonDistributed"; - - /// Auto mode. - public static TrainingMode Auto { get; } = new TrainingMode(AutoValue); - /// Distributed training mode. - public static TrainingMode Distributed { get; } = new TrainingMode(DistributedValue); - /// Non distributed training mode. - public static TrainingMode NonDistributed { get; } = new TrainingMode(NonDistributedValue); - /// Determines if two values are the same. - public static bool operator ==(TrainingMode left, TrainingMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(TrainingMode left, TrainingMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator TrainingMode(string value) => new TrainingMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is TrainingMode other && Equals(other); - /// - public bool Equals(TrainingMode 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TriggerType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TriggerType.cs new file mode 100644 index 0000000000000..be06dc86f6a3f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TriggerType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The TriggerType. + internal readonly partial struct TriggerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TriggerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RecurrenceValue = "Recurrence"; + private const string CronValue = "Cron"; + + /// Recurrence. + public static TriggerType Recurrence { get; } = new TriggerType(RecurrenceValue); + /// Cron. + public static TriggerType Cron { get; } = new TriggerType(CronValue); + /// Determines if two values are the same. + public static bool operator ==(TriggerType left, TriggerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TriggerType left, TriggerType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TriggerType(string value) => new TriggerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TriggerType other && Equals(other); + /// + public bool Equals(TriggerType 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/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.Serialization.cs deleted file mode 100644 index 118463272f30b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class TritonInferencingServer : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TritonInferencingServer)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(InferenceConfiguration)) - { - if (InferenceConfiguration != null) - { - writer.WritePropertyName("inferenceConfiguration"u8); - writer.WriteObjectValue(InferenceConfiguration, options); - } - else - { - writer.WriteNull("inferenceConfiguration"); - } - } - writer.WritePropertyName("serverType"u8); - writer.WriteStringValue(ServerType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - TritonInferencingServer 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(TritonInferencingServer)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTritonInferencingServer(document.RootElement, options); - } - - internal static TritonInferencingServer DeserializeTritonInferencingServer(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - OnlineInferenceConfiguration inferenceConfiguration = default; - InferencingServerType serverType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("inferenceConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - inferenceConfiguration = null; - continue; - } - inferenceConfiguration = OnlineInferenceConfiguration.DeserializeOnlineInferenceConfiguration(property.Value, options); - continue; - } - if (property.NameEquals("serverType"u8)) - { - serverType = new InferencingServerType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TritonInferencingServer(serverType, serializedAdditionalRawData, inferenceConfiguration); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TritonInferencingServer)} does not support writing '{options.Format}' format."); - } - } - - TritonInferencingServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTritonInferencingServer(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TritonInferencingServer)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.cs deleted file mode 100644 index d48141a65f9f6..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Triton inferencing server configurations. - public partial class TritonInferencingServer : InferencingServer - { - /// Initializes a new instance of . - public TritonInferencingServer() - { - ServerType = InferencingServerType.Triton; - } - - /// Initializes a new instance of . - /// [Required] Inferencing server type for various targets. - /// Keeps track of any properties unknown to the library. - /// Inference configuration for Triton. - internal TritonInferencingServer(InferencingServerType serverType, IDictionary serializedAdditionalRawData, OnlineInferenceConfiguration inferenceConfiguration) : base(serverType, serializedAdditionalRawData) - { - InferenceConfiguration = inferenceConfiguration; - ServerType = serverType; - } - - /// Inference configuration for Triton. - public OnlineInferenceConfiguration InferenceConfiguration { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.cs deleted file mode 100644 index 8fe73f4ccc656..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of BaseEnvironmentSource. - internal partial class UnknownBaseEnvironmentSource : BaseEnvironmentSource - { - /// Initializes a new instance of . - /// [Required] Base environment type. - /// Keeps track of any properties unknown to the library. - internal UnknownBaseEnvironmentSource(BaseEnvironmentSourceType baseEnvironmentSourceType, IDictionary serializedAdditionalRawData) : base(baseEnvironmentSourceType, serializedAdditionalRawData) - { - BaseEnvironmentSourceType = baseEnvironmentSourceType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownBaseEnvironmentSource() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.Serialization.cs deleted file mode 100644 index e7d4845c6272d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - internal partial class UnknownDataImportSource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataImportSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Connection)) - { - if (Connection != null) - { - writer.WritePropertyName("connection"u8); - writer.WriteStringValue(Connection); - } - else - { - writer.WriteNull("connection"); - } - } - writer.WritePropertyName("sourceType"u8); - writer.WriteStringValue(SourceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataImportSource 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(DataImportSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataImportSource(document.RootElement, options); - } - - internal static UnknownDataImportSource DeserializeUnknownDataImportSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string connection = default; - DataImportSourceType sourceType = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("connection"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - connection = null; - continue; - } - connection = property.Value.GetString(); - continue; - } - if (property.NameEquals("sourceType"u8)) - { - sourceType = new DataImportSourceType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownDataImportSource(connection, sourceType, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DataImportSource)} does not support writing '{options.Format}' format."); - } - } - - DataImportSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataImportSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataImportSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.cs deleted file mode 100644 index 1c2608977c6c2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of DataImportSource. - internal partial class UnknownDataImportSource : DataImportSource - { - /// Initializes a new instance of . - /// Workspace connection for data import source storage. - /// [Required] Specifies the type of data. - /// Keeps track of any properties unknown to the library. - internal UnknownDataImportSource(string connection, DataImportSourceType sourceType, IDictionary serializedAdditionalRawData) : base(connection, sourceType, serializedAdditionalRawData) - { - SourceType = sourceType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownDataImportSource() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobPatch.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.Serialization.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobPatch.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.Serialization.cs index 3be4b52069960..5605f3efb8353 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobPatch.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.Serialization.cs @@ -13,24 +13,21 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class MachineLearningJobPatch : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownDataReferenceCredential : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MachineLearningJobPatch)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -49,19 +46,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndObject(); } - MachineLearningJobPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DataReferenceCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MachineLearningJobPatch)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningJobPatch(document.RootElement, options); + return DeserializeDataReferenceCredential(document.RootElement, options); } - internal static MachineLearningJobPatch DeserializeMachineLearningJobPatch(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownDataReferenceCredential DeserializeUnknownDataReferenceCredential(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -69,18 +66,14 @@ internal static MachineLearningJobPatch DeserializeMachineLearningJobPatch(JsonE { return null; } - PartialJobBase properties = default; + DataReferenceCredentialType credentialType = "Unknown"; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (property.NameEquals("credentialType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = PartialJobBase.DeserializePartialJobBase(property.Value, options); + credentialType = new DataReferenceCredentialType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -89,38 +82,38 @@ internal static MachineLearningJobPatch DeserializeMachineLearningJobPatch(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningJobPatch(properties, serializedAdditionalRawData); + return new UnknownDataReferenceCredential(credentialType, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MachineLearningJobPatch)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support writing '{options.Format}' format."); } } - MachineLearningJobPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DataReferenceCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMachineLearningJobPatch(document.RootElement, options); + return DeserializeDataReferenceCredential(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MachineLearningJobPatch)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.cs new file mode 100644 index 0000000000000..807b4de99b805 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Unknown version of DataReferenceCredential. + internal partial class UnknownDataReferenceCredential : DataReferenceCredential + { + /// Initializes a new instance of . + /// [Required] Credential type used to authentication with storage. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReferenceCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData) : base(credentialType, serializedAdditionalRawData) + { + CredentialType = credentialType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReferenceCredential() + { + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.Serialization.cs index 8e2eb109f7998..cebe9f2ce6ae7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.Serialization.cs @@ -30,42 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -164,9 +128,6 @@ internal static UnknownDataVersionBase DeserializeUnknownDataVersionBase(JsonEle } MachineLearningDataType dataType = "Unknown"; Uri dataUri = default; - IntellectualProperty intellectualProperty = default; - string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -186,36 +147,6 @@ internal static UnknownDataVersionBase DeserializeUnknownDataVersionBase(JsonEle dataUri = new Uri(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } - if (property.NameEquals("stage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - stage = null; - continue; - } - stage = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -285,13 +216,10 @@ internal static UnknownDataVersionBase DeserializeUnknownDataVersionBase(JsonEle properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, dataType, - dataUri, - intellectualProperty, - stage); + dataUri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.cs index 0ab061b4dd34c..c11919d2d430b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.cs @@ -18,14 +18,11 @@ internal partial class UnknownDataVersionBase : MachineLearningDataVersionProper /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// Intellectual Property details. Used if data is an Intellectual Property. - /// Stage in the data lifecycle assigned to this data asset. - internal UnknownDataVersionBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IntellectualProperty intellectualProperty, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived, dataType, dataUri, intellectualProperty, stage) + internal UnknownDataVersionBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived, dataType, dataUri) { DataType = dataType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.Serialization.cs index 828c79014ddb1..ac882a7cc3643 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.Serialization.cs @@ -30,18 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -135,7 +123,6 @@ internal static UnknownDatastore DeserializeUnknownDatastore(JsonElement element } MachineLearningDatastoreCredentials credentials = default; DatastoreType datastoreType = "Unknown"; - IntellectualProperty intellectualProperty = default; bool? isDefault = default; string description = default; IDictionary properties = default; @@ -154,16 +141,6 @@ internal static UnknownDatastore DeserializeUnknownDatastore(JsonElement element datastoreType = new DatastoreType(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("isDefault"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -226,7 +203,6 @@ internal static UnknownDatastore DeserializeUnknownDatastore(JsonElement element serializedAdditionalRawData, credentials, datastoreType, - intellectualProperty, isDefault); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.cs index def0464645468..bf51703a36caf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.cs @@ -21,12 +21,11 @@ internal partial class UnknownDatastore : MachineLearningDatastoreProperties /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. - internal UnknownDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) + internal UnknownDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) { DatastoreType = datastoreType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..559203e2f1ed6 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class UnknownEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentResourceProperties 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(EndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static UnknownEndpointDeploymentResourceProperties DeserializeUnknownEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownEndpointDeploymentResourceProperties(failureReason, provisioningState, type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.cs new file mode 100644 index 0000000000000..24651ee23ad78 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Unknown version of EndpointDeploymentResourceProperties. + internal partial class UnknownEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + internal UnknownEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownEndpointDeploymentResourceProperties() + { + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..83517db80a0ad --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class UnknownEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointResourceProperties 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(EndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointResourceProperties(document.RootElement, options); + } + + internal static UnknownEndpointResourceProperties DeserializeUnknownEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = "Unknown"; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.cs new file mode 100644 index 0000000000000..834f1d27d801c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Unknown version of EndpointResourceProperties. + internal partial class UnknownEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal UnknownEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + EndpointType = endpointType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownEndpointResourceProperties() + { + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.Serialization.cs deleted file mode 100644 index 6af3fd747ceab..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.Serialization.cs +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - internal partial class UnknownExportSummary : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ExportSummary)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(EndOn)) - { - if (EndOn != null) - { - writer.WritePropertyName("endDateTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - else - { - writer.WriteNull("endDateTime"); - } - } - if (options.Format != "W" && Optional.IsDefined(ExportedRowCount)) - { - if (ExportedRowCount != null) - { - writer.WritePropertyName("exportedRowCount"u8); - writer.WriteNumberValue(ExportedRowCount.Value); - } - else - { - writer.WriteNull("exportedRowCount"); - } - } - writer.WritePropertyName("format"u8); - writer.WriteStringValue(Format.ToString()); - if (options.Format != "W" && Optional.IsDefined(LabelingJobId)) - { - if (LabelingJobId != null) - { - writer.WritePropertyName("labelingJobId"u8); - writer.WriteStringValue(LabelingJobId); - } - else - { - writer.WriteNull("labelingJobId"); - } - } - if (options.Format != "W" && Optional.IsDefined(StartOn)) - { - if (StartOn != null) - { - writer.WritePropertyName("startDateTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - else - { - writer.WriteNull("startDateTime"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ExportSummary 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(ExportSummary)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportSummary(document.RootElement, options); - } - - internal static UnknownExportSummary DeserializeUnknownExportSummary(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DateTimeOffset? endDateTime = default; - long? exportedRowCount = default; - ExportFormatType format = "Unknown"; - string labelingJobId = default; - DateTimeOffset? startDateTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("endDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - endDateTime = null; - continue; - } - endDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("exportedRowCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - exportedRowCount = null; - continue; - } - exportedRowCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("format"u8)) - { - format = new ExportFormatType(property.Value.GetString()); - continue; - } - if (property.NameEquals("labelingJobId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labelingJobId = null; - continue; - } - labelingJobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("startDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - startDateTime = null; - continue; - } - startDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownExportSummary( - endDateTime, - exportedRowCount, - format, - labelingJobId, - startDateTime, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ExportSummary)} does not support writing '{options.Format}' format."); - } - } - - ExportSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportSummary(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ExportSummary)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.cs deleted file mode 100644 index f7a61c5559955..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of ExportSummary. - internal partial class UnknownExportSummary : ExportSummary - { - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// [Required] The format of exported labels, also as the discriminator. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// Keeps track of any properties unknown to the library. - internal UnknownExportSummary(DateTimeOffset? endOn, long? exportedRowCount, ExportFormatType format, string labelingJobId, DateTimeOffset? startOn, IDictionary serializedAdditionalRawData) : base(endOn, exportedRowCount, format, labelingJobId, startOn, serializedAdditionalRawData) - { - Format = format; - } - - /// Initializes a new instance of for deserialization. - internal UnknownExportSummary() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.Serialization.cs new file mode 100644 index 0000000000000..ab85d7c1c6d86 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class UnknownFineTuningVertical : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelProvider"u8); + writer.WriteStringValue(ModelProvider.ToString()); + writer.WritePropertyName("taskType"u8); + writer.WriteStringValue(TaskType.ToString()); + writer.WritePropertyName("trainingData"u8); + writer.WriteObjectValue(TrainingData, options); + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FineTuningVertical 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(FineTuningVertical)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFineTuningVertical(document.RootElement, options); + } + + internal static UnknownFineTuningVertical DeserializeUnknownFineTuningVertical(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ModelProvider modelProvider = "Unknown"; + FineTuningTaskType taskType = default; + MachineLearningJobInput trainingData = default; + MachineLearningJobInput validationData = default; + MachineLearningFlowModelJobInput model = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelProvider"u8)) + { + modelProvider = new ModelProvider(property.Value.GetString()); + continue; + } + if (property.NameEquals("taskType"u8)) + { + taskType = new FineTuningTaskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingData"u8)) + { + trainingData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("validationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationData = null; + continue; + } + validationData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("model"u8)) + { + model = MachineLearningFlowModelJobInput.DeserializeMachineLearningFlowModelJobInput(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownFineTuningVertical( + modelProvider, + taskType, + trainingData, + validationData, + model, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support writing '{options.Format}' format."); + } + } + + FineTuningVertical IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFineTuningVertical(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.cs new file mode 100644 index 0000000000000..e33e8b3ad11a7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Unknown version of FineTuningVertical. + internal partial class UnknownFineTuningVertical : FineTuningVertical + { + /// Initializes a new instance of . + /// [Required] Enum to determine the type of fine tuning. + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// 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 . + /// + /// + /// Validation data for fine tuning. + /// 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 . + /// + /// [Required] Input model for fine tuning. + /// Keeps track of any properties unknown to the library. + internal UnknownFineTuningVertical(ModelProvider modelProvider, FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningJobInput validationData, MachineLearningFlowModelJobInput model, IDictionary serializedAdditionalRawData) : base(modelProvider, taskType, trainingData, validationData, model, serializedAdditionalRawData) + { + ModelProvider = modelProvider; + } + + /// Initializes a new instance of for deserialization. + internal UnknownFineTuningVertical() + { + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.cs deleted file mode 100644 index 2810ac9cc9638..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of InferencingServer. - internal partial class UnknownInferencingServer : InferencingServer - { - /// Initializes a new instance of . - /// [Required] Inferencing server type for various targets. - /// Keeps track of any properties unknown to the library. - internal UnknownInferencingServer(InferencingServerType serverType, IDictionary serializedAdditionalRawData) : base(serverType, serializedAdditionalRawData) - { - ServerType = serverType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownInferencingServer() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.Serialization.cs index d6970a4c5da0a..fc6f6c9433706 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.Serialization.cs @@ -98,24 +98,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -233,7 +215,6 @@ internal static UnknownJobBase DeserializeUnknownJobBase(JsonElement element, Mo bool? isArchived = default; JobType jobType = "Unknown"; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -312,21 +293,6 @@ internal static UnknownJobBase DeserializeUnknownJobBase(JsonElement element, Mo notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -410,7 +376,6 @@ internal static UnknownJobBase DeserializeUnknownJobBase(JsonElement element, Mo isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.cs index 15b377f5893a4..468a345f2b3d9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.cs @@ -32,13 +32,12 @@ internal partial class UnknownJobBase : MachineLearningJobProperties /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. /// /// Status of the job. - internal UnknownJobBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) + internal UnknownJobBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) { JobType = jobType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.cs deleted file mode 100644 index 324ecb95759c2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of LabelingJobMediaProperties. - internal partial class UnknownLabelingJobMediaProperties : LabelingJobMediaProperties - { - /// Initializes a new instance of . - /// [Required] Media type of the job. - /// Keeps track of any properties unknown to the library. - internal UnknownLabelingJobMediaProperties(MediaType mediaType, IDictionary serializedAdditionalRawData) : base(mediaType, serializedAdditionalRawData) - { - MediaType = mediaType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownLabelingJobMediaProperties() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.cs deleted file mode 100644 index 3d8f7b2682d5b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of MLAssistConfiguration. - internal partial class UnknownMLAssistConfiguration : MachineLearningAssistConfiguration - { - /// Initializes a new instance of . - /// [Required] Indicates whether MLAssist feature is enabled. - /// Keeps track of any properties unknown to the library. - internal UnknownMLAssistConfiguration(MLAssistConfigurationType mlAssist, IDictionary serializedAdditionalRawData) : base(mlAssist, serializedAdditionalRawData) - { - MlAssist = mlAssist; - } - - /// Initializes a new instance of for deserialization. - internal UnknownMLAssistConfiguration() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.cs deleted file mode 100644 index cb97de5bee8ac..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of ModelPerformanceMetricThresholdBase. - internal partial class UnknownModelPerformanceMetricThresholdBase : ModelPerformanceMetricThresholdBase - { - /// Initializes a new instance of . - /// [Required] Specifies the data type of the metric threshold. - /// The threshold value. If null, a default value will be set depending on the selected metric. - /// Keeps track of any properties unknown to the library. - internal UnknownModelPerformanceMetricThresholdBase(MonitoringModelType modelType, MonitoringThreshold threshold, IDictionary serializedAdditionalRawData) : base(modelType, threshold, serializedAdditionalRawData) - { - ModelType = modelType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownModelPerformanceMetricThresholdBase() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitorComputeIdentityBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitorComputeIdentityBase.cs index 7bcf8358ede32..172f8914db322 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitorComputeIdentityBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitorComputeIdentityBase.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.MachineLearning.Models internal partial class UnknownMonitorComputeIdentityBase : MonitorComputeIdentityBase { /// Initializes a new instance of . - /// [Required] Monitor compute identity type enum. + /// [Required] Specifies the type of identity to use within the monitoring jobs. /// Keeps track of any properties unknown to the library. internal UnknownMonitorComputeIdentityBase(MonitorComputeIdentityType computeIdentityType, IDictionary serializedAdditionalRawData) : base(computeIdentityType, serializedAdditionalRawData) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.Serialization.cs deleted file mode 100644 index 82c6676e3cb31..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.Serialization.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - internal partial class UnknownMonitoringAlertNotificationSettingsBase : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("alertNotificationType"u8); - writer.WriteStringValue(AlertNotificationType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MonitoringAlertNotificationSettingsBase 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(MonitoringAlertNotificationSettingsBase)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMonitoringAlertNotificationSettingsBase(document.RootElement, options); - } - - internal static UnknownMonitoringAlertNotificationSettingsBase DeserializeUnknownMonitoringAlertNotificationSettingsBase(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MonitoringAlertNotificationType alertNotificationType = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("alertNotificationType"u8)) - { - alertNotificationType = new MonitoringAlertNotificationType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownMonitoringAlertNotificationSettingsBase(alertNotificationType, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support writing '{options.Format}' format."); - } - } - - MonitoringAlertNotificationSettingsBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMonitoringAlertNotificationSettingsBase(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.cs deleted file mode 100644 index f8f7e9667ad62..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of MonitoringAlertNotificationSettingsBase. - internal partial class UnknownMonitoringAlertNotificationSettingsBase : MonitoringAlertNotificationSettingsBase - { - /// Initializes a new instance of . - /// [Required] Specifies the type of signal to monitor. - /// Keeps track of any properties unknown to the library. - internal UnknownMonitoringAlertNotificationSettingsBase(MonitoringAlertNotificationType alertNotificationType, IDictionary serializedAdditionalRawData) : base(alertNotificationType, serializedAdditionalRawData) - { - AlertNotificationType = alertNotificationType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownMonitoringAlertNotificationSettingsBase() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.Serialization.cs index 2417936222c03..7283f86884741 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.Serialization.cs @@ -26,10 +26,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteStartObject(); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -89,20 +101,26 @@ internal static UnknownMonitoringSignalBase DeserializeUnknownMonitoringSignalBa { return null; } - MonitoringNotificationMode? mode = default; + IList notificationTypes = default; IDictionary properties = default; MonitoringSignalType signalType = "Unknown"; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mode"u8)) + if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + notificationTypes = null; continue; } - mode = new MonitoringNotificationMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MonitoringNotificationType(item.GetString())); + } + notificationTypes = array; continue; } if (property.NameEquals("properties"u8)) @@ -131,7 +149,7 @@ internal static UnknownMonitoringSignalBase DeserializeUnknownMonitoringSignalBa } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownMonitoringSignalBase(mode, properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData); + return new UnknownMonitoringSignalBase(notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.cs index 43bdde03aed56..319fa731c4231 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.MachineLearning.Models internal partial class UnknownMonitoringSignalBase : MonitoringSignalBase { /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. - internal UnknownMonitoringSignalBase(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData) : base(mode, properties, signalType, serializedAdditionalRawData) + internal UnknownMonitoringSignalBase(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) { SignalType = signalType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOnlineDeployment.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOnlineDeployment.cs index 7c600117275c7..118f2aec2ec1a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOnlineDeployment.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOnlineDeployment.cs @@ -16,7 +16,7 @@ internal partial class UnknownOnlineDeployment : MachineLearningOnlineDeployment /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.Serialization.cs index 40ff3b3f96601..f37a5172caa1e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.Serialization.cs @@ -31,6 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -77,6 +87,7 @@ internal static UnknownOutboundRule DeserializeUnknownOutboundRule(JsonElement e return null; } OutboundRuleCategory? category = default; + IReadOnlyList parentRuleNames = default; OutboundRuleStatus? status = default; OutboundRuleType type = "Unknown"; IDictionary serializedAdditionalRawData = default; @@ -92,6 +103,20 @@ internal static UnknownOutboundRule DeserializeUnknownOutboundRule(JsonElement e category = new OutboundRuleCategory(property.Value.GetString()); continue; } + if (property.NameEquals("parentRuleNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parentRuleNames = array; + continue; + } if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -112,7 +137,7 @@ internal static UnknownOutboundRule DeserializeUnknownOutboundRule(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownOutboundRule(category, status, type, serializedAdditionalRawData); + return new UnknownOutboundRule(category, parentRuleNames ?? new ChangeTrackingList(), status, type, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.cs index 57fa4aa447f2a..0299ae72a728f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.cs @@ -15,10 +15,11 @@ internal partial class UnknownOutboundRule : MachineLearningOutboundRule { /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. - internal UnknownOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData) : base(category, status, outboundRuleType, serializedAdditionalRawData) + internal UnknownOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData) : base(category, parentRuleNames, status, outboundRuleType, serializedAdditionalRawData) { OutboundRuleType = outboundRuleType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.cs deleted file mode 100644 index 4ac3906647885..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of PackageInputPathBase. - internal partial class UnknownPackageInputPathBase : PackageInputPathBase - { - /// Initializes a new instance of . - /// [Required] Input path type for package inputs. - /// Keeps track of any properties unknown to the library. - internal UnknownPackageInputPathBase(InputPathType inputPathType, IDictionary serializedAdditionalRawData) : base(inputPathType, serializedAdditionalRawData) - { - InputPathType = inputPathType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownPackageInputPathBase() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.Serialization.cs index cfaacc62e68e9..8c2686f5181e7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.Serialization.cs @@ -98,7 +98,7 @@ internal static UnknownTriggerBase DeserializeUnknownTriggerBase(JsonElement ele string endTime = default; string startTime = default; string timeZone = default; - MachineLearningTriggerType triggerType = "Unknown"; + TriggerType triggerType = "Unknown"; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -130,7 +130,7 @@ internal static UnknownTriggerBase DeserializeUnknownTriggerBase(JsonElement ele } if (property.NameEquals("triggerType"u8)) { - triggerType = new MachineLearningTriggerType(property.Value.GetString()); + triggerType = new TriggerType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.cs index a4195c74534d5..68db0c2269c13 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.cs @@ -26,7 +26,7 @@ internal partial class UnknownTriggerBase : MachineLearningTriggerBase /// /// [Required]. /// Keeps track of any properties unknown to the library. - internal UnknownTriggerBase(string endTime, string startTime, string timeZone, MachineLearningTriggerType triggerType, IDictionary serializedAdditionalRawData) : base(endTime, startTime, timeZone, triggerType, serializedAdditionalRawData) + internal UnknownTriggerBase(string endTime, string startTime, string timeZone, TriggerType triggerType, IDictionary serializedAdditionalRawData) : base(endTime, startTime, timeZone, triggerType, serializedAdditionalRawData) { TriggerType = triggerType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.Serialization.cs index 359d565675e29..9f33a19c96dff 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.Serialization.cs @@ -33,28 +33,72 @@ void IJsonModel.Write(Utf8JsonWrit writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -95,9 +139,17 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa } MachineLearningConnectionAuthType authType = "Unknown"; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -116,6 +168,20 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -125,13 +191,68 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -139,6 +260,15 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -148,9 +278,17 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa return new UnknownWorkspaceConnectionPropertiesV2( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.cs index 7d76a432b512c..f7dd7a5f8e686 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -16,11 +17,19 @@ internal partial class UnknownWorkspaceConnectionPropertiesV2 : MachineLearningW /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. - internal UnknownWorkspaceConnectionPropertiesV2(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal UnknownWorkspaceConnectionPropertiesV2(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { AuthType = authType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.Serialization.cs similarity index 62% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.Serialization.cs index 302dfa8132415..a125b7e123eb4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class MLAssistConfigurationDisabled : IUtf8JsonSerializable, IJsonModel + internal partial class WorkspaceConnectionAccountKey : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MLAssistConfigurationDisabled)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(WorkspaceConnectionAccountKey)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("mlAssist"u8); - writer.WriteStringValue(MlAssist.ToString()); + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteEndObject(); } - MLAssistConfigurationDisabled IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + WorkspaceConnectionAccountKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MLAssistConfigurationDisabled)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(WorkspaceConnectionAccountKey)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMLAssistConfigurationDisabled(document.RootElement, options); + return DeserializeWorkspaceConnectionAccountKey(document.RootElement, options); } - internal static MLAssistConfigurationDisabled DeserializeMLAssistConfigurationDisabled(JsonElement element, ModelReaderWriterOptions options = null) + internal static WorkspaceConnectionAccountKey DeserializeWorkspaceConnectionAccountKey(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +69,14 @@ internal static MLAssistConfigurationDisabled DeserializeMLAssistConfigurationDi { return null; } - MLAssistConfigurationType mlAssist = default; + string key = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mlAssist"u8)) + if (property.NameEquals("key"u8)) { - mlAssist = new MLAssistConfigurationType(property.Value.GetString()); + key = property.Value.GetString(); continue; } if (options.Format != "W") @@ -82,38 +85,38 @@ internal static MLAssistConfigurationDisabled DeserializeMLAssistConfigurationDi } } serializedAdditionalRawData = rawDataDictionary; - return new MLAssistConfigurationDisabled(mlAssist, serializedAdditionalRawData); + return new WorkspaceConnectionAccountKey(key, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MLAssistConfigurationDisabled)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(WorkspaceConnectionAccountKey)} does not support writing '{options.Format}' format."); } } - MLAssistConfigurationDisabled IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + WorkspaceConnectionAccountKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMLAssistConfigurationDisabled(document.RootElement, options); + return DeserializeWorkspaceConnectionAccountKey(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MLAssistConfigurationDisabled)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(WorkspaceConnectionAccountKey)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.cs new file mode 100644 index 0000000000000..62cebdd9c425a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Account key object for workspace connection credential. + internal partial class WorkspaceConnectionAccountKey + { + /// + /// 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 . + public WorkspaceConnectionAccountKey() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal WorkspaceConnectionAccountKey(string key, IDictionary serializedAdditionalRawData) + { + Key = key; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the key. + public string Key { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.Serialization.cs new file mode 100644 index 0000000000000..fe73571e482ea --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.Serialization.cs @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class WorkspaceConnectionOAuth2 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WorkspaceConnectionOAuth2)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AuthUri)) + { + writer.WritePropertyName("authUrl"u8); + writer.WriteStringValue(AuthUri.AbsoluteUri); + } + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId.Value); + } + if (Optional.IsDefined(ClientSecret)) + { + writer.WritePropertyName("clientSecret"u8); + writer.WriteStringValue(ClientSecret); + } + if (Optional.IsDefined(DeveloperToken)) + { + writer.WritePropertyName("developerToken"u8); + writer.WriteStringValue(DeveloperToken); + } + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + if (Optional.IsDefined(RefreshToken)) + { + writer.WritePropertyName("refreshToken"u8); + writer.WriteStringValue(RefreshToken); + } + if (Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId.Value); + } + if (Optional.IsDefined(Username)) + { + writer.WritePropertyName("username"u8); + writer.WriteStringValue(Username); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + WorkspaceConnectionOAuth2 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(WorkspaceConnectionOAuth2)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWorkspaceConnectionOAuth2(document.RootElement, options); + } + + internal static WorkspaceConnectionOAuth2 DeserializeWorkspaceConnectionOAuth2(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri authUrl = default; + Guid? clientId = default; + string clientSecret = default; + string developerToken = default; + string password = default; + string refreshToken = default; + Guid? tenantId = default; + string username = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("clientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clientId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("clientSecret"u8)) + { + clientSecret = property.Value.GetString(); + continue; + } + if (property.NameEquals("developerToken"u8)) + { + developerToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("refreshToken"u8)) + { + refreshToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("username"u8)) + { + username = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WorkspaceConnectionOAuth2( + authUrl, + clientId, + clientSecret, + developerToken, + password, + refreshToken, + tenantId, + username, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WorkspaceConnectionOAuth2)} does not support writing '{options.Format}' format."); + } + } + + WorkspaceConnectionOAuth2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWorkspaceConnectionOAuth2(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WorkspaceConnectionOAuth2)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.cs new file mode 100644 index 0000000000000..a69d9bbafc33f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + public partial class WorkspaceConnectionOAuth2 + { + /// + /// 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 . + public WorkspaceConnectionOAuth2() + { + } + + /// Initializes a new instance of . + /// Required by Concur connection category. + /// Client id in the format of UUID. + /// + /// Required by GoogleAdWords connection category. + /// + /// + /// Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho + /// where user needs to get RefreshToken offline + /// + /// Required by QuickBooks and Xero connection categories. + /// + /// Concur, ServiceNow auth server AccessToken grant type is 'Password' + /// which requires UsernamePassword + /// + /// Keeps track of any properties unknown to the library. + internal WorkspaceConnectionOAuth2(Uri authUri, Guid? clientId, string clientSecret, string developerToken, string password, string refreshToken, Guid? tenantId, string username, IDictionary serializedAdditionalRawData) + { + AuthUri = authUri; + ClientId = clientId; + ClientSecret = clientSecret; + DeveloperToken = developerToken; + Password = password; + RefreshToken = refreshToken; + TenantId = tenantId; + Username = username; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Required by Concur connection category. + public Uri AuthUri { get; set; } + /// Client id in the format of UUID. + public Guid? ClientId { get; set; } + /// Gets or sets the client secret. + public string ClientSecret { get; set; } + /// Required by GoogleAdWords connection category. + public string DeveloperToken { get; set; } + /// Gets or sets the password. + public string Password { get; set; } + /// + /// Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho + /// where user needs to get RefreshToken offline + /// + public string RefreshToken { get; set; } + /// Required by QuickBooks and Xero connection categories. + public Guid? TenantId { get; set; } + /// + /// Concur, ServiceNow auth server AccessToken grant type is 'Password' + /// which requires UsernamePassword + /// + public string Username { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.Serialization.cs new file mode 100644 index 0000000000000..36027b868ed6f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiBlocklistItemPropertiesBasicResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RaiBlocklistItemPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RaiBlocklistItemPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.cs new file mode 100644 index 0000000000000..b1a592d930f99 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.cs @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a RaiBlocklistItemPropertiesBasicResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetRaiBlocklistItemPropertiesBasicResource method. + /// Otherwise you can get one from its parent resource using the GetRaiBlocklistItemPropertiesBasicResource method. + /// + public partial class RaiBlocklistItemPropertiesBasicResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The connectionName. + /// The raiBlocklistName. + /// The raiBlocklistItemName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics; + private readonly ConnectionRaiBlocklistItemRestOperations _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient; + private readonly RaiBlocklistItemPropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/connections/raiBlocklists/raiBlocklistItems"; + + /// Initializes a new instance of the class for mocking. + protected RaiBlocklistItemPropertiesBasicResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal RaiBlocklistItemPropertiesBasicResource(ArmClient client, RaiBlocklistItemPropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal RaiBlocklistItemPropertiesBasicResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient = new ConnectionRaiBlocklistItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RaiBlocklistItemPropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Delete"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Delete"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new RaiBlocklistItemPropertiesBasicResourceOperationSource(Client), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new RaiBlocklistItemPropertiesBasicResourceOperationSource(Client), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceCollection.cs new file mode 100644 index 0000000000000..1d8680cc1a58e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceCollection.cs @@ -0,0 +1,498 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetRaiBlocklistItemPropertiesBasicResources method from an instance of . + /// + public partial class RaiBlocklistItemPropertiesBasicResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics; + private readonly ConnectionRaiBlocklistItemRestOperations _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient; + private readonly ClientDiagnostics _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsClientDiagnostics; + private readonly ConnectionRaiBlocklistItemsRestOperations _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient; + + /// Initializes a new instance of the class for mocking. + protected RaiBlocklistItemPropertiesBasicResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal RaiBlocklistItemPropertiesBasicResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistItemPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistItemPropertiesBasicResource.ResourceType, out string raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient = new ConnectionRaiBlocklistItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistItemPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistItemPropertiesBasicResource.ResourceType, out string raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient = new ConnectionRaiBlocklistItemsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != RaiBlocklistPropertiesBasicResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, RaiBlocklistPropertiesBasicResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the RaiBlocklist Item. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new RaiBlocklistItemPropertiesBasicResourceOperationSource(Client), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the RaiBlocklist Item. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new RaiBlocklistItemPropertiesBasicResourceOperationSource(Client), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItems_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RaiBlocklistItemPropertiesBasicResource(Client, RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(e)), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsClientDiagnostics, Pipeline, "RaiBlocklistItemPropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItems_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RaiBlocklistItemPropertiesBasicResource(Client, RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(e)), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsClientDiagnostics, Pipeline, "RaiBlocklistItemPropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.Serialization.cs new file mode 100644 index 0000000000000..27ad8f63407d1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.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.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiBlocklistItemPropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistItemPropertiesBasicResourceData 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(RaiBlocklistItemPropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement, options); + } + + internal static RaiBlocklistItemPropertiesBasicResourceData DeserializeRaiBlocklistItemPropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RaiBlocklistItemProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = RaiBlocklistItemProperties.DeserializeRaiBlocklistItemProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistItemPropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistItemPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.cs new file mode 100644 index 0000000000000..00a0b7a6f4a45 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.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; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the RaiBlocklistItemPropertiesBasicResource data model. + public partial class RaiBlocklistItemPropertiesBasicResourceData : ResourceData + { + /// + /// 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 . + /// RAI Custom Blocklist Item properties. + /// is null. + public RaiBlocklistItemPropertiesBasicResourceData(RaiBlocklistItemProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// RAI Custom Blocklist Item properties. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistItemPropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RaiBlocklistItemProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RaiBlocklistItemPropertiesBasicResourceData() + { + } + + /// RAI Custom Blocklist Item properties. + public RaiBlocklistItemProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.Serialization.cs new file mode 100644 index 0000000000000..c51c34454ba5a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiBlocklistPropertiesBasicResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RaiBlocklistPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RaiBlocklistPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.cs new file mode 100644 index 0000000000000..4d08a466b7332 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.cs @@ -0,0 +1,608 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a RaiBlocklistPropertiesBasicResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetRaiBlocklistPropertiesBasicResource method. + /// Otherwise you can get one from its parent resource using the GetRaiBlocklistPropertiesBasicResource method. + /// + public partial class RaiBlocklistPropertiesBasicResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The connectionName. + /// The raiBlocklistName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics; + private readonly ConnectionRaiBlocklistRestOperations _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient; + private readonly ClientDiagnostics _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics; + private readonly ConnectionRaiBlocklistItemRestOperations _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient; + private readonly RaiBlocklistPropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/connections/raiBlocklists"; + + /// Initializes a new instance of the class for mocking. + protected RaiBlocklistPropertiesBasicResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal RaiBlocklistPropertiesBasicResource(ArmClient client, RaiBlocklistPropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal RaiBlocklistPropertiesBasicResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistApiVersion); + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient = new ConnectionRaiBlocklistRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistItemPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistItemPropertiesBasicResource.ResourceType, out string raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient = new ConnectionRaiBlocklistItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RaiBlocklistPropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of RaiBlocklistItemPropertiesBasicResources in the RaiBlocklistPropertiesBasicResource. + /// An object representing collection of RaiBlocklistItemPropertiesBasicResources and their operations over a RaiBlocklistItemPropertiesBasicResource. + public virtual RaiBlocklistItemPropertiesBasicResourceCollection GetRaiBlocklistItemPropertiesBasicResources() + { + return GetCachedClient(client => new RaiBlocklistItemPropertiesBasicResourceCollection(client, Id)); + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRaiBlocklistItemPropertiesBasicResourceAsync(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + return await GetRaiBlocklistItemPropertiesBasicResources().GetAsync(raiBlocklistItemName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRaiBlocklistItemPropertiesBasicResource(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + return GetRaiBlocklistItemPropertiesBasicResources().Get(raiBlocklistItemName, cancellationToken); + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Delete"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Delete"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new RaiBlocklistPropertiesBasicResourceOperationSource(Client), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new RaiBlocklistPropertiesBasicResourceOperationSource(Client), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_AddBulk + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Properties describing the custom blocklist items. + /// The cancellation token to use. + /// is null. + public virtual async Task>> AddBulkConnectionRaiBlocklistItemAsync(WaitUntil waitUntil, IEnumerable content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.AddBulkConnectionRaiBlocklistItem"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.AddBulkAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation>(new IListOperationSource(), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateAddBulkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_AddBulk + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Properties describing the custom blocklist items. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation> AddBulkConnectionRaiBlocklistItem(WaitUntil waitUntil, IEnumerable content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.AddBulkConnectionRaiBlocklistItem"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.AddBulk(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new MachineLearningArmOperation>(new IListOperationSource(), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateAddBulkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_DeleteBulk + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// List of RAI Blocklist Items Names. + /// The cancellation token to use. + /// is null. + public virtual async Task DeleteBulkConnectionRaiBlocklistItemAsync(WaitUntil waitUntil, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.DeleteBulkConnectionRaiBlocklistItem"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.DeleteBulkAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateDeleteBulkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_DeleteBulk + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// List of RAI Blocklist Items Names. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation DeleteBulkConnectionRaiBlocklistItem(WaitUntil waitUntil, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.DeleteBulkConnectionRaiBlocklistItem"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.DeleteBulk(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateDeleteBulkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceCollection.cs new file mode 100644 index 0000000000000..48406f8e6acb2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceCollection.cs @@ -0,0 +1,498 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetRaiBlocklistPropertiesBasicResources method from an instance of . + /// + public partial class RaiBlocklistPropertiesBasicResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics; + private readonly ConnectionRaiBlocklistRestOperations _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient; + private readonly ClientDiagnostics _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsClientDiagnostics; + private readonly ConnectionRaiBlocklistsRestOperations _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient; + + /// Initializes a new instance of the class for mocking. + protected RaiBlocklistPropertiesBasicResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal RaiBlocklistPropertiesBasicResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistPropertiesBasicResource.ResourceType, out string raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistApiVersion); + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient = new ConnectionRaiBlocklistRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistApiVersion); + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistPropertiesBasicResource.ResourceType, out string raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsApiVersion); + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient = new ConnectionRaiBlocklistsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceConnectionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceConnectionResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of the RaiBlocklist. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new RaiBlocklistPropertiesBasicResourceOperationSource(Client), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of the RaiBlocklist. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new RaiBlocklistPropertiesBasicResourceOperationSource(Client), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists + /// + /// + /// Operation Id + /// ConnectionRaiBlocklists_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RaiBlocklistPropertiesBasicResource(Client, RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(e)), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsClientDiagnostics, Pipeline, "RaiBlocklistPropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists + /// + /// + /// Operation Id + /// ConnectionRaiBlocklists_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RaiBlocklistPropertiesBasicResource(Client, RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(e)), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsClientDiagnostics, Pipeline, "RaiBlocklistPropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.Serialization.cs new file mode 100644 index 0000000000000..f8ec2150e080d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.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.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiBlocklistPropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistPropertiesBasicResourceData 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(RaiBlocklistPropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement, options); + } + + internal static RaiBlocklistPropertiesBasicResourceData DeserializeRaiBlocklistPropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RaiBlocklistProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = RaiBlocklistProperties.DeserializeRaiBlocklistProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistPropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.cs new file mode 100644 index 0000000000000..02321fa00384d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.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; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the RaiBlocklistPropertiesBasicResource data model. + public partial class RaiBlocklistPropertiesBasicResourceData : ResourceData + { + /// + /// 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 . + /// RAI Custom Blocklist properties. + /// is null. + public RaiBlocklistPropertiesBasicResourceData(RaiBlocklistProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// RAI Custom Blocklist properties. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistPropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RaiBlocklistProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RaiBlocklistPropertiesBasicResourceData() + { + } + + /// RAI Custom Blocklist properties. + internal RaiBlocklistProperties Properties { get; set; } + /// Description of the block list. + public string RaiBlocklistDescription + { + get => Properties is null ? default : Properties.Description; + set + { + if (Properties is null) + Properties = new RaiBlocklistProperties(); + Properties.Description = value; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.Serialization.cs new file mode 100644 index 0000000000000..575935991f15d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.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.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiPolicyPropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiPolicyPropertiesBasicResourceData 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(RaiPolicyPropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement, options); + } + + internal static RaiPolicyPropertiesBasicResourceData DeserializeRaiPolicyPropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RaiPolicyProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = RaiPolicyProperties.DeserializeRaiPolicyProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiPolicyPropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + RaiPolicyPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.cs new file mode 100644 index 0000000000000..e54e633289d48 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing the RaiPolicyPropertiesBasicResource data model. + /// Azure OpenAI Content Filters resource. + /// + public partial class RaiPolicyPropertiesBasicResourceData : ResourceData + { + /// + /// 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 . + /// Azure OpenAI Content Filters properties. + /// is null. + public RaiPolicyPropertiesBasicResourceData(RaiPolicyProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Azure OpenAI Content Filters properties. + /// Keeps track of any properties unknown to the library. + internal RaiPolicyPropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RaiPolicyProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RaiPolicyPropertiesBasicResourceData() + { + } + + /// Azure OpenAI Content Filters properties. + public RaiPolicyProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchDeploymentsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchDeploymentsRestOperations.cs index e1c2a6f919543..2d37db873e5aa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchDeploymentsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchDeploymentsRestOperations.cs @@ -32,7 +32,7 @@ public BatchDeploymentsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchEndpointsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchEndpointsRestOperations.cs index 745facb4b1d89..6973a0ed69716 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchEndpointsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchEndpointsRestOperations.cs @@ -32,7 +32,7 @@ public BatchEndpointsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeContainersRestOperations.cs index 468da629dd924..cf88c9fb923cd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeContainersRestOperations.cs @@ -32,7 +32,7 @@ public CodeContainersRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeVersionsRestOperations.cs index d10ca4cf3d83c..cbdf1b1fbdbca 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeVersionsRestOperations.cs @@ -32,7 +32,7 @@ public CodeVersionsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -518,6 +518,116 @@ public Response CreateOrUpdate(string subscripti } } + internal RequestUriBuilder CreatePublishRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/codes/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePublishRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/codes/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task PublishAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Publish(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateCreateOrGetStartPendingUploadRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, PendingUploadRequestDto body) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentContainersRestOperations.cs index 473d3b8fac54e..b29ddc95a602e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentContainersRestOperations.cs @@ -32,7 +32,7 @@ public ComponentContainersRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentVersionsRestOperations.cs index b233e5457bc10..f29c4bf365399 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentVersionsRestOperations.cs @@ -32,11 +32,11 @@ public ComponentVersionsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -66,14 +66,10 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -106,10 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -125,18 +117,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Component stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -161,18 +152,17 @@ public async Task> ListAsyn /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Component stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -518,7 +508,117 @@ public Response CreateOrUpdate(string subsc } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreatePublishRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/components/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePublishRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/components/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task PublishAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Publish(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -526,7 +626,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -550,11 +650,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Component stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -562,7 +661,7 @@ public async Task> ListNext Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -588,11 +687,10 @@ public async Task> ListNext /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Component stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -600,7 +698,7 @@ public Response ListNextPage(string Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComputeRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComputeRestOperations.cs index d780a7d792b4a..6be3cfe65d703 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComputeRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComputeRestOperations.cs @@ -33,7 +33,7 @@ public ComputeRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -850,6 +850,111 @@ public Response ListKeys(string subscriptionId, s } } + internal RequestUriBuilder CreateUpdateDataMountsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IEnumerable dataMounts) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/updateDataMounts", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateDataMountsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IEnumerable dataMounts) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/updateDataMounts", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in dataMounts) + { + content.JsonWriter.WriteObjectValue(item, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update Data Mounts of a Machine Learning compute. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The parameters for creating or updating a machine learning workspace. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateDataMountsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IEnumerable dataMounts, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(dataMounts, nameof(dataMounts)); + + using var message = CreateUpdateDataMountsRequest(subscriptionId, resourceGroupName, workspaceName, computeName, dataMounts); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update Data Mounts of a Machine Learning compute. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The parameters for creating or updating a machine learning workspace. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response UpdateDataMounts(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IEnumerable dataMounts, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(dataMounts, nameof(dataMounts)); + + using var message = CreateUpdateDataMountsRequest(subscriptionId, resourceGroupName, workspaceName, computeName, dataMounts); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName) { var uri = new RawRequestUriBuilder(); @@ -1226,6 +1331,208 @@ public Response UpdateIdleShutdownSetting(string subscriptionId, string resource } } + internal RequestUriBuilder CreateGetAllowedResizeSizesRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/getAllowedVmSizesForResize", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetAllowedResizeSizesRequest(string subscriptionId, string resourceGroupName, string workspaceName, string computeName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/getAllowedVmSizesForResize", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns supported virtual machine sizes for resize. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAllowedResizeSizesAsync(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var message = CreateGetAllowedResizeSizesRequest(subscriptionId, resourceGroupName, workspaceName, computeName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineSizeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VirtualMachineSizeListResult.DeserializeVirtualMachineSizeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns supported virtual machine sizes for resize. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetAllowedResizeSizes(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var message = CreateGetAllowedResizeSizesRequest(subscriptionId, resourceGroupName, workspaceName, computeName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineSizeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VirtualMachineSizeListResult.DeserializeVirtualMachineSizeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateResizeRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, ResizeSchema resizeSchema) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/resize", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateResizeRequest(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, ResizeSchema resizeSchema) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/resize", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(resizeSchema, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates the size of a Compute Instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The object for updating VM size setting of specified Compute Instance. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task ResizeAsync(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, ResizeSchema resizeSchema, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(resizeSchema, nameof(resizeSchema)); + + using var message = CreateResizeRequest(subscriptionId, resourceGroupName, workspaceName, computeName, resizeSchema); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the size of a Compute Instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The object for updating VM size setting of specified Compute Instance. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Resize(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, ResizeSchema resizeSchema, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(resizeSchema, nameof(resizeSchema)); + + using var message = CreateResizeRequest(subscriptionId, resourceGroupName, workspaceName, computeName, resizeSchema); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemRestOperations.cs new file mode 100644 index 0000000000000..3c147dc255bd9 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemRestOperations.cs @@ -0,0 +1,614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiBlocklistItemRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiBlocklistItemRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiBlocklistItemRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateAddBulkRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, IEnumerable content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/addRaiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateAddBulkRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, IEnumerable content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/addRaiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteStartArray(); + foreach (var item in content) + { + content0.JsonWriter.WriteObjectValue(item, ModelSerializationExtensions.WireOptions); + } + content0.JsonWriter.WriteEndArray(); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Properties describing the custom blocklist items. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task AddBulkAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, IEnumerable content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateAddBulkRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Properties describing the custom blocklist items. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response AddBulk(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, IEnumerable content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateAddBulkRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteBulkRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, BinaryData body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/deleteRaiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteBulkRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, BinaryData body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/deleteRaiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(body); +#else + using (JsonDocument document = JsonDocument.Parse(body)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// List of RAI Blocklist Items Names. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteBulkAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateDeleteBulkRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// List of RAI Blocklist Items Names. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response DeleteBulk(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateDeleteBulkRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified custom blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified custom blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiBlocklistItemPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiBlocklistItemPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The to use. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The to use. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemsRestOperations.cs new file mode 100644 index 0000000000000..adfea5970ca98 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemsRestOperations.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiBlocklistItemsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiBlocklistItemsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiBlocklistItemsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistRestOperations.cs new file mode 100644 index 0000000000000..e864bf0736a3c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistRestOperations.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiBlocklistRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiBlocklistRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiBlocklistRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified custom blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified custom blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiBlocklistPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiBlocklistPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistsRestOperations.cs new file mode 100644 index 0000000000000..f095c94a47739 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistsRestOperations.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiBlocklistsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiBlocklistsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiBlocklistsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPoliciesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPoliciesRestOperations.cs new file mode 100644 index 0000000000000..d5e783d43501f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPoliciesRestOperations.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiPoliciesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiPoliciesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiPoliciesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPolicyRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPolicyRestOperations.cs new file mode 100644 index 0000000000000..d885c9356a506 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPolicyRestOperations.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiPolicyRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiPolicyRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiPolicyRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiPolicyPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiPolicyPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRestOperations.cs new file mode 100644 index 0000000000000..31f2b45cf56ee --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRestOperations.cs @@ -0,0 +1,833 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListDeploymentsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListDeploymentsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListDeploymentsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListDeploymentsRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListDeployments(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListDeploymentsRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteDeploymentRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteDeploymentRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete Azure OpenAI connection deployment resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteDeploymentAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateDeleteDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete Azure OpenAI connection deployment resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response DeleteDeployment(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateDeleteDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetDeploymentRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetDeploymentRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get deployments under the Azure OpenAI connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetDeploymentAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateGetDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointDeploymentResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get deployments under the Azure OpenAI connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response GetDeployment(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateGetDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointDeploymentResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateDeploymentRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateDeploymentRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update Azure OpenAI connection deployment resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateDeploymentAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update Azure OpenAI connection deployment resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdateDeployment(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetModelsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetModelsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get available models under the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetModelsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetModelsRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get available models under the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetModels(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetModelsRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListModelsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/listConnectionModels", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListModelsRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/listConnectionModels", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListModelsAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListModelsRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListModels(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListModelsRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListDeploymentsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListDeploymentsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListDeploymentsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListDeploymentsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListDeploymentsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListDeploymentsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetModelsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateGetModelsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get available models under the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetModelsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetModelsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get available models under the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetModelsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetModelsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataContainersRestOperations.cs index 413c6a35027c6..0ea15c14eac33 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataContainersRestOperations.cs @@ -32,7 +32,7 @@ public DataContainersRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataVersionsRestOperations.cs index 5b8197f7be9be..6c47b332208e8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataVersionsRestOperations.cs @@ -32,11 +32,11 @@ public DataVersionsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -70,14 +70,10 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -114,10 +110,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -137,18 +129,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Continuation token for pagination. /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. - /// data stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -177,18 +168,17 @@ public async Task> ListAsync /// Continuation token for pagination. /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. - /// data stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -534,7 +524,117 @@ public Response CreateOrUpdate(string subscripti } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreatePublishRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/data/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePublishRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/data/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task PublishAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Publish(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -542,7 +642,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -570,11 +670,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Continuation token for pagination. /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. - /// data stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -582,7 +681,7 @@ public async Task> ListNextP Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -612,11 +711,10 @@ public async Task> ListNextP /// Continuation token for pagination. /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. - /// data stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -624,7 +722,7 @@ public Response ListNextPage(string n Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DatastoresRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DatastoresRestOperations.cs index 210db8abd9ca6..e4ba7194d7c36 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DatastoresRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DatastoresRestOperations.cs @@ -33,7 +33,7 @@ public DatastoresRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -517,7 +517,7 @@ public Response CreateOrUpdate(string subscription } } - internal RequestUriBuilder CreateListSecretsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) + internal RequestUriBuilder CreateListSecretsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, SecretExpiry body) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -534,7 +534,7 @@ internal RequestUriBuilder CreateListSecretsRequestUri(string subscriptionId, st return uri; } - internal HttpMessage CreateListSecretsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) + internal HttpMessage CreateListSecretsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, SecretExpiry body) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -553,6 +553,13 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + if (body != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + } _userAgent.Apply(message); return message; } @@ -562,17 +569,18 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Datastore name. + /// Secret expiry information. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListSecretsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + public async Task> ListSecretsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, SecretExpiry body = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, workspaceName, name); + using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, workspaceName, name, body); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -593,17 +601,18 @@ public async Task> ListSecretsAsync(st /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Datastore name. + /// Secret expiry information. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListSecrets(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + public Response ListSecrets(string subscriptionId, string resourceGroupName, string workspaceName, string name, SecretExpiry body = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, workspaceName, name); + using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, workspaceName, name, body); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointDeploymentRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointDeploymentRestOperations.cs new file mode 100644 index 0000000000000..ee46457e483b3 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointDeploymentRestOperations.cs @@ -0,0 +1,751 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class EndpointDeploymentRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EndpointDeploymentRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public EndpointDeploymentRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetInWorkspaceRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, string skip) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (endpointType != null) + { + uri.AppendQuery("endpointType", endpointType.Value.ToString(), true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + return uri; + } + + internal HttpMessage CreateGetInWorkspaceRequest(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, string skip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (endpointType != null) + { + uri.AppendQuery("endpointType", endpointType.Value.ToString(), true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the workspace scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetInWorkspaceAsync(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetInWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, endpointType, skip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the workspace scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetInWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetInWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, endpointType, skip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the endpoint resource scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the endpoint resource scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete endpoint deployment resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete endpoint deployment resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get deployments under endpoint resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointDeploymentResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get deployments under endpoint resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointDeploymentResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update endpoint deployment resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update endpoint deployment resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetInWorkspaceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, string skip) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateGetInWorkspaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, string skip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the workspace scope. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetInWorkspaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetInWorkspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointType, skip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the workspace scope. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetInWorkspaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetInWorkspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointType, skip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the endpoint resource scope. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the endpoint resource scope. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointRestOperations.cs new file mode 100644 index 0000000000000..2d7a12da48292 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointRestOperations.cs @@ -0,0 +1,871 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class EndpointRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EndpointRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public EndpointRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, bool? includeInferenceEndpoints, string skip, string expand) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (endpointType != null) + { + uri.AppendQuery("endpointType", endpointType.Value.ToString(), true); + } + if (includeInferenceEndpoints != null) + { + uri.AppendQuery("includeInferenceEndpoints", includeInferenceEndpoints.Value, true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, bool? includeInferenceEndpoints, string skip, string expand) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (endpointType != null) + { + uri.AppendQuery("endpointType", endpointType.Value.ToString(), true); + } + if (includeInferenceEndpoints != null) + { + uri.AppendQuery("includeInferenceEndpoints", includeInferenceEndpoints.Value, true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List All the endpoints under this workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointType, includeInferenceEndpoints, skip, expand); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List All the endpoints under this workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointType, includeInferenceEndpoints, skip, expand); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, EndpointResourcePropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, EndpointResourcePropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update endpoint resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Endpoint resource object. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update endpoint resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Endpoint resource object. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/listKeys", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/listKeys", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List keys for the endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointKeys value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointKeys.DeserializeEndpointKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List keys for the endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListKeys(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointKeys value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointKeys.DeserializeEndpointKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetModelsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetModelsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get available models under the endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetModelsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetModelsRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get available models under the endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetModels(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetModelsRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRegenerateKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, RegenerateServiceAccountKeyContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/regenerateKey", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRegenerateKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, RegenerateServiceAccountKeyContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/regenerateKey", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Regenerate account keys. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The to use. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> RegenerateKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, RegenerateServiceAccountKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AccountApiKeys value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AccountApiKeys.DeserializeAccountApiKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Regenerate account keys. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The to use. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response RegenerateKeys(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, RegenerateServiceAccountKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AccountApiKeys value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AccountApiKeys.DeserializeAccountApiKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, bool? includeInferenceEndpoints, string skip, string expand) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, bool? includeInferenceEndpoints, string skip, string expand) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List All the endpoints under this workspace. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointType, includeInferenceEndpoints, skip, expand); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List All the endpoints under this workspace. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointType, includeInferenceEndpoints, skip, expand); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetModelsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateGetModelsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get available models under the endpoint resource. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetModelsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetModelsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get available models under the endpoint resource. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetModelsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetModelsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentContainersRestOperations.cs index 6a168be1d7c00..0509cbc13d5ea 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentContainersRestOperations.cs @@ -32,7 +32,7 @@ public EnvironmentContainersRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentVersionsRestOperations.cs index de4007a7477b4..4a5b721fe16cb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentVersionsRestOperations.cs @@ -32,11 +32,11 @@ public EnvironmentVersionsRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -66,14 +66,10 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -106,10 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -125,18 +117,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -161,18 +152,17 @@ public async Task> ListAs /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -518,7 +508,117 @@ public Response CreateOrUpdate(string sub } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreatePublishRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/environments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePublishRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/environments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task PublishAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Publish(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -526,7 +626,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -550,11 +650,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -562,7 +661,7 @@ public async Task> ListNe Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -588,11 +687,10 @@ public async Task> ListNe /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -600,7 +698,7 @@ public Response ListNextPage(strin Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesRestOperations.cs index 3bb7e70e14144..cf7a5baef317d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesRestOperations.cs @@ -32,11 +32,11 @@ public FeaturesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description, MachineLearningListViewType? listViewType, int? pageSize) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -68,10 +68,18 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("description", description, true); } + if (listViewType != null) + { + uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description, MachineLearningListViewType? listViewType, int? pageSize) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -106,6 +114,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("description", description, true); } + if (listViewType != null) + { + uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -122,10 +138,12 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// feature name. /// Description of the featureset. + /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. + /// Page size. /// The cancellation token to use. /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, MachineLearningListViewType? listViewType = null, int? pageSize = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -133,7 +151,7 @@ public async Task> ListAsync(string Argument.AssertNotNullOrEmpty(featuresetName, nameof(featuresetName)); Argument.AssertNotNullOrEmpty(featuresetVersion, nameof(featuresetVersion)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description, listViewType, pageSize); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -159,10 +177,12 @@ public async Task> ListAsync(string /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// feature name. /// Description of the featureset. + /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. + /// Page size. /// The cancellation token to use. /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, MachineLearningListViewType? listViewType = null, int? pageSize = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -170,7 +190,7 @@ public Response List(string subscriptionId, s Argument.AssertNotNullOrEmpty(featuresetName, nameof(featuresetName)); Argument.AssertNotNullOrEmpty(featuresetVersion, nameof(featuresetVersion)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description, listViewType, pageSize); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -306,7 +326,7 @@ public Response Get(string subscriptionId, string re } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description, MachineLearningListViewType? listViewType, int? pageSize) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -314,7 +334,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description, MachineLearningListViewType? listViewType, int? pageSize) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -339,10 +359,12 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// feature name. /// Description of the featureset. + /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. + /// Page size. /// The cancellation token to use. /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, MachineLearningListViewType? listViewType = null, int? pageSize = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -351,7 +373,7 @@ public async Task> ListNextPageAsync Argument.AssertNotNullOrEmpty(featuresetName, nameof(featuresetName)); Argument.AssertNotNullOrEmpty(featuresetVersion, nameof(featuresetVersion)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description, listViewType, pageSize); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -378,10 +400,12 @@ public async Task> ListNextPageAsync /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// feature name. /// Description of the featureset. + /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. + /// Page size. /// The cancellation token to use. /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, MachineLearningListViewType? listViewType = null, int? pageSize = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -390,7 +414,7 @@ public Response ListNextPage(string nextLink, Argument.AssertNotNullOrEmpty(featuresetName, nameof(featuresetName)); Argument.AssertNotNullOrEmpty(featuresetVersion, nameof(featuresetVersion)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description, listViewType, pageSize); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetContainersRestOperations.cs index 8ade59154d27d..a3934ce5090a5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetContainersRestOperations.cs @@ -32,7 +32,7 @@ public FeaturesetContainersRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetVersionsRestOperations.cs index 694403afea8a8..8b592ad345354 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetVersionsRestOperations.cs @@ -32,7 +32,7 @@ public FeaturesetVersionsRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -660,156 +660,6 @@ public Response Backfill(string subscriptionId, string resourceGroupName, string } } - internal RequestUriBuilder CreateListMaterializationJobsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip, string filters, string featureWindowStart, string featureWindowEnd) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); - uri.AppendPath(workspaceName, true); - uri.AppendPath("/featuresets/", false); - uri.AppendPath(name, true); - uri.AppendPath("/versions/", false); - uri.AppendPath(version, true); - uri.AppendPath("/listMaterializationJobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (skip != null) - { - uri.AppendQuery("$skip", skip, true); - } - if (filters != null) - { - uri.AppendQuery("filters", filters, true); - } - if (featureWindowStart != null) - { - uri.AppendQuery("featureWindowStart", featureWindowStart, true); - } - if (featureWindowEnd != null) - { - uri.AppendQuery("featureWindowEnd", featureWindowEnd, true); - } - return uri; - } - - internal HttpMessage CreateListMaterializationJobsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip, string filters, string featureWindowStart, string featureWindowEnd) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); - uri.AppendPath(workspaceName, true); - uri.AppendPath("/featuresets/", false); - uri.AppendPath(name, true); - uri.AppendPath("/versions/", false); - uri.AppendPath(version, true); - uri.AppendPath("/listMaterializationJobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (skip != null) - { - uri.AppendQuery("$skip", skip, true); - } - if (filters != null) - { - uri.AppendQuery("filters", filters, true); - } - if (featureWindowStart != null) - { - uri.AppendQuery("featureWindowStart", featureWindowStart, true); - } - if (featureWindowEnd != null) - { - uri.AppendQuery("featureWindowEnd", featureWindowEnd, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List materialization Jobs. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// Start time of the feature window to filter materialization jobs. - /// End time of the feature window to filter materialization jobs. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListMaterializationJobsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - - using var message = CreateListMaterializationJobsRequest(subscriptionId, resourceGroupName, workspaceName, name, version, skip, filters, featureWindowStart, featureWindowEnd); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FeaturesetJobArmPaginatedResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FeaturesetJobArmPaginatedResult.DeserializeFeaturesetJobArmPaginatedResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List materialization Jobs. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// Start time of the feature window to filter materialization jobs. - /// End time of the feature window to filter materialization jobs. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListMaterializationJobs(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - - using var message = CreateListMaterializationJobsRequest(subscriptionId, resourceGroupName, workspaceName, name, version, skip, filters, featureWindowStart, featureWindowEnd); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FeaturesetJobArmPaginatedResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FeaturesetJobArmPaginatedResult.DeserializeFeaturesetJobArmPaginatedResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string tags, MachineLearningListViewType? listViewType, int? pageSize, string versionName, string version, string description, string createdBy, string stage) { var uri = new RawRequestUriBuilder(); @@ -915,105 +765,5 @@ public Response ListNextPage(string throw new RequestFailedException(message.Response); } } - - internal RequestUriBuilder CreateListMaterializationJobsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip, string filters, string featureWindowStart, string featureWindowEnd) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListMaterializationJobsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip, string filters, string featureWindowStart, string featureWindowEnd) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List materialization Jobs. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// Start time of the feature window to filter materialization jobs. - /// End time of the feature window to filter materialization jobs. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListMaterializationJobsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - - using var message = CreateListMaterializationJobsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, version, skip, filters, featureWindowStart, featureWindowEnd); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FeaturesetJobArmPaginatedResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FeaturesetJobArmPaginatedResult.DeserializeFeaturesetJobArmPaginatedResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List materialization Jobs. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// Start time of the feature window to filter materialization jobs. - /// End time of the feature window to filter materialization jobs. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListMaterializationJobsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - - using var message = CreateListMaterializationJobsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, version, skip, filters, featureWindowStart, featureWindowEnd); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FeaturesetJobArmPaginatedResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FeaturesetJobArmPaginatedResult.DeserializeFeaturesetJobArmPaginatedResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityContainersRestOperations.cs index 3cb7b05df7b34..305be332776e1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityContainersRestOperations.cs @@ -32,7 +32,7 @@ public FeaturestoreEntityContainersRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityVersionsRestOperations.cs index 603c76f417e0f..199128b1f32a9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityVersionsRestOperations.cs @@ -32,7 +32,7 @@ public FeaturestoreEntityVersionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/JobsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/JobsRestOperations.cs index 351c88a2e29ea..b56f1ee67a77e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/JobsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/JobsRestOperations.cs @@ -32,11 +32,11 @@ public JobsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpo { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string assetName, bool? scheduled, string scheduleId) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string properties) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -64,22 +64,14 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (assetName != null) + if (properties != null) { - uri.AppendQuery("assetName", assetName, true); - } - if (scheduled != null) - { - uri.AppendQuery("scheduled", scheduled.Value, true); - } - if (scheduleId != null) - { - uri.AppendQuery("scheduleId", scheduleId, true); + uri.AppendQuery("properties", properties, true); } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string assetName, bool? scheduled, string scheduleId) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string properties) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -110,17 +102,9 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (assetName != null) + if (properties != null) { - uri.AppendQuery("assetName", assetName, true); - } - if (scheduled != null) - { - uri.AppendQuery("scheduled", scheduled.Value, true); - } - if (scheduleId != null) - { - uri.AppendQuery("scheduleId", scheduleId, true); + uri.AppendQuery("properties", properties, true); } request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -136,19 +120,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Type of job to be returned. /// Jobs returned will have this tag key. /// View type for including/excluding (for example) archived entities. - /// Asset name the job's named output is registered with. - /// Indicator whether the job is scheduled job. - /// The scheduled id for listing the job triggered from. + /// Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string assetName = null, bool? scheduled = null, string scheduleId = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string properties = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, assetName, scheduled, scheduleId); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -172,19 +154,17 @@ public async Task> ListAsync(string /// Type of job to be returned. /// Jobs returned will have this tag key. /// View type for including/excluding (for example) archived entities. - /// Asset name the job's named output is registered with. - /// Indicator whether the job is scheduled job. - /// The scheduled id for listing the job triggered from. + /// Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string assetName = null, bool? scheduled = null, string scheduleId = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string properties = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, assetName, scheduled, scheduleId); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -398,114 +378,6 @@ public Response Get(string subscriptionId, string resour } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningJobPatch patch) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); - uri.AppendPath(workspaceName, true); - uri.AppendPath("/jobs/", false); - uri.AppendPath(id, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningJobPatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); - uri.AppendPath(workspaceName, true); - uri.AppendPath("/jobs/", false); - uri.AppendPath(id, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates a Job. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. - /// The name and identifier for the Job. This is case-sensitive. - /// Job definition to apply during the operation. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningJobPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, id, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MachineLearningJobData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MachineLearningJobData.DeserializeMachineLearningJobData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates a Job. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. - /// The name and identifier for the Job. This is case-sensitive. - /// Job definition to apply during the operation. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningJobPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, id, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MachineLearningJobData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MachineLearningJobData.DeserializeMachineLearningJobData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningJobData data) { var uri = new RawRequestUriBuilder(); @@ -548,7 +420,10 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r return message; } - /// Creates and executes a Job. + /// + /// Creates and executes a Job. + /// For update case, the Tags in the definition passed in will replace Tags in the existing job. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. @@ -582,7 +457,10 @@ public async Task> CreateOrUpdateAsync(string s } } - /// Creates and executes a Job. + /// + /// Creates and executes a Job. + /// For update case, the Tags in the definition passed in will replace Tags in the existing job. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. @@ -710,7 +588,7 @@ public Response Cancel(string subscriptionId, string resourceGroupName, string w } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string assetName, bool? scheduled, string scheduleId) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string properties) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -718,7 +596,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string assetName, bool? scheduled, string scheduleId) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string properties) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -741,20 +619,18 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Type of job to be returned. /// Jobs returned will have this tag key. /// View type for including/excluding (for example) archived entities. - /// Asset name the job's named output is registered with. - /// Indicator whether the job is scheduled job. - /// The scheduled id for listing the job triggered from. + /// Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string assetName = null, bool? scheduled = null, string scheduleId = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string properties = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, assetName, scheduled, scheduleId); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -779,20 +655,18 @@ public async Task> ListNextPageAsync /// Type of job to be returned. /// Jobs returned will have this tag key. /// View type for including/excluding (for example) archived entities. - /// Asset name the job's named output is registered with. - /// Indicator whether the job is scheduled job. - /// The scheduled id for listing the job triggered from. + /// Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string assetName = null, bool? scheduled = null, string scheduleId = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string properties = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, assetName, scheduled, scheduleId); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkProvisionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkProvisionsRestOperations.cs index d99263c912a99..d389a0c83a172 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkProvisionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkProvisionsRestOperations.cs @@ -31,7 +31,7 @@ public ManagedNetworkProvisionsRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -81,7 +81,7 @@ internal HttpMessage CreateProvisionManagedNetworkRequest(string subscriptionId, /// Provisions the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Managed Network Provisioning Options for a machine learning workspace. /// The cancellation token to use. /// , or is null. @@ -107,7 +107,7 @@ public async Task ProvisionManagedNetworkAsync(string subscriptionId, /// Provisions the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Managed Network Provisioning Options for a machine learning workspace. /// The cancellation token to use. /// , or is null. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkSettingsRuleRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkSettingsRuleRestOperations.cs index 9e544b6fc9bc5..7aaa61bc59659 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkSettingsRuleRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkSettingsRuleRestOperations.cs @@ -32,7 +32,7 @@ public ManagedNetworkSettingsRuleRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -75,7 +75,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Lists the managed network outbound rules for a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -104,7 +104,7 @@ public async Task> ListAsync(string subscriptio /// Lists the managed network outbound rules for a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -171,7 +171,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Deletes an outbound rule from the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// The cancellation token to use. /// , , or is null. @@ -199,7 +199,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Deletes an outbound rule from the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// The cancellation token to use. /// , , or is null. @@ -265,7 +265,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Gets an outbound rule from the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// The cancellation token to use. /// , , or is null. @@ -298,7 +298,7 @@ public async Task> GetAsync(strin /// Gets an outbound rule from the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// The cancellation token to use. /// , , or is null. @@ -373,7 +373,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// Creates or updates an outbound rule in the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// Outbound Rule to be created or updated in the managed network of a machine learning workspace. /// The cancellation token to use. @@ -402,7 +402,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// Creates or updates an outbound rule in the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// Outbound Rule to be created or updated in the managed network of a machine learning workspace. /// The cancellation token to use. @@ -454,7 +454,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -485,7 +485,7 @@ public async Task> ListNextPageAsync(string nex /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/MarketplaceSubscriptionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/MarketplaceSubscriptionsRestOperations.cs new file mode 100644 index 0000000000000..c788de18a5075 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/MarketplaceSubscriptionsRestOperations.cs @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class MarketplaceSubscriptionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of MarketplaceSubscriptionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public MarketplaceSubscriptionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string skip) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string skip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List containers. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MarketplaceSubscriptionResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MarketplaceSubscriptionResourceArmPaginatedResult.DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List containers. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MarketplaceSubscriptionResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MarketplaceSubscriptionResourceArmPaginatedResult.DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete Marketplace Subscription (asynchronous). + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Marketplace Subscription name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete Marketplace Subscription (asynchronous). + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Marketplace Subscription name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get container. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MarketplaceSubscriptionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MarketplaceSubscriptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get container. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MarketplaceSubscriptionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MarketplaceSubscriptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, MarketplaceSubscriptionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, MarketplaceSubscriptionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update Marketplace Subscription (asynchronous). + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Marketplace Subscription name. + /// Marketplace Subscription entity to apply during operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, MarketplaceSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, name, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update Marketplace Subscription (asynchronous). + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Marketplace Subscription name. + /// Marketplace Subscription entity to apply during operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string name, MarketplaceSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, name, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List containers. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MarketplaceSubscriptionResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MarketplaceSubscriptionResourceArmPaginatedResult.DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List containers. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MarketplaceSubscriptionResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MarketplaceSubscriptionResourceArmPaginatedResult.DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelContainersRestOperations.cs index dd6724af0f1d4..ef9a86e6da526 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelContainersRestOperations.cs @@ -32,7 +32,7 @@ public ModelContainersRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelVersionsRestOperations.cs index 68da602751fb0..3c988c369e69e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelVersionsRestOperations.cs @@ -32,11 +32,11 @@ public ModelVersionsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -90,14 +90,10 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -154,10 +150,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -179,18 +171,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. /// Name of the feed. /// View type for including/excluding (for example) archived entities. - /// Model stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -221,18 +212,17 @@ public async Task> ListAsync(st /// Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. /// Name of the feed. /// View type for including/excluding (for example) archived entities. - /// Model stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -578,7 +568,7 @@ public Response CreateOrUpdate(string subscript } } - internal RequestUriBuilder CreatePackageRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, ModelPackageContent content) + internal RequestUriBuilder CreatePublishRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -592,12 +582,12 @@ internal RequestUriBuilder CreatePackageRequestUri(string subscriptionId, string uri.AppendPath(name, true); uri.AppendPath("/versions/", false); uri.AppendPath(version, true); - uri.AppendPath("/package", false); + uri.AppendPath("/publish", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreatePackageRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, ModelPackageContent content) + internal HttpMessage CreatePublishRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -614,38 +604,38 @@ internal HttpMessage CreatePackageRequest(string subscriptionId, string resource uri.AppendPath(name, true); uri.AppendPath("/versions/", false); uri.AppendPath(version, true); - uri.AppendPath("/package", false); + uri.AppendPath("/publish", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Model Version Package operation. + /// Publish version asset into registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Package operation request body. + /// Container name. + /// Version identifier. + /// Destination registry info. /// The cancellation token to use. - /// , , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task PackageAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, ModelPackageContent content, CancellationToken cancellationToken = default) + public async Task PublishAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNullOrEmpty(version, nameof(version)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var message = CreatePackageRequest(subscriptionId, resourceGroupName, workspaceName, name, version, content); + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -657,26 +647,26 @@ public async Task PackageAsync(string subscriptionId, string resourceG } } - /// Model Version Package operation. + /// Publish version asset into registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Package operation request body. + /// Container name. + /// Version identifier. + /// Destination registry info. /// The cancellation token to use. - /// , , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Package(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, ModelPackageContent content, CancellationToken cancellationToken = default) + public Response Publish(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNullOrEmpty(version, nameof(version)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var message = CreatePackageRequest(subscriptionId, resourceGroupName, workspaceName, name, version, content); + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -688,7 +678,7 @@ public Response Package(string subscriptionId, string resourceGroupName, string } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -696,7 +686,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -726,11 +716,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. /// Name of the feed. /// View type for including/excluding (for example) archived entities. - /// Model stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -738,7 +727,7 @@ public async Task> ListNextPage Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -770,11 +759,10 @@ public async Task> ListNextPage /// Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. /// Name of the feed. /// View type for including/excluding (for example) archived entities. - /// Model stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -782,7 +770,7 @@ public Response ListNextPage(string next Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineDeploymentsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineDeploymentsRestOperations.cs index 030bdaa8c0e49..efc960363ce7b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineDeploymentsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineDeploymentsRestOperations.cs @@ -32,7 +32,7 @@ public OnlineDeploymentsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineEndpointsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineEndpointsRestOperations.cs index 9e2e77ca77f2b..2032e2e15b54e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineEndpointsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineEndpointsRestOperations.cs @@ -32,7 +32,7 @@ public OnlineEndpointsRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index a8f130fc067c2..62d77cdeab566 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -75,7 +75,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Called by end-users to get all PE connections. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -104,7 +104,7 @@ public async Task> /// Called by end-users to get all PE connections. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -171,7 +171,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Called by end-users to delete a PE connection. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// NRP Private Endpoint Connection Name. /// The cancellation token to use. /// , , or is null. @@ -198,7 +198,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Called by end-users to delete a PE connection. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// NRP Private Endpoint Connection Name. /// The cancellation token to use. /// , , or is null. @@ -263,7 +263,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Called by end-users to get a PE connection. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// NRP Private Endpoint Connection Name. /// The cancellation token to use. /// , , or is null. @@ -296,7 +296,7 @@ public async Task> GetAsy /// Called by end-users to get a PE connection. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// NRP Private Endpoint Connection Name. /// The cancellation token to use. /// , , or is null. @@ -374,7 +374,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// NRP Private Endpoint Connection Name. /// PrivateEndpointConnection object. /// The cancellation token to use. @@ -410,7 +410,7 @@ public async Task> Create /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// NRP Private Endpoint Connection Name. /// PrivateEndpointConnection object. /// The cancellation token to use. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index dc7d90ece3663..e3be97d200637 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -81,7 +81,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -116,7 +116,7 @@ public async Task> ListAs /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/QuotasRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/QuotasRestOperations.cs index 72e6dfe553442..3b84970373776 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/QuotasRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/QuotasRestOperations.cs @@ -32,7 +32,7 @@ public QuotasRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPoliciesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPoliciesRestOperations.cs new file mode 100644 index 0000000000000..3fbdb27bde442 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPoliciesRestOperations.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class RaiPoliciesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RaiPoliciesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public RaiPoliciesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the specified Content Filters associated with the Azure OpenAI account. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the specified Content Filters associated with the Azure OpenAI account. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPolicyRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPolicyRestOperations.cs new file mode 100644 index 0000000000000..2b32aab3386ee --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPolicyRestOperations.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class RaiPolicyRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RaiPolicyRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public RaiPolicyRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiPolicyPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiPolicyPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistriesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistriesRestOperations.cs index 43c39a9b9f2e4..74e28be3d5d39 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistriesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistriesRestOperations.cs @@ -32,7 +32,7 @@ public RegistriesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeContainersRestOperations.cs index 800792958c57d..c2b468dde977b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeContainersRestOperations.cs @@ -32,7 +32,7 @@ public RegistryCodeContainersRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeVersionsRestOperations.cs index 6163830d596e6..d2496481ed04f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeVersionsRestOperations.cs @@ -32,7 +32,7 @@ public RegistryCodeVersionsRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentContainersRestOperations.cs index 9cf0a89f4891b..e4248c3771b89 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentContainersRestOperations.cs @@ -32,7 +32,7 @@ public RegistryComponentContainersRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentVersionsRestOperations.cs index 8243a35a4438f..98303bbecb47e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentVersionsRestOperations.cs @@ -32,11 +32,11 @@ public RegistryComponentVersionsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip, string stage) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -62,14 +62,10 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$skip", skip, true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip, string stage) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -98,10 +94,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$skip", skip, true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -116,18 +108,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Ordering of list. /// Maximum number of records to return. /// Continuation token for pagination. - /// Component stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -151,18 +142,17 @@ public async Task> ListAsyn /// Ordering of list. /// Maximum number of records to return. /// Continuation token for pagination. - /// Component stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, string stage = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -500,7 +490,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip, string stage) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -508,7 +498,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip, string stage) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -531,11 +521,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Ordering of list. /// Maximum number of records to return. /// Continuation token for pagination. - /// Component stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -543,7 +532,7 @@ public async Task> ListNext Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -568,11 +557,10 @@ public async Task> ListNext /// Ordering of list. /// Maximum number of records to return. /// Continuation token for pagination. - /// Component stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, string stage = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -580,7 +568,7 @@ public Response ListNextPage(string Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataContainersRestOperations.cs index 34fc255bc571c..992cbcbf1e01f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataContainersRestOperations.cs @@ -32,7 +32,7 @@ public RegistryDataContainersRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataReferencesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataReferencesRestOperations.cs new file mode 100644 index 0000000000000..2ad243eb61c67 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataReferencesRestOperations.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class RegistryDataReferencesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RegistryDataReferencesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public RegistryDataReferencesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetBlobReferenceSasRequestUri(string subscriptionId, string resourceGroupName, string registryName, string name, string version, GetBlobReferenceSasRequestDto body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/datareferences/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetBlobReferenceSasRequest(string subscriptionId, string resourceGroupName, string registryName, string name, string version, GetBlobReferenceSasRequestDto body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/datareferences/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Get blob reference SAS Uri. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning registry. This is case-insensitive. + /// Data reference name. + /// Version identifier. + /// Asset id and blob uri. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetBlobReferenceSasAsync(string subscriptionId, string resourceGroupName, string registryName, string name, string version, GetBlobReferenceSasRequestDto body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateGetBlobReferenceSasRequest(subscriptionId, resourceGroupName, registryName, name, version, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GetBlobReferenceSasResponseDto value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GetBlobReferenceSasResponseDto.DeserializeGetBlobReferenceSasResponseDto(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get blob reference SAS Uri. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning registry. This is case-insensitive. + /// Data reference name. + /// Version identifier. + /// Asset id and blob uri. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response GetBlobReferenceSas(string subscriptionId, string resourceGroupName, string registryName, string name, string version, GetBlobReferenceSasRequestDto body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateGetBlobReferenceSasRequest(subscriptionId, resourceGroupName, registryName, name, version, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GetBlobReferenceSasResponseDto value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GetBlobReferenceSasResponseDto.DeserializeGetBlobReferenceSasResponseDto(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataVersionsRestOperations.cs index d00c55d4f20c2..a27b998e9bde2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataVersionsRestOperations.cs @@ -32,7 +32,7 @@ public RegistryDataVersionsRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentContainersRestOperations.cs index 1d955464e654e..98e0095504bdc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentContainersRestOperations.cs @@ -32,7 +32,7 @@ public RegistryEnvironmentContainersRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentVersionsRestOperations.cs index 5b3a476fc5b55..c032646c5d459 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentVersionsRestOperations.cs @@ -32,11 +32,11 @@ public RegistryEnvironmentVersionsRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -66,14 +66,10 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -106,10 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -125,18 +117,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -161,18 +152,17 @@ public async Task> ListAs /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -510,7 +500,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -518,7 +508,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -542,11 +532,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -554,7 +543,7 @@ public async Task> ListNe Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -580,11 +569,10 @@ public async Task> ListNe /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -592,7 +580,7 @@ public Response ListNextPage(strin Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelContainersRestOperations.cs index 492e87e089287..2478e84d6ef78 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelContainersRestOperations.cs @@ -32,7 +32,7 @@ public RegistryModelContainersRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelVersionsRestOperations.cs index 76ec73b3e1618..fa93048ebed83 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelVersionsRestOperations.cs @@ -32,7 +32,7 @@ public RegistryModelVersionsRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -540,116 +540,6 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreatePackageRequestUri(string subscriptionId, string resourceGroupName, string registryName, string modelName, string version, ModelPackageContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.MachineLearningServices/registries/", false); - uri.AppendPath(registryName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(modelName, true); - uri.AppendPath("/versions/", false); - uri.AppendPath(version, true); - uri.AppendPath("/package", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreatePackageRequest(string subscriptionId, string resourceGroupName, string registryName, string modelName, string version, ModelPackageContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.MachineLearningServices/registries/", false); - uri.AppendPath(registryName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(modelName, true); - uri.AppendPath("/versions/", false); - uri.AppendPath(version, true); - uri.AppendPath("/package", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Model Version Package operation. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning registry. This is case-insensitive. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Package operation request body. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task PackageAsync(string subscriptionId, string resourceGroupName, string registryName, string modelName, string version, ModelPackageContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(modelName, nameof(modelName)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreatePackageRequest(subscriptionId, resourceGroupName, registryName, modelName, version, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Model Version Package operation. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning registry. This is case-insensitive. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Package operation request body. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response Package(string subscriptionId, string resourceGroupName, string registryName, string modelName, string version, ModelPackageContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(modelName, nameof(modelName)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreatePackageRequest(subscriptionId, resourceGroupName, registryName, modelName, version, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateCreateOrGetStartPendingUploadRequestUri(string subscriptionId, string resourceGroupName, string registryName, string modelName, string version, PendingUploadRequestDto body) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/SchedulesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/SchedulesRestOperations.cs index 74f97b8a684db..14a013fc6bacc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/SchedulesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/SchedulesRestOperations.cs @@ -32,7 +32,7 @@ public SchedulesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/LabelingJobsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ServerlessEndpointsRestOperations.cs similarity index 69% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/LabelingJobsRestOperations.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ServerlessEndpointsRestOperations.cs index 32d859b8b396c..81413ded766a9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/LabelingJobsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ServerlessEndpointsRestOperations.cs @@ -15,28 +15,28 @@ namespace Azure.ResourceManager.MachineLearning { - internal partial class LabelingJobsRestOperations + internal partial class ServerlessEndpointsRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of LabelingJobsRestOperations. + /// Initializes a new instance of ServerlessEndpointsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. /// server parameter. /// Api Version. /// or is null. - public LabelingJobsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public ServerlessEndpointsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string skip, int? top) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string skip) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,20 +46,16 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs", false); + uri.AppendPath("/serverlessEndpoints", false); uri.AppendQuery("api-version", _apiVersion, true); if (skip != null) { uri.AppendQuery("$skip", skip, true); } - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string skip, int? top) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string skip) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -72,46 +68,41 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs", false); + uri.AppendPath("/serverlessEndpoints", false); uri.AppendQuery("api-version", _apiVersion, true); if (skip != null) { uri.AppendQuery("$skip", skip, true); } - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Lists labeling jobs in the workspace. + /// List Serverless Endpoints. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Continuation token for pagination. - /// Number of labeling jobs to return. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, int? top = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip, top); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - LabelingJobResourceArmPaginatedResult value = default; + ServerlessEndpointTrackedResourceArmPaginatedResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = LabelingJobResourceArmPaginatedResult.DeserializeLabelingJobResourceArmPaginatedResult(document.RootElement); + value = ServerlessEndpointTrackedResourceArmPaginatedResult.DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -119,30 +110,29 @@ public async Task> ListAsync(str } } - /// Lists labeling jobs in the workspace. + /// List Serverless Endpoints. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Continuation token for pagination. - /// Number of labeling jobs to return. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, int? top = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip, top); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - LabelingJobResourceArmPaginatedResult value = default; + ServerlessEndpointTrackedResourceArmPaginatedResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = LabelingJobResourceArmPaginatedResult.DeserializeLabelingJobResourceArmPaginatedResult(document.RootElement); + value = ServerlessEndpointTrackedResourceArmPaginatedResult.DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -150,7 +140,7 @@ public Response List(string subscriptionI } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -160,13 +150,13 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -179,8 +169,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -188,26 +178,26 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Delete a labeling job. + /// Delete Serverless Endpoint (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. + /// Serverless Endpoint name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, id); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: + case 202: case 204: return message.Response; default: @@ -215,26 +205,26 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } } - /// Delete a labeling job. + /// Delete Serverless Endpoint (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. + /// Serverless Endpoint name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string id, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, id); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: + case 202: case 204: return message.Response; default: @@ -242,7 +232,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string w } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id, bool? includeJobInstructions, bool? includeLabelCategories) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -252,21 +242,13 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); - if (includeJobInstructions != null) - { - uri.AppendQuery("includeJobInstructions", includeJobInstructions.Value, true); - } - if (includeLabelCategories != null) - { - uri.AppendQuery("includeLabelCategories", includeLabelCategories.Value, true); - } return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id, bool? includeJobInstructions, bool? includeLabelCategories) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -279,94 +261,82 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); - if (includeJobInstructions != null) - { - uri.AppendQuery("includeJobInstructions", includeJobInstructions.Value, true); - } - if (includeLabelCategories != null) - { - uri.AppendQuery("includeLabelCategories", includeLabelCategories.Value, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Gets a labeling job by name/id. + /// Get Serverless Endpoint. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. + /// Serverless Endpoint name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, id, includeJobInstructions, includeLabelCategories); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - MachineLearningLabelingJobData value = default; + ServerlessEndpointData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(document.RootElement); + value = ServerlessEndpointData.DeserializeServerlessEndpointData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((MachineLearningLabelingJobData)null, message.Response); + return Response.FromValue((ServerlessEndpointData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets a labeling job by name/id. + /// Get Serverless Endpoint. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. + /// Serverless Endpoint name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, id, includeJobInstructions, includeLabelCategories); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - MachineLearningLabelingJobData value = default; + ServerlessEndpointData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(document.RootElement); + value = ServerlessEndpointData.DeserializeServerlessEndpointData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((MachineLearningLabelingJobData)null, message.Response); + return Response.FromValue((ServerlessEndpointData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningLabelingJobData data) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -376,17 +346,17 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningLabelingJobData data) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -395,78 +365,78 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// Creates or updates a labeling job (asynchronous). + /// Update Serverless Endpoint (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. - /// LabelingJob definition object. + /// Serverless Endpoint name. + /// Serverless Endpoint entity to apply during operation. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningLabelingJobData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, id, data); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: + case 202: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Creates or updates a labeling job (asynchronous). + /// Update Serverless Endpoint (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. - /// LabelingJob definition object. + /// Serverless Endpoint name. + /// Serverless Endpoint entity to apply during operation. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningLabelingJobData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, id, data); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: + case 202: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateExportLabelsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id, ExportSummary body) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -476,18 +446,17 @@ internal RequestUriBuilder CreateExportLabelsRequestUri(string subscriptionId, s uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); - uri.AppendPath("/exportLabels", false); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateExportLabelsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id, ExportSummary body) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -496,79 +465,78 @@ internal HttpMessage CreateExportLabelsRequest(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); - uri.AppendPath("/exportLabels", false); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// Export labels from a labeling job (asynchronous). + /// Create or update Serverless Endpoint (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. - /// The export summary. + /// Serverless Endpoint name. + /// Serverless Endpoint entity to apply during operation. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task ExportLabelsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, ExportSummary body, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateExportLabelsRequest(subscriptionId, resourceGroupName, workspaceName, id, body); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, name, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Export labels from a labeling job (asynchronous). + /// Create or update Serverless Endpoint (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. - /// The export summary. + /// Serverless Endpoint name. + /// Serverless Endpoint entity to apply during operation. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ExportLabels(string subscriptionId, string resourceGroupName, string workspaceName, string id, ExportSummary body, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateExportLabelsRequest(subscriptionId, resourceGroupName, workspaceName, id, body); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, name, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreatePauseRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id) + internal RequestUriBuilder CreateListKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -578,14 +546,14 @@ internal RequestUriBuilder CreatePauseRequestUri(string subscriptionId, string r uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); - uri.AppendPath("/pause", false); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); + uri.AppendPath("/listKeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreatePauseRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id) + internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -598,9 +566,9 @@ internal HttpMessage CreatePauseRequest(string subscriptionId, string resourceGr uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); - uri.AppendPath("/pause", false); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); + uri.AppendPath("/listKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -608,59 +576,69 @@ internal HttpMessage CreatePauseRequest(string subscriptionId, string resourceGr return message; } - /// Pause a labeling job. + /// List EndpointAuthKeys for an Endpoint using Key-based authentication. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. + /// Serverless Endpoint name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task PauseAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreatePauseRequest(subscriptionId, resourceGroupName, workspaceName, id); + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, workspaceName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - return message.Response; + { + MachineLearningEndpointAuthKeys value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineLearningEndpointAuthKeys.DeserializeMachineLearningEndpointAuthKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Pause a labeling job. + /// List EndpointAuthKeys for an Endpoint using Key-based authentication. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. + /// Serverless Endpoint name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Pause(string subscriptionId, string resourceGroupName, string workspaceName, string id, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListKeys(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreatePauseRequest(subscriptionId, resourceGroupName, workspaceName, id); + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, workspaceName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - return message.Response; + { + MachineLearningEndpointAuthKeys value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineLearningEndpointAuthKeys.DeserializeMachineLearningEndpointAuthKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateResumeRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id) + internal RequestUriBuilder CreateRegenerateKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, MachineLearningEndpointKeyRegenerateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -670,14 +648,14 @@ internal RequestUriBuilder CreateResumeRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); - uri.AppendPath("/resume", false); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); + uri.AppendPath("/regenerateKeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateResumeRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id) + internal HttpMessage CreateRegenerateKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, MachineLearningEndpointKeyRegenerateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -690,32 +668,38 @@ internal HttpMessage CreateResumeRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); - uri.AppendPath("/resume", false); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); + uri.AppendPath("/regenerateKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Resume a labeling job (asynchronous). + /// Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. + /// Serverless Endpoint name. + /// RegenerateKeys request . /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task ResumeAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task RegenerateKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, MachineLearningEndpointKeyRegenerateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateResumeRequest(subscriptionId, resourceGroupName, workspaceName, id); + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, workspaceName, name, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -727,22 +711,24 @@ public async Task ResumeAsync(string subscriptionId, string resourceGr } } - /// Resume a labeling job (asynchronous). + /// Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. + /// Serverless Endpoint name. + /// RegenerateKeys request . /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Resume(string subscriptionId, string resourceGroupName, string workspaceName, string id, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response RegenerateKeys(string subscriptionId, string resourceGroupName, string workspaceName, string name, MachineLearningEndpointKeyRegenerateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateResumeRequest(subscriptionId, resourceGroupName, workspaceName, id); + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, workspaceName, name, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -754,7 +740,7 @@ public Response Resume(string subscriptionId, string resourceGroupName, string w } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip, int? top) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -762,7 +748,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip, int? top) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -776,32 +762,31 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// Lists labeling jobs in the workspace. + /// List Serverless Endpoints. /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Continuation token for pagination. - /// Number of labeling jobs to return. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, int? top = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip, top); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - LabelingJobResourceArmPaginatedResult value = default; + ServerlessEndpointTrackedResourceArmPaginatedResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = LabelingJobResourceArmPaginatedResult.DeserializeLabelingJobResourceArmPaginatedResult(document.RootElement); + value = ServerlessEndpointTrackedResourceArmPaginatedResult.DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -809,32 +794,31 @@ public async Task> ListNextPageA } } - /// Lists labeling jobs in the workspace. + /// List Serverless Endpoints. /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Continuation token for pagination. - /// Number of labeling jobs to return. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, int? top = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip, top); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - LabelingJobResourceArmPaginatedResult value = default; + ServerlessEndpointTrackedResourceArmPaginatedResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = LabelingJobResourceArmPaginatedResult.DeserializeLabelingJobResourceArmPaginatedResult(document.RootElement); + value = ServerlessEndpointTrackedResourceArmPaginatedResult.DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/UsagesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/UsagesRestOperations.cs index 5b1d8418dce06..9e87eb46a663c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/UsagesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/UsagesRestOperations.cs @@ -32,7 +32,7 @@ public UsagesRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs index 2476225f33a42..003f864f03c22 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineSizesRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceConnectionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceConnectionsRestOperations.cs index 972a85252305a..a10bb2895787a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceConnectionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceConnectionsRestOperations.cs @@ -32,11 +32,11 @@ public WorkspaceConnectionsRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string target, string category) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string target, string category, bool? includeAll) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -56,10 +56,14 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendQuery("category", category, true); } uri.AppendQuery("api-version", _apiVersion, true); + if (includeAll != null) + { + uri.AppendQuery("includeAll", includeAll.Value, true); + } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string target, string category) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string target, string category, bool? includeAll) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -82,6 +86,10 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendQuery("category", category, true); } uri.AppendQuery("api-version", _apiVersion, true); + if (includeAll != null) + { + uri.AppendQuery("includeAll", includeAll.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -91,19 +99,20 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Lists all the available machine learning workspaces connections under the specified workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, target, category); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, target, category, includeAll); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -122,19 +131,20 @@ public async Task Lists all the available machine learning workspaces connections under the specified workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, target, category); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, target, category, includeAll); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -191,7 +201,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Delete machine learning workspaces connections by name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -218,7 +228,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Delete machine learning workspaces connections by name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -283,7 +293,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Lists machine learning workspaces connections by name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -316,7 +326,7 @@ public async Task> GetAsync(str /// Lists machine learning workspaces connections by name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -391,7 +401,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// Update machine learning workspaces connections under the specified workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// Parameters for workspace connection update. /// The cancellation token to use. @@ -424,7 +434,7 @@ public async Task> UpdateAsync( /// Update machine learning workspaces connections under the specified workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// Parameters for workspace connection update. /// The cancellation token to use. @@ -499,7 +509,7 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG /// Create or update machine learning workspaces connections under the specified workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The object for creating or updating a new workspace connection. /// The cancellation token to use. @@ -532,7 +542,7 @@ public async Task> CreateAsync( /// Create or update machine learning workspaces connections under the specified workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The object for creating or updating a new workspace connection. /// The cancellation token to use. @@ -605,7 +615,7 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso /// List all the secrets of a machine learning workspaces connections. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -636,7 +646,7 @@ public async Task> ListSecretsA /// List all the secrets of a machine learning workspaces connections. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -664,7 +674,108 @@ public Response ListSecrets(string subsc } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target, string category) + internal RequestUriBuilder CreateTestConnectionRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/testconnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateTestConnectionRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/testconnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (data != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Test machine learning workspaces connections under the specified workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Workspace Connection object. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task TestConnectionAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateTestConnectionRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Test machine learning workspaces connections under the specified workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Workspace Connection object. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response TestConnection(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateTestConnectionRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target, string category, bool? includeAll) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -672,7 +783,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target, string category) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target, string category, bool? includeAll) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -690,20 +801,21 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, target, category); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, target, category, includeAll); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -723,20 +835,21 @@ public async Task The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, target, category); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, target, category, includeAll); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceFeaturesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceFeaturesRestOperations.cs index 53e88eeacd5d8..254f7a0408cba 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceFeaturesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceFeaturesRestOperations.cs @@ -32,7 +32,7 @@ public WorkspaceFeaturesRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspacesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspacesRestOperations.cs index 13c5281c7046b..ae26b9fc03302 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspacesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspacesRestOperations.cs @@ -32,11 +32,11 @@ public WorkspacesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, string skip, string kind) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, string kind, string skip, string aiCapabilities) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,18 +44,22 @@ internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptio uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces", false); uri.AppendQuery("api-version", _apiVersion, true); + if (kind != null) + { + uri.AppendQuery("kind", kind, true); + } if (skip != null) { uri.AppendQuery("$skip", skip, true); } - if (kind != null) + if (aiCapabilities != null) { - uri.AppendQuery("kind", kind, true); + uri.AppendQuery("aiCapabilities", aiCapabilities, true); } return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string skip, string kind) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string kind, string skip, string aiCapabilities) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -66,13 +70,17 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, stri uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces", false); uri.AppendQuery("api-version", _apiVersion, true); + if (kind != null) + { + uri.AppendQuery("kind", kind, true); + } if (skip != null) { uri.AppendQuery("$skip", skip, true); } - if (kind != null) + if (aiCapabilities != null) { - uri.AppendQuery("kind", kind, true); + uri.AppendQuery("aiCapabilities", aiCapabilities, true); } request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -82,16 +90,17 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, stri /// Lists all the available machine learning workspaces under the specified subscription. /// The ID of the target subscription. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionAsync(string subscriptionId, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId, skip, kind); + using var message = CreateListBySubscriptionRequest(subscriptionId, kind, skip, aiCapabilities); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -109,16 +118,17 @@ public async Task> ListBySubscriptionAsync(string /// Lists all the available machine learning workspaces under the specified subscription. /// The ID of the target subscription. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public Response ListBySubscription(string subscriptionId, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId, skip, kind); + using var message = CreateListBySubscriptionRequest(subscriptionId, kind, skip, aiCapabilities); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -134,7 +144,7 @@ public Response ListBySubscription(string subscriptionId, s } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string skip, string kind) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string kind, string skip, string aiCapabilities) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -144,18 +154,22 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces", false); uri.AppendQuery("api-version", _apiVersion, true); + if (kind != null) + { + uri.AppendQuery("kind", kind, true); + } if (skip != null) { uri.AppendQuery("$skip", skip, true); } - if (kind != null) + if (aiCapabilities != null) { - uri.AppendQuery("kind", kind, true); + uri.AppendQuery("aiCapabilities", aiCapabilities, true); } return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string skip, string kind) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string kind, string skip, string aiCapabilities) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -168,13 +182,17 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces", false); uri.AppendQuery("api-version", _apiVersion, true); + if (kind != null) + { + uri.AppendQuery("kind", kind, true); + } if (skip != null) { uri.AppendQuery("$skip", skip, true); } - if (kind != null) + if (aiCapabilities != null) { - uri.AppendQuery("kind", kind, true); + uri.AppendQuery("aiCapabilities", aiCapabilities, true); } request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -185,17 +203,18 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str /// Lists all the available machine learning workspaces under the specified resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skip, kind); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, kind, skip, aiCapabilities); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -214,17 +233,18 @@ public async Task> ListByResourceGroupAsync(string /// Lists all the available machine learning workspaces under the specified resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skip, kind); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, kind, skip, aiCapabilities); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -285,7 +305,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Deletes a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Flag to indicate delete is a purge request. /// The cancellation token to use. /// , or is null. @@ -312,7 +332,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Deletes a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Flag to indicate delete is a purge request. /// The cancellation token to use. /// , or is null. @@ -373,7 +393,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Gets the properties of the specified machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -404,7 +424,7 @@ public async Task> GetAsync(string subscr /// Gets the properties of the specified machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -473,7 +493,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// Updates a machine learning workspace with the specified parameters. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for updating a machine learning workspace. /// The cancellation token to use. /// , , or is null. @@ -500,7 +520,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// Updates a machine learning workspace with the specified parameters. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for updating a machine learning workspace. /// The cancellation token to use. /// , , or is null. @@ -565,7 +585,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// Creates or updates a workspace with the specified parameters. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for creating or updating a machine learning workspace. /// The cancellation token to use. /// , , or is null. @@ -592,7 +612,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// Creates or updates a workspace with the specified parameters. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for creating or updating a machine learning workspace. /// The cancellation token to use. /// , , or is null. @@ -662,7 +682,7 @@ internal HttpMessage CreateDiagnoseRequest(string subscriptionId, string resourc /// Diagnose workspace setup issue. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameter of diagnosing workspace health. /// The cancellation token to use. /// , or is null. @@ -688,7 +708,7 @@ public async Task DiagnoseAsync(string subscriptionId, string resource /// Diagnose workspace setup issue. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameter of diagnosing workspace health. /// The cancellation token to use. /// , or is null. @@ -750,7 +770,7 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc /// Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -779,7 +799,7 @@ public async Task> ListKeysAsync /// Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -844,7 +864,7 @@ internal HttpMessage CreateListNotebookAccessTokenRequest(string subscriptionId, /// Get Azure Machine Learning Workspace notebook access token. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -873,7 +893,7 @@ public async Task> L /// Get Azure Machine Learning Workspace notebook access token. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -938,7 +958,7 @@ internal HttpMessage CreateListNotebookKeysRequest(string subscriptionId, string /// Lists keys of Azure Machine Learning Workspaces notebook. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -967,7 +987,7 @@ public async Task> ListN /// Lists keys of Azure Machine Learning Workspaces notebook. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1032,7 +1052,7 @@ internal HttpMessage CreateListStorageAccountKeysRequest(string subscriptionId, /// Lists keys of Azure Machine Learning Workspace's storage account. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1061,7 +1081,7 @@ public async Task> /// Lists keys of Azure Machine Learning Workspace's storage account. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1126,7 +1146,7 @@ internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsRequest(strin /// Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1155,7 +1175,7 @@ public async Task> ListOutboundNetworkDependencie /// Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1220,7 +1240,7 @@ internal HttpMessage CreatePrepareNotebookRequest(string subscriptionId, string /// Prepare Azure Machine Learning Workspace's notebook resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1245,7 +1265,7 @@ public async Task PrepareNotebookAsync(string subscriptionId, string r /// Prepare Azure Machine Learning Workspace's notebook resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1306,7 +1326,7 @@ internal HttpMessage CreateResyncKeysRequest(string subscriptionId, string resou /// Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and password for container registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1331,7 +1351,7 @@ public async Task ResyncKeysAsync(string subscriptionId, string resour /// Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and password for container registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1353,7 +1373,7 @@ public Response ResyncKeys(string subscriptionId, string resourceGroupName, stri } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, string skip, string kind) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, string kind, string skip, string aiCapabilities) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1361,7 +1381,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string skip, string kind) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string kind, string skip, string aiCapabilities) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1378,17 +1398,18 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Lists all the available machine learning workspaces under the specified subscription. /// The URL to the next page of results. /// The ID of the target subscription. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, skip, kind); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, kind, skip, aiCapabilities); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1407,17 +1428,18 @@ public async Task> ListBySubscriptionNextPageAsync /// Lists all the available machine learning workspaces under the specified subscription. /// The URL to the next page of results. /// The ID of the target subscription. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, skip, kind); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, kind, skip, aiCapabilities); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1433,7 +1455,7 @@ public Response ListBySubscriptionNextPage(string nextLink, } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string skip, string kind) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string kind, string skip, string aiCapabilities) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1441,7 +1463,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string skip, string kind) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string kind, string skip, string aiCapabilities) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1459,18 +1481,19 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skip, kind); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, kind, skip, aiCapabilities); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1490,18 +1513,19 @@ public async Task> ListByResourceGroupNextPageAsyn /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skip, kind); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, kind, skip, aiCapabilities); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointCollection.cs new file mode 100644 index 0000000000000..5a3ba1b9c8e3b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointCollection.cs @@ -0,0 +1,495 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetServerlessEndpoints method from an instance of . + /// + public partial class ServerlessEndpointCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _serverlessEndpointClientDiagnostics; + private readonly ServerlessEndpointsRestOperations _serverlessEndpointRestClient; + + /// Initializes a new instance of the class for mocking. + protected ServerlessEndpointCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ServerlessEndpointCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serverlessEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ServerlessEndpointResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ServerlessEndpointResource.ResourceType, out string serverlessEndpointApiVersion); + _serverlessEndpointRestClient = new ServerlessEndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serverlessEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceResource.ResourceType), nameof(id)); + } + + /// + /// Create or update Serverless Endpoint (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Serverless Endpoint name. + /// Serverless Endpoint entity to apply during operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string name, ServerlessEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new ServerlessEndpointOperationSource(Client), _serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Serverless Endpoint (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Serverless Endpoint name. + /// Serverless Endpoint entity to apply during operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string name, ServerlessEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new ServerlessEndpointOperationSource(Client), _serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get Serverless Endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.Get"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServerlessEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get Serverless Endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.Get"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServerlessEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Serverless Endpoints. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints + /// + /// + /// Operation Id + /// ServerlessEndpoints_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token for pagination. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _serverlessEndpointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serverlessEndpointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServerlessEndpointResource(Client, ServerlessEndpointData.DeserializeServerlessEndpointData(e)), _serverlessEndpointClientDiagnostics, Pipeline, "ServerlessEndpointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Serverless Endpoints. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints + /// + /// + /// Operation Id + /// ServerlessEndpoints_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token for pagination. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _serverlessEndpointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serverlessEndpointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServerlessEndpointResource(Client, ServerlessEndpointData.DeserializeServerlessEndpointData(e)), _serverlessEndpointClientDiagnostics, Pipeline, "ServerlessEndpointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.Exists"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.Exists"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServerlessEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.GetIfExists"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServerlessEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.Serialization.cs new file mode 100644 index 0000000000000..444cfb0c53f8c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.Serialization.cs @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class ServerlessEndpointData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointData 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(ServerlessEndpointData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointData(document.RootElement, options); + } + + internal static ServerlessEndpointData DeserializeServerlessEndpointData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentity identity = default; + string kind = default; + ServerlessEndpointProperties properties = default; + MachineLearningSku sku = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + properties = ServerlessEndpointProperties.DeserializeServerlessEndpointProperties(property.Value, options); + continue; + } + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = MachineLearningSku.DeserializeMachineLearningSku(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + identity, + kind, + properties, + sku, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointData)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.cs new file mode 100644 index 0000000000000..28072f92ba5d0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the ServerlessEndpoint data model. + public partial class ServerlessEndpointData : TrackedResourceData + { + /// + /// 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 location. + /// [Required] Additional attributes of the entity. + /// is null. + public ServerlessEndpointData(AzureLocation location, ServerlessEndpointProperties properties) : base(location) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Managed service identity (system assigned and/or user assigned identities). + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// [Required] Additional attributes of the entity. + /// Sku details required for ARM contract for Autoscaling. + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, ServerlessEndpointProperties properties, MachineLearningSku sku, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Identity = identity; + Kind = kind; + Properties = properties; + Sku = sku; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointData() + { + } + + /// Managed service identity (system assigned and/or user assigned identities). + public ManagedServiceIdentity Identity { get; set; } + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + public string Kind { get; set; } + /// [Required] Additional attributes of the entity. + public ServerlessEndpointProperties Properties { get; set; } + /// Sku details required for ARM contract for Autoscaling. + public MachineLearningSku Sku { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.Serialization.cs new file mode 100644 index 0000000000000..b04a2e28ef133 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class ServerlessEndpointResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ServerlessEndpointData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ServerlessEndpointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.cs new file mode 100644 index 0000000000000..0587ec53be670 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.cs @@ -0,0 +1,875 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a ServerlessEndpoint along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetServerlessEndpointResource method. + /// Otherwise you can get one from its parent resource using the GetServerlessEndpoint method. + /// + public partial class ServerlessEndpointResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The name. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _serverlessEndpointClientDiagnostics; + private readonly ServerlessEndpointsRestOperations _serverlessEndpointRestClient; + private readonly ServerlessEndpointData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/serverlessEndpoints"; + + /// Initializes a new instance of the class for mocking. + protected ServerlessEndpointResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ServerlessEndpointResource(ArmClient client, ServerlessEndpointData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ServerlessEndpointResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serverlessEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string serverlessEndpointApiVersion); + _serverlessEndpointRestClient = new ServerlessEndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serverlessEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ServerlessEndpointData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get Serverless Endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.Get"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServerlessEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get Serverless Endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.Get"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServerlessEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Serverless Endpoint (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.Delete"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Serverless Endpoint (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.Delete"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Serverless Endpoint (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Update + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Serverless Endpoint entity to apply during operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ServerlessEndpointPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.Update"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new ServerlessEndpointOperationSource(Client), _serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Serverless Endpoint (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Update + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Serverless Endpoint entity to apply during operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ServerlessEndpointPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.Update"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new MachineLearningArmOperation(new ServerlessEndpointOperationSource(Client), _serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List EndpointAuthKeys for an Endpoint using Key-based authentication. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys + /// + /// + /// Operation Id + /// ServerlessEndpoints_ListKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetKeysAsync(CancellationToken cancellationToken = default) + { + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.GetKeys"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.ListKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List EndpointAuthKeys for an Endpoint using Key-based authentication. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys + /// + /// + /// Operation Id + /// ServerlessEndpoints_ListKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetKeys(CancellationToken cancellationToken = default) + { + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.GetKeys"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.ListKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys + /// + /// + /// Operation Id + /// ServerlessEndpoints_RegenerateKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// RegenerateKeys request . + /// The cancellation token to use. + /// is null. + public virtual async Task> RegenerateKeysAsync(WaitUntil waitUntil, MachineLearningEndpointKeyRegenerateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.RegenerateKeys"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.RegenerateKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new MachineLearningEndpointAuthKeysOperationSource(), _serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateRegenerateKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys + /// + /// + /// Operation Id + /// ServerlessEndpoints_RegenerateKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// RegenerateKeys request . + /// The cancellation token to use. + /// is null. + public virtual ArmOperation RegenerateKeys(WaitUntil waitUntil, MachineLearningEndpointKeyRegenerateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.RegenerateKeys"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.RegenerateKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new MachineLearningArmOperation(new MachineLearningEndpointAuthKeysOperationSource(), _serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateRegenerateKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ServerlessEndpointResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ServerlessEndpointPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ServerlessEndpointResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ServerlessEndpointPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ServerlessEndpointResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ServerlessEndpointPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ServerlessEndpointResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ServerlessEndpointPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ServerlessEndpointResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ServerlessEndpointPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ServerlessEndpointResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ServerlessEndpointPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentCollection.cs new file mode 100644 index 0000000000000..a57bf264faee3 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentCollection.cs @@ -0,0 +1,493 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspaceConnectionDeployments method from an instance of . + /// + public partial class WorkspaceConnectionDeploymentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspaceConnectionDeploymentConnectionClientDiagnostics; + private readonly ConnectionRestOperations _workspaceConnectionDeploymentConnectionRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceConnectionDeploymentCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspaceConnectionDeploymentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceConnectionDeploymentConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionDeploymentResource.ResourceType, out string workspaceConnectionDeploymentConnectionApiVersion); + _workspaceConnectionDeploymentConnectionRestClient = new ConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionDeploymentConnectionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceConnectionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceConnectionResource.ResourceType), nameof(id)); + } + + /// + /// Create or update Azure OpenAI connection deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_CreateOrUpdateDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.CreateOrUpdateDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionDeploymentOperationSource(Client), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateCreateOrUpdateDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Azure OpenAI connection deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_CreateOrUpdateDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.CreateOrUpdateDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionDeploymentOperationSource(Client), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateCreateOrUpdateDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.Get"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.GetDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.Get"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.GetDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all the deployments under the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments + /// + /// + /// Operation Id + /// Connection_ListDeployments + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateListDeploymentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionDeploymentConnectionRestClient.CreateListDeploymentsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceConnectionDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "WorkspaceConnectionDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get all the deployments under the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments + /// + /// + /// Operation Id + /// Connection_ListDeployments + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateListDeploymentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionDeploymentConnectionRestClient.CreateListDeploymentsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceConnectionDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "WorkspaceConnectionDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.Exists"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.GetDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.Exists"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.GetDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.GetDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.GetDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.Serialization.cs new file mode 100644 index 0000000000000..eb8d86503665f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class WorkspaceConnectionDeploymentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EndpointDeploymentResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EndpointDeploymentResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.cs new file mode 100644 index 0000000000000..3857dcd15e80b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a WorkspaceConnectionDeployment along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspaceConnectionDeploymentResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspaceConnectionDeployment method. + /// + public partial class WorkspaceConnectionDeploymentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The connectionName. + /// The deploymentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspaceConnectionDeploymentConnectionClientDiagnostics; + private readonly ConnectionRestOperations _workspaceConnectionDeploymentConnectionRestClient; + private readonly EndpointDeploymentResourcePropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/connections/deployments"; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceConnectionDeploymentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspaceConnectionDeploymentResource(ArmClient client, EndpointDeploymentResourcePropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspaceConnectionDeploymentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceConnectionDeploymentConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspaceConnectionDeploymentConnectionApiVersion); + _workspaceConnectionDeploymentConnectionRestClient = new ConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionDeploymentConnectionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual EndpointDeploymentResourcePropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Get"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.GetDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Get"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.GetDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Azure OpenAI connection deployment resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_DeleteDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Delete"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.DeleteDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateDeleteDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Azure OpenAI connection deployment resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_DeleteDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Delete"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.DeleteDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateDeleteDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Azure OpenAI connection deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_CreateOrUpdateDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// deployment object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Update"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.CreateOrUpdateDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionDeploymentOperationSource(Client), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateCreateOrUpdateDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Azure OpenAI connection deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_CreateOrUpdateDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// deployment object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Update"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.CreateOrUpdateDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionDeploymentOperationSource(Client), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateCreateOrUpdateDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyCollection.cs new file mode 100644 index 0000000000000..19a6e857d11d8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyCollection.cs @@ -0,0 +1,498 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspaceConnectionRaiPolicies method from an instance of . + /// + public partial class WorkspaceConnectionRaiPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics; + private readonly ConnectionRaiPolicyRestOperations _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient; + private readonly ClientDiagnostics _workspaceConnectionRaiPolicyConnectionRaiPoliciesClientDiagnostics; + private readonly ConnectionRaiPoliciesRestOperations _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceConnectionRaiPolicyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspaceConnectionRaiPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionRaiPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionRaiPolicyResource.ResourceType, out string workspaceConnectionRaiPolicyConnectionRaiPolicyApiVersion); + _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient = new ConnectionRaiPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionRaiPolicyConnectionRaiPolicyApiVersion); + _workspaceConnectionRaiPolicyConnectionRaiPoliciesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionRaiPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionRaiPolicyResource.ResourceType, out string workspaceConnectionRaiPolicyConnectionRaiPoliciesApiVersion); + _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient = new ConnectionRaiPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionRaiPolicyConnectionRaiPoliciesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceConnectionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceConnectionResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionRaiPolicyOperationSource(Client), _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionRaiPolicyOperationSource(Client), _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.Get"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies + /// + /// + /// Operation Id + /// ConnectionRaiPolicies_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceConnectionRaiPolicyResource(Client, RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(e)), _workspaceConnectionRaiPolicyConnectionRaiPoliciesClientDiagnostics, Pipeline, "WorkspaceConnectionRaiPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies + /// + /// + /// Operation Id + /// ConnectionRaiPolicies_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceConnectionRaiPolicyResource(Client, RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(e)), _workspaceConnectionRaiPolicyConnectionRaiPoliciesClientDiagnostics, Pipeline, "WorkspaceConnectionRaiPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.Serialization.cs new file mode 100644 index 0000000000000..792d7e587363d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class WorkspaceConnectionRaiPolicyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RaiPolicyPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RaiPolicyPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.cs new file mode 100644 index 0000000000000..24573838500d4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a WorkspaceConnectionRaiPolicy along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspaceConnectionRaiPolicyResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspaceConnectionRaiPolicy method. + /// + public partial class WorkspaceConnectionRaiPolicyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The connectionName. + /// The raiPolicyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics; + private readonly ConnectionRaiPolicyRestOperations _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient; + private readonly RaiPolicyPropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/connections/raiPolicies"; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceConnectionRaiPolicyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspaceConnectionRaiPolicyResource(ArmClient client, RaiPolicyPropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspaceConnectionRaiPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspaceConnectionRaiPolicyConnectionRaiPolicyApiVersion); + _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient = new ConnectionRaiPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionRaiPolicyConnectionRaiPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RaiPolicyPropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Get"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Get"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Delete"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Update"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionRaiPolicyOperationSource(Client), _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Update"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionRaiPolicyOperationSource(Client), _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentCollection.cs new file mode 100644 index 0000000000000..f6fd71f1f7b08 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentCollection.cs @@ -0,0 +1,493 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspaceEndpointDeployments method from an instance of . + /// + public partial class WorkspaceEndpointDeploymentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics; + private readonly EndpointDeploymentRestOperations _workspaceEndpointDeploymentEndpointDeploymentRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceEndpointDeploymentCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspaceEndpointDeploymentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceEndpointDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceEndpointDeploymentResource.ResourceType, out string workspaceEndpointDeploymentEndpointDeploymentApiVersion); + _workspaceEndpointDeploymentEndpointDeploymentRestClient = new EndpointDeploymentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointDeploymentEndpointDeploymentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != EndpointResourcePropertiesBasicResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, EndpointResourcePropertiesBasicResource.ResourceType), nameof(id)); + } + + /// + /// Create or update endpoint deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointDeploymentOperationSource(Client), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointDeploymentOperationSource(Client), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.Get"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.Get"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all the deployments under the endpoint resource scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments + /// + /// + /// Operation Id + /// EndpointDeployment_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, "WorkspaceEndpointDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get all the deployments under the endpoint resource scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments + /// + /// + /// Operation Id + /// EndpointDeployment_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, "WorkspaceEndpointDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.Exists"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.Exists"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.Serialization.cs new file mode 100644 index 0000000000000..1594ecc8954dc --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class WorkspaceEndpointDeploymentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EndpointDeploymentResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EndpointDeploymentResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.cs new file mode 100644 index 0000000000000..54b5548216a09 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a WorkspaceEndpointDeployment along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspaceEndpointDeploymentResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspaceEndpointDeployment method. + /// + public partial class WorkspaceEndpointDeploymentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The endpointName. + /// The deploymentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics; + private readonly EndpointDeploymentRestOperations _workspaceEndpointDeploymentEndpointDeploymentRestClient; + private readonly EndpointDeploymentResourcePropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/endpoints/deployments"; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceEndpointDeploymentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspaceEndpointDeploymentResource(ArmClient client, EndpointDeploymentResourcePropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspaceEndpointDeploymentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspaceEndpointDeploymentEndpointDeploymentApiVersion); + _workspaceEndpointDeploymentEndpointDeploymentRestClient = new EndpointDeploymentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointDeploymentEndpointDeploymentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual EndpointDeploymentResourcePropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Get"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Get"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete endpoint deployment resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Delete"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete endpoint deployment resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Delete"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// deployment object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Update"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointDeploymentOperationSource(Client), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// deployment object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Update"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointDeploymentOperationSource(Client), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyCollection.cs new file mode 100644 index 0000000000000..c8f36b19acf43 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyCollection.cs @@ -0,0 +1,498 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspaceEndpointRaiPolicies method from an instance of . + /// + public partial class WorkspaceEndpointRaiPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics; + private readonly RaiPolicyRestOperations _workspaceEndpointRaiPolicyRaiPolicyRestClient; + private readonly ClientDiagnostics _workspaceEndpointRaiPolicyRaiPoliciesClientDiagnostics; + private readonly RaiPoliciesRestOperations _workspaceEndpointRaiPolicyRaiPoliciesRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceEndpointRaiPolicyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspaceEndpointRaiPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceEndpointRaiPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceEndpointRaiPolicyResource.ResourceType, out string workspaceEndpointRaiPolicyRaiPolicyApiVersion); + _workspaceEndpointRaiPolicyRaiPolicyRestClient = new RaiPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointRaiPolicyRaiPolicyApiVersion); + _workspaceEndpointRaiPolicyRaiPoliciesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceEndpointRaiPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceEndpointRaiPolicyResource.ResourceType, out string workspaceEndpointRaiPolicyRaiPoliciesApiVersion); + _workspaceEndpointRaiPolicyRaiPoliciesRestClient = new RaiPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointRaiPolicyRaiPoliciesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != EndpointResourcePropertiesBasicResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, EndpointResourcePropertiesBasicResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointRaiPolicyOperationSource(Client), _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointRaiPolicyOperationSource(Client), _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.Get"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies + /// + /// + /// Operation Id + /// RaiPolicies_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointRaiPolicyRaiPoliciesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointRaiPolicyRaiPoliciesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointRaiPolicyResource(Client, RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(e)), _workspaceEndpointRaiPolicyRaiPoliciesClientDiagnostics, Pipeline, "WorkspaceEndpointRaiPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies + /// + /// + /// Operation Id + /// RaiPolicies_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointRaiPolicyRaiPoliciesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointRaiPolicyRaiPoliciesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointRaiPolicyResource(Client, RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(e)), _workspaceEndpointRaiPolicyRaiPoliciesClientDiagnostics, Pipeline, "WorkspaceEndpointRaiPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.Serialization.cs new file mode 100644 index 0000000000000..5e26b0d44537b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class WorkspaceEndpointRaiPolicyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RaiPolicyPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RaiPolicyPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.cs new file mode 100644 index 0000000000000..3a5d56f221251 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a WorkspaceEndpointRaiPolicy along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspaceEndpointRaiPolicyResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspaceEndpointRaiPolicy method. + /// + public partial class WorkspaceEndpointRaiPolicyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The endpointName. + /// The raiPolicyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics; + private readonly RaiPolicyRestOperations _workspaceEndpointRaiPolicyRaiPolicyRestClient; + private readonly RaiPolicyPropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/endpoints/raiPolicies"; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceEndpointRaiPolicyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspaceEndpointRaiPolicyResource(ArmClient client, RaiPolicyPropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspaceEndpointRaiPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspaceEndpointRaiPolicyRaiPolicyApiVersion); + _workspaceEndpointRaiPolicyRaiPolicyRestClient = new RaiPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointRaiPolicyRaiPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RaiPolicyPropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Get"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Get"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Delete"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Update"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointRaiPolicyOperationSource(Client), _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Update"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointRaiPolicyOperationSource(Client), _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md index f49ad948300d0..3abcab19d879a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md @@ -7,7 +7,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: MachineLearning namespace: Azure.ResourceManager.MachineLearning -require: https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/machinelearningservices/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/edb7904bfead536c7aa9716d44dba15bdabd0b00/specification/machinelearningservices/resource-manager/readme.md #tag: package-preview-2023-06 output-folder: $(this-folder)/Generated clear-output-folder: true @@ -273,7 +273,7 @@ rename-mapping: ProvisioningStatus: MachineLearningComputeProvisioningStatus ScheduleBase: MachineLearningScheduleBase ScheduleStatus: MachineLearningScheduleStatus - TriggerType: MachineLearningTriggerType + ComputeTriggerType: MachineLearningTriggerType RecurrenceTrigger: MachineLearningRecurrenceTrigger ConnectionCategory: MachineLearningConnectionCategory ContainerType: MachineLearningContainerType @@ -518,6 +518,9 @@ rename-mapping: StatusMessageLevel: JobStatusMessageLevel ImageType.azureml: AzureML ProtectionLevel: IntellectualProtectionLevel + OsPatchingStatus.latestPatchTime: -|date-time + OsPatchingStatus.scheduledRebootTime: -|date-time + ServerlessComputeSettings.serverlessComputeNoPublicIP : HasNoPublicIP suppress-abstract-base-class: - MachineLearningJobProperties diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/tests/ModelReaderWriterImplementationValidation.Exception.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/tests/ModelReaderWriterImplementationValidation.Exception.cs index 12d9e3f31b534..99557d8749a57 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/tests/ModelReaderWriterImplementationValidation.Exception.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/tests/ModelReaderWriterImplementationValidation.Exception.cs @@ -18,7 +18,8 @@ public ModelReaderWriterImplementationValidation() "Azure.ResourceManager.MachineLearning.Models.MachineLearningJobCollectionGetAllOptions", "Azure.ResourceManager.MachineLearning.Models.MachineLearningModelVersionCollectionGetAllOptions", "Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineEndpointCollectionGetAllOptions", - "Azure.ResourceManager.MachineLearning.Models.MachineLearningRegistryModelVersionCollectionGetAllOptions" + "Azure.ResourceManager.MachineLearning.Models.MachineLearningRegistryModelVersionCollectionGetAllOptions", + "Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureCollectionGetAllOptions" }; } } From a5445fbaf1ad4952fe4808eb7a885b78b149d1e0 Mon Sep 17 00:00:00 2001 From: Chenyang Liu Date: Thu, 29 Aug 2024 16:15:26 +0800 Subject: [PATCH 50/71] [SocketIO] Add UserId support and update samples (#45725) * Add userId * Add userId and update samples --- .../CHANGELOG.md | 7 +- .../README.md | 16 +- ...ons.WebPubSubForSocketIO.netstandard2.0.cs | 2 + .../samples/SampleDev-JavaScript/README.md | 8 + .../SampleDev-JavaScript/package-lock.json | 432 ++++++++++++++++++ .../samples/SampleDev-JavaScript/package.json | 6 +- .../src/functions/disconnected.ts | 15 + .../src/functions/index.ts | 31 ++ .../src/functions/message.ts | 58 +-- .../src/functions/negotiate.ts | 1 + .../src/public/index.html | 242 ++++++++++ .../samples/SampleDev/Function.cs | 103 ++--- .../samples/SampleDev/SampleDev.csproj | 6 + .../samples/SampleDev/public/index.html | 242 ++++++++++ .../WebPubSubForSocketIOConfigProvider.cs | 2 +- .../Services/WebPubSubForSocketIOService.cs | 11 +- .../src/SocketIONegotiationAttribute.cs | 9 +- .../src/Trigger/SocketIOSocketContext.cs | 8 +- .../WebPubSubForSocketIOTriggerBinding.cs | 21 +- .../WebPubSubForSocketIOTriggerDispatcher.cs | 15 +- .../tests/JobHostEndToEndTests.cs | 32 +- ...tensions.WebPubSubForSocketIO.Tests.csproj | 5 +- .../tests/Samples/SocketIOBindingFunction.cs | 7 +- .../tests/SocketIOServiceTests.cs | 22 +- .../tests/SocketIOTriggerBindingTests.cs | 34 +- 25 files changed, 1129 insertions(+), 206 deletions(-) create mode 100644 sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/README.md create mode 100644 sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/disconnected.ts create mode 100644 sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/index.ts create mode 100644 sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/public/index.html create mode 100644 sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/public/index.html diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md index 1aee1b6ee9c2d..8300de056e43d 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md @@ -4,11 +4,8 @@ ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Add `UserId` parameter in `SocketIONegotiate` attribute to assign user id to sockets +- Add `userId` binding parameter in `SocketIOTrigger` attribute to get user id of sockets. ## 1.0.0-beta.1 (2024-09-01) ### Features Added diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md index b4586bb97c50d..62282acc27886 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md @@ -2,11 +2,11 @@ This extension provides functionality for receiving Web PubSub for Socket.IO webhook calls in Azure Functions, allowing you to easily write functions that respond to any event published to Web PubSub for Socket.IO in serverless mode. -[Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src) | -[Package](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSub) | -[API reference documentation](https://docs.microsoft.com/dotnet/api/microsoft.azure.webjobs.extensions.webpubsub) | +[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO) | +[Package](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO) | +[API reference documentation](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.extensions.webpubsubforsocketio) | [Product documentation](https://learn.microsoft.com/azure/azure-web-pubsub/socketio-overview) | -[Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/samples) +[Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples) ## Getting started @@ -87,7 +87,7 @@ public static class SocketIOBindingFunction [FunctionName("SocketIOInputBinding")] public static IActionResult SocketInputBinding( [HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req, - [SocketIONegotiation(Hub = "hub")] SocketIONegotiationResult result) + [SocketIONegotiation(Hub = "hub", UserId = "uid")] SocketIONegotiationResult result) { return new OkObjectResult(result); } @@ -201,9 +201,9 @@ additional questions or comments. ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fsearch%2FMicrosoft.Azure.WebJobs.Extensions.WebPubSub%2FREADME.png) -[source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src -[package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSub/ -[docs]: https://docs.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.WebPubSub +[source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src +[package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/ +[docs]: https://docs.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO [nuget]: https://www.nuget.org/ [contrib]: https://github.com/Azure/azure-sdk-for-net/tree/main/CONTRIBUTING.md diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/api/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.netstandard2.0.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/api/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.netstandard2.0.cs index a33cfc646bd3b..cdde5b446aa31 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/api/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.netstandard2.0.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/api/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.netstandard2.0.cs @@ -83,6 +83,8 @@ public SocketIONegotiationAttribute() { } public string Connection { get { throw null; } set { } } [Microsoft.Azure.WebJobs.Description.AutoResolveAttribute] public string Hub { get { throw null; } set { } } + [Microsoft.Azure.WebJobs.Description.AutoResolveAttribute] + public string UserId { get { throw null; } set { } } } [Newtonsoft.Json.JsonObjectAttribute(NamingStrategyType=typeof(Newtonsoft.Json.Serialization.CamelCaseNamingStrategy))] public partial class SocketIONegotiationResult diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/README.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/README.md new file mode 100644 index 0000000000000..6ea67531816ce --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/README.md @@ -0,0 +1,8 @@ +# How to run + +```bash +func extensions sync +npm start +``` + +Visit `http://localhost:7084/api/index` to play with the sample. \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package-lock.json b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package-lock.json index 72101b17ae224..38e4b3cfabc4d 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package-lock.json +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package-lock.json @@ -12,6 +12,7 @@ }, "devDependencies": { "@types/node": "^20.x", + "copyfiles": "2.4.1", "rimraf": "^5.0.0", "typescript": "^4.0.0" } @@ -112,6 +113,90 @@ "balanced-match": "^1.0.0" } }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -130,6 +215,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, "node_modules/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", @@ -138,6 +229,74 @@ "node": ">= 0.6" } }, + "node_modules/copyfiles": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", + "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", + "dev": true, + "dependencies": { + "glob": "^7.0.5", + "minimatch": "^3.0.3", + "mkdirp": "^1.0.4", + "noms": "0.0.0", + "through2": "^2.0.1", + "untildify": "^4.0.0", + "yargs": "^16.1.0" + }, + "bin": { + "copyfiles": "copyfiles", + "copyup": "copyfiles" + } + }, + "node_modules/copyfiles/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/copyfiles/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/copyfiles/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -164,6 +323,15 @@ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/foreground-child": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", @@ -180,6 +348,21 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, "node_modules/glob": { "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", @@ -200,6 +383,23 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -209,6 +409,12 @@ "node": ">=8" } }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -265,12 +471,52 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/noms": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", + "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "~1.0.31" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, "node_modules/package-json-from-dist": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", "dev": true }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -296,6 +542,33 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/rimraf": { "version": "5.0.9", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.9.tgz", @@ -314,6 +587,12 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -347,6 +626,12 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "dev": true + }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -443,6 +728,46 @@ "node": ">=8" } }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", @@ -473,6 +798,21 @@ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -578,6 +918,98 @@ "engines": { "node": ">=8" } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package.json b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package.json index afb763d3b4359..b7426489b64ba 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package.json +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package.json @@ -3,7 +3,8 @@ "version": "1.0.0", "description": "", "scripts": { - "build": "tsc", + "copy-public": "copyfiles -a src/public/* dist", + "build": "tsc && npm run copy-public", "watch": "tsc -w", "clean": "rimraf dist", "prestart": "npm run clean && npm run build", @@ -16,7 +17,8 @@ "devDependencies": { "@types/node": "^20.x", "typescript": "^4.0.0", - "rimraf": "^5.0.0" + "rimraf": "^5.0.0", + "copyfiles": "2.4.1" }, "main": "dist/src/{index.js,functions/*.js}" } \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/disconnected.ts b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/disconnected.ts new file mode 100644 index 0000000000000..fdc5a1492e7fb --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/disconnected.ts @@ -0,0 +1,15 @@ +import { app, InvocationContext, trigger } from "@azure/functions"; + +export async function disconnected(request: any, context: InvocationContext): Promise { + context.log(`SocketIO trigger for disconnected`); +} + +// Trigger for disconnected +app.generic('disconnected', { + trigger: trigger.generic({ + type: 'socketiotrigger', + hub: 'hub', + eventName: 'disconnected' + }), + handler: disconnected +}); diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/index.ts b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/index.ts new file mode 100644 index 0000000000000..e6e8dea141cc3 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/index.ts @@ -0,0 +1,31 @@ +import { app, HttpRequest, HttpResponseInit, InvocationContext } from "@azure/functions"; + +const fs = require('fs').promises; +const path = require('path') + +export async function index(request: HttpRequest, context: InvocationContext): Promise { + try { + context.log(`Http function processed request for url "${request.url}"`); + + const filePath = path.join(__dirname,'../public/index.html'); + const html = await fs.readFile(filePath); + return { + body: html, + headers: { + 'Content-Type': 'text/html' + } + }; + } catch (error) { + context.log(error); + return { + status: 500, + jsonBody: error + } + } +}; + +app.http('index', { + methods: ['GET', 'POST'], + authLevel: 'anonymous', + handler: index +}); diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/message.ts b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/message.ts index 1fb60ce29395a..0233db4252ab3 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/message.ts +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/message.ts @@ -5,72 +5,28 @@ const socketio = output.generic({ hub: 'hub', }) -const connStore = new Map(); - -export async function newMessage(request: any, context: InvocationContext): Promise { +export async function chat(request: any, context: InvocationContext): Promise { context.log(`SocketIO trigger for newMessage`); context.extraOutputs.set(socketio, { actionName: 'sendToNamespace', namespace: '/', eventName: 'new message', parameters: [ - { - username: "abc", - message: request.parameters, - } + context.triggerMetadata.userId, + context.triggerMetadata.message ], exceptRooms: [request.socketId], }); } -export async function addUser(request: any, context: InvocationContext): Promise { - context.log(`SocketIO trigger for adduser`); - - context.extraOutputs.set(socketio, [ - { - actionName: 'sendToSocket', - namespace: '/', - socketId: request.socketId, - eventName: 'login', - parameters: [ - { - numUsers: 2, - } - ] - }, - { - actionName: 'sendToNamespace', - namespace: '/', - eventName: 'user joined', - parameters: [ - { - username: "abc", - message: request.parameters, - } - ], - exceptRooms: [request.socketId], - } - ]); -} - // Trigger for new message -app.generic('newMessage', { +app.generic('chat', { trigger: trigger.generic({ type: 'socketiotrigger', hub: 'hub', - eventName: 'new message' + eventName: 'chat', + parameterNames: ['message'], }), extraOutputs: [socketio], - handler: newMessage + handler: chat }); - -// Trigger for add user -app.generic('addUser', { - trigger: trigger.generic({ - type: 'socketiotrigger', - hub: 'hub', - eventName: 'add user' - }), - extraOutputs: [socketio], - handler: addUser -}); \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/negotiate.ts b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/negotiate.ts index df9888652d970..d20ca8bbc3a40 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/negotiate.ts +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/negotiate.ts @@ -5,6 +5,7 @@ const socketIONegotiate = input.generic({ direction: 'in', name: 'result', hub: 'hub', + userId: '{query.userId}' }); export async function negotiate(request: HttpRequest, context: InvocationContext): Promise { diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/public/index.html b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/public/index.html new file mode 100644 index 0000000000000..7e4b05fb40775 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/public/index.html @@ -0,0 +1,242 @@ + + + + + + + + Group Chat + + + + + + + + + + + + diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/Function.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/Function.cs index 901abfbbe79d9..2cae25923e2b7 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/Function.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/Function.cs @@ -1,57 +1,48 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; -using System.IO; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Extensions.Http; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Logging; using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO; -using Microsoft.IdentityModel.Tokens; -using Microsoft.Azure.WebPubSub.Common; using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; -using System.Linq; -using System.Threading; -using System.Collections.Concurrent; +using Microsoft.Extensions.Logging; +using System.IO; +using System.Threading.Tasks; +using ExecutionContext = Microsoft.Azure.WebJobs.ExecutionContext; namespace SampleDev { public static class Function { - private static int _numUsers = 0; - private static ConcurrentDictionary _store = new(); - - [FunctionName("OutboundBinding")] - public static async Task OutboundBinding( - [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req, - [SocketIO(Hub = "hub")] IAsyncCollector operation, - ILogger log) + [FunctionName("index")] + public static IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous)] HttpRequest req, ExecutionContext context, ILogger log) { - log.LogInformation($"C# HTTP trigger function processed a request. {Base64UrlEncoder.Encode("abc")}"); - string userName = Guid.NewGuid().ToString(); - await operation.AddAsync(SocketIOAction.CreateSendToNamespaceAction("new message", new[] { new { username = userName, - message = "Hello" } })); - log.LogInformation("Send to namespace finished."); - return new OkObjectResult("ok"); + var indexFile = Path.Combine(context.FunctionAppDirectory, "public/index.html"); + log.LogInformation($"index.html path: {indexFile}."); + return new ContentResult + { + Content = File.ReadAllText(indexFile), + ContentType = "text/html", + }; } [FunctionName("Negotiate")] - public static async Task SocketIONegotiate( + public static IActionResult SocketIONegotiate( [HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req, - [SocketIONegotiation(Hub = "hub")] SocketIONegotiationResult result) + [SocketIONegotiation(Hub = "hub", UserId = "{query.userId}")] SocketIONegotiationResult result) { return new OkObjectResult(result); } [FunctionName("TriggerBindingForConnect")] - public static async Task TriggerBindingForConnect( + public static SocketIOEventHandlerResponse TriggerBindingForConnect( [SocketIOTrigger("hub", "connect")] SocketIOConnectRequest request, + string userId, ILogger log) { - log.LogInformation("Running trigger for: connect"); + log.LogInformation($"Running trigger for: connect for {userId}"); return new SocketIOConnectResponse(); } @@ -59,71 +50,37 @@ public static async Task TriggerBindingForConnect( public static async Task TriggerBindingForConnected( [SocketIOTrigger("hub", "connected")] SocketIOConnectedRequest request, [SocketIO(Hub = "hub")] IAsyncCollector collector, + string userId, ILogger log) { log.LogInformation("Running trigger for: connected"); - if (_store.TryAdd(request.SocketId, new SocketContext())) - { - Interlocked.Increment(ref _numUsers); - } + await collector.AddAsync(SocketIOAction.CreateSendToNamespaceAction("new message", new[] { "system", $"{userId} connected" })); } [FunctionName("TriggerBindingForDisconnected")] public static async Task TriggerBindingForDisconnected( [SocketIOTrigger("hub", "disconnected")] SocketIODisconnectedRequest request, [SocketIO(Hub = "hub")] IAsyncCollector collector, + string userId, ILogger log) { log.LogInformation("Running trigger for: disconnected"); - if (_store.TryRemove(request.SocketId, out var context)) - { - await collector.AddAsync(SocketIOAction.CreateSendToNamespaceAction("user left", new[] { new { username = context.UserName, numUsers = Interlocked.Decrement(ref _numUsers)} }, new[] {request.SocketId})); - } + await collector.AddAsync(SocketIOAction.CreateSendToNamespaceAction("new message", new[] { "system", $"{userId} disconnected" })); } - [FunctionName("TriggerBindingForNewMessage")] - public static async Task TriggerBindingForNewMessage( - [SocketIOTrigger("hub", "new message")] SocketIOMessageRequest request, + [FunctionName("TriggerBindingForChat")] + public static async Task TriggerBindingForChat( + [SocketIOTrigger("hub", "chat")] SocketIOMessageRequest request, [SocketIO(Hub = "hub")] IAsyncCollector collector, + SocketIOSocketContext connectionContext, + [SocketIOParameter] string message, ILogger log) { log.LogInformation("Running trigger for: new message"); log.LogInformation($"Arguments: {string.Join(';', request.Parameters)}"); - if (_store.TryGetValue(request.SocketId, out var context)) - { - await collector.AddAsync(SocketIOAction.CreateSendToNamespaceAction("new message", new[] { new { username = context.UserName, message = request.Parameters } }, new[] { request.SocketId })); - } - } - - [FunctionName("TriggerBindingForAddUser")] - public static async Task TriggerBindingForAddUser( - [SocketIOTrigger("hub", "add user")] SocketIOMessageRequest request, - [SocketIO(Hub = "hub")] IAsyncCollector collector, - ILogger log) - { - log.LogInformation("Running trigger for: add user"); - log.LogInformation($"Arguments: {string.Join(';', request.Parameters)}"); - - var userName = request.Parameters[0].ToString(); - if (_store.TryGetValue(request.SocketId, out var context)) - { - if (context.AddedUser) - { - return; - } - context.AddedUser = true; - context.UserName = userName; - - await collector.AddAsync(SocketIOAction.CreateSendToSocketAction(request.SocketId, "login", new[] { new { numUsers = _numUsers } })); - await collector.AddAsync(SocketIOAction.CreateSendToNamespaceAction("user joined", new[] { new { username = userName, numUsers = _numUsers } }, new[] { request.SocketId })); - } - } - - private class SocketContext - { - public bool AddedUser { get; set; } - public string UserName { get; set; } + var userId = connectionContext.UserId; + await collector.AddAsync(SocketIOAction.CreateSendToNamespaceAction("new message", new[] { userId, message }, new[] { request.SocketId })); } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/SampleDev.csproj b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/SampleDev.csproj index 801736ac75144..c5524b071645c 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/SampleDev.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/SampleDev.csproj @@ -19,5 +19,11 @@ PreserveNewest Never + + Always + + + + diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/public/index.html b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/public/index.html new file mode 100644 index 0000000000000..7e4b05fb40775 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/public/index.html @@ -0,0 +1,242 @@ + + + + + + + + Group Chat + + + + + + + + + + + + diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Config/WebPubSubForSocketIOConfigProvider.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Config/WebPubSubForSocketIOConfigProvider.cs index 492e732c85544..a1aa026920390 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Config/WebPubSubForSocketIOConfigProvider.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Config/WebPubSubForSocketIOConfigProvider.cs @@ -188,7 +188,7 @@ private IAsyncCollector CreateCollector(SocketIOAttribute attrib private SocketIONegotiationResult GetNegotiationResult(SocketIONegotiationAttribute attribute) { var service = GetService(attribute.Connection, attribute.Hub); - return service.GetNegotiationResult(); + return service.GetNegotiationResult(attribute.UserId); } private void ValidateConnectionString(string attributeConnectionString, string attributeConnectionStringName) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Services/WebPubSubForSocketIOService.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Services/WebPubSubForSocketIOService.cs index b57b57377afea..333e5828bfc2e 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Services/WebPubSubForSocketIOService.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Services/WebPubSubForSocketIOService.cs @@ -41,12 +41,12 @@ public WebPubSubForSocketIOService(WebPubSubServiceClient client) public WebPubSubServiceClient Client => _client; - internal SocketIONegotiationResult GetNegotiationResult() + internal SocketIONegotiationResult GetNegotiationResult(string userId) { if (_useConnectionStrings) { var expireAfter = TimeSpan.FromHours(1); - var token = GenerateTokenFromAzureKeyCredential(DateTimeOffset.UtcNow.Add(expireAfter)); + var token = GenerateTokenFromAzureKeyCredential(userId, DateTimeOffset.UtcNow.Add(expireAfter)); return new SocketIONegotiationResult(new Uri($"{_endpoint}clients/socketio/hubs/{_hub}?access_token={token}")); } else @@ -57,7 +57,7 @@ internal SocketIONegotiationResult GetNegotiationResult() } } - private string GenerateTokenFromAzureKeyCredential(DateTimeOffset expiresAt) + private string GenerateTokenFromAzureKeyCredential(string userId, DateTimeOffset expiresAt) { var keyBytes = Encoding.UTF8.GetBytes(_keyCredential.Key); @@ -76,6 +76,11 @@ private string GenerateTokenFromAzureKeyCredential(DateTimeOffset expiresAt) jwt.AddClaim(JwtBuilder.Iat, now); jwt.AddClaim(JwtBuilder.Aud, audience); + if (!string.IsNullOrEmpty(userId)) + { + jwt.AddClaim(JwtBuilder.Sub, userId); + } + return jwt.BuildString(); } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/SocketIONegotiationAttribute.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/SocketIONegotiationAttribute.cs index c39bc5fed73e0..86d1f7a655078 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/SocketIONegotiationAttribute.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/SocketIONegotiationAttribute.cs @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; - using Microsoft.Azure.WebJobs.Description; +using System; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO { @@ -24,5 +23,11 @@ public class SocketIONegotiationAttribute : Attribute /// [AutoResolve] public string Hub { get; set; } + + /// + /// The user id of the connection. It will be available for all sockets sharing the same connection. + /// + [AutoResolve] + public string UserId { get; set; } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/SocketIOSocketContext.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/SocketIOSocketContext.cs index 1b4861104b538..7948877a40054 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/SocketIOSocketContext.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/SocketIOSocketContext.cs @@ -2,9 +2,7 @@ // Licensed under the MIT License. using Microsoft.Azure.WebPubSub.Common; -using System; using System.Collections.Generic; -using System.Text; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO { @@ -23,14 +21,10 @@ public class SocketIOSocketContext : WebPubSubConnectionContext /// public string Namespace { get; } - private new string UserId { get; } - - private new IReadOnlyDictionary States { get; } - /// /// Initializes a new instance of the SocketIOSocketContext class. /// - internal SocketIOSocketContext(WebPubSubEventType eventType, string eventName, string hub, string connectionId, string ns, string socketId, string signature, string origin, IReadOnlyDictionary headers) : base(eventType, eventName, hub, connectionId, null, signature, origin, (IReadOnlyDictionary)null, headers) + internal SocketIOSocketContext(WebPubSubEventType eventType, string eventName, string hub, string connectionId, string userId, string ns, string socketId, string signature, string origin, IReadOnlyDictionary headers) : base(eventType, eventName, hub, connectionId, userId, signature, origin, (IReadOnlyDictionary)null, headers) { SocketId = socketId; Namespace = ns; diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerBinding.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerBinding.cs index edd3f1453d725..312ab5af0e9cb 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerBinding.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerBinding.cs @@ -1,9 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; +using Microsoft.Azure.WebJobs.Host.Bindings; +using Microsoft.Azure.WebJobs.Host.Listeners; +using Microsoft.Azure.WebJobs.Host.Protocols; +using Microsoft.Azure.WebJobs.Host.Triggers; +using Microsoft.Azure.WebPubSub.Common; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; -using System.Data.Common; using System.Globalization; using System.IO; using System.Linq; @@ -11,13 +17,6 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; -using Microsoft.Azure.WebJobs.Host.Bindings; -using Microsoft.Azure.WebJobs.Host.Listeners; -using Microsoft.Azure.WebJobs.Host.Protocols; -using Microsoft.Azure.WebJobs.Host.Triggers; -using Microsoft.Azure.WebPubSub.Common; -using Newtonsoft.Json.Linq; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO { @@ -33,6 +32,7 @@ internal class WebPubSubForSocketIOTriggerBinding : ITriggerBinding internal const string ClientCertificatesBindingName = "ClientCertificates"; internal const string SocketIdBindingName = "SocketId"; internal const string NamespaceBindingName = "Namespace"; + internal const string UserIdName = "UserId"; private readonly ParameterInfo _parameterInfo; private readonly SocketIOTriggerAttribute _attribute; @@ -120,6 +120,10 @@ private static void AddBindingData(Dictionary bindingData, Socke bindingData.Add(ConnectionContextBindingName, triggerEvent.ConnectionContext); bindingData.Add(SocketIdBindingName, triggerEvent.Request.SocketId); bindingData.Add(NamespaceBindingName, triggerEvent.Request.Namespace); + if (!string.IsNullOrEmpty(triggerEvent.ConnectionContext.UserId)) + { + bindingData.Add(UserIdName, triggerEvent.ConnectionContext.UserId); + } if (triggerEvent.Request is SocketIOConnectRequest connectEventRequest) { @@ -192,6 +196,7 @@ private static IReadOnlyDictionary CreateBindingContract(SocketIOT SafeAddContract(() => contract.Add(ClientCertificatesBindingName, typeof(WebPubSubClientCertificate[]))); SafeAddContract(() => contract.Add(SocketIdBindingName, typeof(string))); SafeAddContract(() => contract.Add(NamespaceBindingName, typeof(string))); + SafeAddContract(() => contract.Add(UserIdName, typeof(string))); return contract; } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerDispatcher.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerDispatcher.cs index 1ff7eab11b1a5..eb33fe631d3a7 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerDispatcher.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerDispatcher.cs @@ -1,6 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; +using Microsoft.Azure.WebJobs.Host.Executors; +using Microsoft.Azure.WebPubSub.Common; +using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.IO; @@ -10,10 +14,6 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; -using Microsoft.Azure.WebJobs.Host.Executors; -using Microsoft.Azure.WebPubSub.Common; -using Microsoft.Extensions.Logging; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO { @@ -196,12 +196,17 @@ private static (bool Success, string Error) TryParseCloudEvents(HttpRequestMessa { signature = string.Join(",", val); } + string? userId = null; + if (request.Headers.TryGetValues(Constants.Headers.CloudEvents.UserId, out var userIds)) + { + userId = userIds.FirstOrDefault(); + } string @namespace = request.Headers.GetValues(Constants.Headers.CloudEvents.Namespace).Single(); ThrowIfEmptyHeader(@namespace, Constants.Headers.CloudEvents.Namespace); string socketId = request.Headers.GetValues(Constants.Headers.CloudEvents.SocketId).Single(); ThrowIfEmptyHeader(socketId, Constants.Headers.CloudEvents.SocketId); - context = new SocketIOSocketContext(eventType, eventName, hub, connectionId, @namespace, socketId, signature, origin, headers); + context = new SocketIOSocketContext(eventType, eventName, hub, connectionId, userId, @namespace, socketId, signature, origin, headers); return (true, null); } catch (Exception ex) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/JobHostEndToEndTests.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/JobHostEndToEndTests.cs index 574d58baca3f8..b191ff9c7d204 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/JobHostEndToEndTests.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/JobHostEndToEndTests.cs @@ -1,15 +1,15 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; using Microsoft.Azure.WebJobs.Host; -using Microsoft.Azure.WebJobs.Host.Indexers; using Microsoft.Azure.WebPubSub.Common; using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.IdentityModel.Tokens.Jwt; +using System.Threading.Tasks; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests { @@ -117,12 +117,13 @@ public void TestSocketIOTrigger_InvalidParam() Assert.AreEqual("Exception while executing function: SocketIOFuncs.TestSocketIOTriggerWith3Param", exception.Message); } - [TestCase] - public async Task TestSocketIOInputBinding() + [TestCase("SocketIOFuncs.TestSocketIOInputConnection")] + [TestCase("SocketIOFuncs.TestSocketIOInputConnectionWithUserId")] + public async Task TestSocketIOInputBinding(string function) { var host = TestHelpers.NewHost(typeof(SocketIOFuncs), configuration: KeyBasedConfiguration); - await host.GetJobHost().CallAsync("SocketIOFuncs.TestSocketIOInputConnection"); + await host.GetJobHost().CallAsync(function); } [TestCase] @@ -173,7 +174,7 @@ private static SocketIOTriggerEvent CreateTestMessageTriggerEvent() private static SocketIOSocketContext CreateConnectionContext() { - return new SocketIOSocketContext(WebPubSubEventType.User, "message", "testhub", "000000", "/ns", "sid", "sig", "origin", null); + return new SocketIOSocketContext(WebPubSubEventType.User, "message", "testhub", "000000", "uid", "/ns", "sid", "sig", "origin", null); } private sealed class SocketIOFuncs @@ -184,10 +185,11 @@ public static void TestSocketIOTrigger( { // Valid case use default url for verification. Assert.AreEqual(TestContext, connectionContext); + Assert.AreEqual("uid", connectionContext.UserId); } public static void TestSocketIOTriggerWith2Param( - [SocketIOTrigger("chat", "msgEvent", parameterNames: new[] {"arg1", "arg2"})] SocketIOMessageRequest request, + [SocketIOTrigger("chat", "msgEvent", parameterNames: new[] { "arg1", "arg2" })] SocketIOMessageRequest request, SocketIOSocketContext connectionContext, string arg1, string arg2) @@ -197,6 +199,7 @@ public static void TestSocketIOTriggerWith2Param( Assert.AreEqual("msgEvent", request.EventName); Assert.AreEqual("d1", arg1); Assert.AreEqual("d2", arg2); + Assert.AreEqual("uid", connectionContext.UserId); } public static void TestSocketIOTriggerWith3Param( @@ -211,6 +214,7 @@ public static void TestSocketIOTriggerWith3Param( Assert.AreEqual("msgEvent", request.EventName); Assert.AreEqual("d1", arg1); Assert.AreEqual("d2", arg2); + Assert.AreEqual("uid", connectionContext.UserId); } public static void TestSocketIOTriggerWith2ParamAndParameterAttr( @@ -224,6 +228,7 @@ public static void TestSocketIOTriggerWith2ParamAndParameterAttr( Assert.AreEqual("msgEvent", request.EventName); Assert.AreEqual("d1", arg2); Assert.AreEqual("d2", arg1); + Assert.AreEqual("uid", connectionContext.UserId); } public static void TestSocketIOTriggerInvalid( @@ -238,6 +243,15 @@ public static void TestSocketIOInputConnection( Assert.AreEqual("https://abc/", connection.Endpoint.AbsoluteUri); } + public static void TestSocketIOInputConnectionWithUserId( + [SocketIONegotiation(Hub = "chat", UserId = "uid")] SocketIONegotiationResult connection) + { + // Valid case use default url for verification. + Assert.AreEqual("https://abc/", connection.Endpoint.AbsoluteUri); + var jwt = new JwtSecurityTokenHandler().ReadJwtToken(connection.Token); + Assert.AreEqual("uid", jwt.Subject); + } + public static async Task TestSocketIOOutput( [SocketIO(Hub = "chat")] IAsyncCollector operation) { diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests.csproj b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests.csproj index b0594b499373f..8c2e266f6b56a 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests.csproj @@ -10,10 +10,6 @@ - - - - @@ -24,6 +20,7 @@ + diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Samples/SocketIOBindingFunction.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Samples/SocketIOBindingFunction.cs index 4f1b019fe55f6..f98edc4d84ed4 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Samples/SocketIOBindingFunction.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Samples/SocketIOBindingFunction.cs @@ -4,11 +4,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.WebJobs.Extensions.Http; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests.Samples { @@ -18,7 +13,7 @@ public static class SocketIOBindingFunction [FunctionName("SocketIOInputBinding")] public static IActionResult SocketInputBinding( [HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req, - [SocketIONegotiation(Hub = "hub")] SocketIONegotiationResult result) + [SocketIONegotiation(Hub = "hub", UserId = "uid")] SocketIONegotiationResult result) { return new OkObjectResult(result); } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOServiceTests.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOServiceTests.cs index 7a0d5452cb994..5f2cbde9c4b30 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOServiceTests.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOServiceTests.cs @@ -1,10 +1,10 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -using Azure.Core; using Azure.Identity; using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Config; using NUnit.Framework; +using System.IdentityModel.Tokens.Jwt; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests { @@ -13,9 +13,10 @@ public class SocketIOServiceTests private const string NormConnectionString = "Endpoint=http://localhost;Port=8080;AccessKey=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGH;Version=1.0;"; private const string SecConnectionString = "Endpoint=https://abc;AccessKey=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGH;Version=1.0;"; - [TestCase(NormConnectionString, "http://localhost:8080/", "/clients/socketio/hubs/testHub")] - [TestCase(SecConnectionString, "https://abc/", "/clients/socketio/hubs/testHub")] - public void TestWebPubSubConnection_Scheme(string connectionString, string expectedEndpoint, string expectedPath) + [TestCase(NormConnectionString, "http://localhost:8080/", "/clients/socketio/hubs/testHub", null)] + [TestCase(NormConnectionString, "http://localhost:8080/", "/clients/socketio/hubs/testHub", "uid")] + [TestCase(SecConnectionString, "https://abc/", "/clients/socketio/hubs/testHub", "uid")] + public void TestWebPubSubConnection_Scheme(string connectionString, string expectedEndpoint, string expectedPath, string userId) { var connectionInfo = new SocketIOConnectionInfo(connectionString); @@ -26,12 +27,23 @@ public void TestWebPubSubConnection_Scheme(string connectionString, string expec var service = new WebPubSubForSocketIOService(connectionInfo.Endpoint, connectionInfo.KeyCredential, "testHub"); - var clientConnection = service.GetNegotiationResult(); + var clientConnection = service.GetNegotiationResult(userId); Assert.NotNull(clientConnection); Assert.AreEqual(expectedEndpoint, clientConnection.Endpoint.AbsoluteUri); Assert.AreEqual(expectedPath, clientConnection.Path); Assert.NotNull(clientConnection.Token); + + var jwt = new JwtSecurityTokenHandler().ReadJwtToken(clientConnection.Token); + + if (string.IsNullOrEmpty(userId)) + { + Assert.IsNull(jwt.Subject); + } + else + { + Assert.AreEqual(userId, jwt.Subject); + } } [TestCase] diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOTriggerBindingTests.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOTriggerBindingTests.cs index 968c5de03fc7e..413f7af3c9e02 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOTriggerBindingTests.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOTriggerBindingTests.cs @@ -1,12 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Threading; -using System.Threading.Tasks; using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; using Microsoft.Azure.WebJobs.Host.Triggers; using Microsoft.Azure.WebPubSub.Common; @@ -14,6 +8,12 @@ using Moq; using Newtonsoft.Json.Linq; using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; using static Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.WebPubSubForSocketIOTriggerBinding; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests @@ -36,7 +36,7 @@ public SocketIOTriggerBindingTests() _provider = new WebPubSubForSocketIOTriggerBindingProvider(mockDispater.Object, resolver, config, null); } - public static void ConnectObj([SocketIOTrigger("testchat","connect")] JObject req) { } + public static void ConnectObj([SocketIOTrigger("testchat", "connect")] JObject req) { } public static void Connect([SocketIOTrigger("testchat", "connect")] SocketIOConnectRequest req, string @namespace, @@ -45,7 +45,7 @@ public static void Connect([SocketIOTrigger("testchat", "connect")] SocketIOConn IDictionary query, IDictionary headers, WebPubSubClientCertificate[] clinetCertificates) - {} + { } public static void ConnectedObj([SocketIOTrigger("testchat", "connected")] JObject req) { } @@ -61,13 +61,13 @@ public static void Disconnect([SocketIOTrigger("testchat", "disconnected")] Sock string @namespace, string socketId, string reason) - {} + { } public static void MessageObj([SocketIOTrigger("testchat", "target")] JObject req) { } public static void Message([SocketIOTrigger("testchat", "target")] SocketIOMessageRequest req, - [SocketIOParameter]string paramKey1, - [SocketIOParameter]int paramKey2) + [SocketIOParameter] string paramKey1, + [SocketIOParameter] int paramKey2) { } [TestCase] @@ -79,7 +79,7 @@ public async Task TriggerConnectEventTest() var triggerEvent = new SocketIOTriggerEvent { - ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.System, "connect", "testchat", "conn1", "ns", "sid", "signature", "origin", null), + ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.System, "connect", "testchat", "conn1", "uid", "ns", "sid", "signature", "origin", null), Request = new SocketIOConnectRequest( "ns", "sid", @@ -118,7 +118,7 @@ public async Task TriggerConnectedEventTest() var triggerEvent = new SocketIOTriggerEvent { - ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.System, "connected", "testchat", "conn1", "ns", "sid", "signature", "origin", null), + ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.System, "connected", "testchat", "conn1", "uid", "ns", "sid", "signature", "origin", null), Request = new SocketIOConnectedRequest("ns", "sid") }; @@ -146,7 +146,7 @@ public async Task TriggerDisconnectEventTest() var triggerEvent = new SocketIOTriggerEvent { - ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.System, "disconnect", "testchat", "conn1", "ns", "sid", "signature", "origin", null), + ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.System, "disconnect", "testchat", "conn1", "uid", "ns", "sid", "signature", "origin", null), Request = new SocketIODisconnectedRequest("ns", "sid", "reason") }; @@ -175,7 +175,7 @@ public async Task TriggerMessageEventTest() var triggerEvent = new SocketIOTriggerEvent { - ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.User, "target", "testchat", "conn1", "ns", "sid", "signature", "origin", null), + ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.User, "target", "testchat", "conn1", "uid", "ns", "sid", "signature", "origin", null), Request = new SocketIOMessageRequest("ns", "sid", "payload", "ev", new object[] { "param1", 2 }) }; @@ -244,7 +244,7 @@ private static ParameterInfo GetParameterOrFirst(Type type, string methodName, s private static SocketIOTriggerEvent NewTestEvent() { - var sioContext = new SocketIOSocketContext(WebPubSubEventType.User, "message", "testhub", "conn1", "ns", "sid", "signature", "origin", null); + var sioContext = new SocketIOSocketContext(WebPubSubEventType.User, "message", "testhub", "conn1", "uid", "ns", "sid", "signature", "origin", null); return new SocketIOTriggerEvent { ConnectionContext = sioContext, @@ -253,7 +253,7 @@ private static SocketIOTriggerEvent NewTestEvent() "socketId", "payload", "ev", - new[] { "arg1", "arg2"}), + new[] { "arg1", "arg2" }), }; } } From f976af8f76e0b1d7060750f628a95e4ba47cc167 Mon Sep 17 00:00:00 2001 From: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> Date: Thu, 29 Aug 2024 09:45:39 -0400 Subject: [PATCH 51/71] JsonPatchDocument docs fix (#45717) --- sdk/core/Azure.Core/src/JsonPatchDocument.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/Azure.Core/src/JsonPatchDocument.cs b/sdk/core/Azure.Core/src/JsonPatchDocument.cs index b3961675aef99..e1728aa957d5e 100644 --- a/sdk/core/Azure.Core/src/JsonPatchDocument.cs +++ b/sdk/core/Azure.Core/src/JsonPatchDocument.cs @@ -58,7 +58,7 @@ public JsonPatchDocument(ReadOnlyMemory rawDocument, ObjectSerializer seri } /// - /// Initializes a new instance of using an existing UTF8-encoded JSON Patch document. + /// Appends an "add" operation to this . /// /// The path to apply the addition to. /// The raw JSON value to add to the path. From c16e267c898ffc008c3fd0efdac9f57e2db5db7b Mon Sep 17 00:00:00 2001 From: Scott Addie <10702007+scottaddie@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:01:04 -0500 Subject: [PATCH 52/71] Link to conceptual doc in interactive browser broker cred options bag (#45711) --- .../src/InteractiveBrowserCredentialBrokerOptions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/identity/Azure.Identity.Broker/src/InteractiveBrowserCredentialBrokerOptions.cs b/sdk/identity/Azure.Identity.Broker/src/InteractiveBrowserCredentialBrokerOptions.cs index 1e37fa9de0e53..4114d7d0233b1 100644 --- a/sdk/identity/Azure.Identity.Broker/src/InteractiveBrowserCredentialBrokerOptions.cs +++ b/sdk/identity/Azure.Identity.Broker/src/InteractiveBrowserCredentialBrokerOptions.cs @@ -9,6 +9,7 @@ namespace Azure.Identity.Broker { /// /// Options to configure the to use the system authentication broker in lieu of an embedded web view or the system browser. + /// For more information, see Interactive brokered authentication. /// public class InteractiveBrowserCredentialBrokerOptions : InteractiveBrowserCredentialOptions, IMsalPublicClientInitializerOptions { @@ -17,7 +18,6 @@ public class InteractiveBrowserCredentialBrokerOptions : InteractiveBrowserCrede /// /// Gets or sets whether Microsoft Account (MSA) passthrough is enabled. /// - /// public bool? IsLegacyMsaPassthroughEnabled { get; set; } /// From 1bf3d7ece86f7e71644b6e6e74a0eca619bebd28 Mon Sep 17 00:00:00 2001 From: Scott Addie <10702007+scottaddie@users.noreply.github.com> Date: Thu, 29 Aug 2024 11:48:48 -0500 Subject: [PATCH 53/71] Update protocol methods doc with link to replacement Learn doc (#45659) --- .../Azure.Core/samples/ProtocolMethods.md | 130 +----------------- 1 file changed, 1 insertion(+), 129 deletions(-) diff --git a/sdk/core/Azure.Core/samples/ProtocolMethods.md b/sdk/core/Azure.Core/samples/ProtocolMethods.md index 633023823d582..25a361f3af6f1 100644 --- a/sdk/core/Azure.Core/samples/ProtocolMethods.md +++ b/sdk/core/Azure.Core/samples/ProtocolMethods.md @@ -1,131 +1,3 @@ # C# Azure SDK Clients that Contain Protocol Methods -## Introduction - -Azure SDK clients provide an interface to Azure services by translating library calls to REST requests. - -In Azure SDK clients, there are two ways to expose the schematized body in the request or response, known as the `message body`: - -- Most Azure SDK Clients expose methods that take ['model types'](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-model-types) as parameters, C# classes which map to the `message body` of the REST call. Those methods can be called here '**convenience methods**'. - -- However, some clients expose methods that mirror the message body directly. Those methods are called here '**protocol methods**', as they provide more direct access to the REST protocol used by the client library. - -### Pet's Example - -To compare the two approaches, imagine a service that stores information about pets, with a pair of `GetPet` and `SetPet` operations. - -Pets are represented in the message body as a JSON object: - -```json -{ - "name": "snoopy", - "species": "beagle" -} -``` - -An API using model types could be: - -```csharp -// This is an example model class -public class Pet -{ - string Name { get; } - string Species { get; } -} - -Response GetPet(string dogName); -Response SetPet(Pet dog); -``` - -While the protocol methods version would be: - -```csharp -// Request: "id" in the context path, like "/pets/{id}" -// Response: { -// "name": "snoopy", -// "species": "beagle" -// } -Response GetPet(string id, RequestContext context = null) -// Request: { -// "name": "snoopy", -// "species": "beagle" -// } -// Response: { -// "name": "snoopy", -// "species": "beagle" -// } -Response SetPet(RequestContent requestBody, RequestContext context = null); -``` - -**[Note]**: This document is a general quickstart in using SDK Clients that expose '**protocol methods**'. - -## Usage - -The basic structure of calling protocol methods remains the same as that of convenience methods: - -1. [Initialize Your Client](#1-initialize-your-client "Initialize Your Client") - -2. [Create and Send a request](#2-create-and-send-a-request "Create and Send a Request") - -3. [Handle the Response](#3-handle-the-response "Handle the Response") - -### 1. Initialize Your Client - -The first step in interacting with a service via protocol methods is to create a client instance. - -```csharp -using System; -using Azure.Pets; -using Azure.Core; -using Azure.Identity; - -const string endpoint = "http://localhost:3000"; -var credential = new AzureKeyCredential(/*SERVICE-API-KEY*/); -var client = new PetStoreClient(new Uri(endpoint), credential, new PetStoreClientOptions()); -``` - -### 2. Create and Send a Request - -Protocol methods need a JSON object of the shape required by the schema of the service. - -See the specific service documentation for details, but as an example: - -```csharp -// anonymous class is serialized by System.Text.Json using runtime reflection -var data = new { - name = "snoopy", - species = "beagle" -}; -/* -{ - "name": "snoopy", - "species": "beagle" -} -*/ -client.SetPet(RequestContent.Create(data)); -``` - -### 3. Handle the Response - -Protocol methods all return a `Response` object that contains information returned from the service request. - -The most important field on Response contains the REST content returned from the service: - -```C# Snippet:GetPetAsync -Response response = await client.GetPetAsync("snoopy", new RequestContext()); - -var doc = JsonDocument.Parse(response.Content.ToMemory()); -var name = doc.RootElement.GetProperty("name").GetString(); -``` - -JSON properties can also be accessed using a dynamic layer. - -```C# Snippet:AzureCoreGetDynamicJsonProperty -Response response = client.GetWidget(); -dynamic widget = response.Content.ToDynamicFromJson(); -string name = widget.name; -``` - -## Configuration And Customization - -**Protocol methods** share the same configuration and customization as **convenience methods**. For details, see the [ReadMe](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md). You can find more samples [here](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/README.md). +This guidance has moved to [Azure SDK for .NET protocol and convenience methods overview](https://learn.microsoft.com/dotnet/azure/sdk/protocol-convenience-methods). From e866f48edd122874367477d2db88a5019ed90925 Mon Sep 17 00:00:00 2001 From: wiboris <54044985+wiboris@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:44:10 -0700 Subject: [PATCH 54/71] enabling the batch data pipeline (#45683) --- eng/service.proj | 2 -- sdk/batch/ci.data.yml | 10 +--------- sdk/batch/service.projects | 2 +- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/eng/service.proj b/eng/service.proj index bc473731f3f12..7fcd0b393c0e8 100644 --- a/eng/service.proj +++ b/eng/service.proj @@ -15,8 +15,6 @@ - - diff --git a/sdk/batch/ci.data.yml b/sdk/batch/ci.data.yml index 881610e1be241..195b0056a758d 100644 --- a/sdk/batch/ci.data.yml +++ b/sdk/batch/ci.data.yml @@ -11,8 +11,6 @@ trigger: - sdk/batch/ci.data.yml - sdk/batch/service.projects - sdk/batch/Microsoft.Azure.Batch - - sdk/batch/MicrosoftAzureBatchFileStaging - - sdk/batch/Microsoft.Azure.Batch.Conventions.Files exclude: - sdk/batch/Azure.ResourceManager.Batch/ @@ -28,8 +26,6 @@ pr: - sdk/batch/ci.data.yml - sdk/batch/service.projects - sdk/batch/Microsoft.Azure.Batch - - sdk/batch/MicrosoftAzureBatchFileStaging - - sdk/batch/Microsoft.Azure.Batch.Conventions.Files exclude: - sdk/batch/Azure.ResourceManager.Batch/ @@ -42,8 +38,4 @@ extends: BuildSnippets: false Artifacts: - name: Microsoft.Azure.Batch - safeName: MicrosoftAzureBatch - - name: Microsoft.Azure.Batch.FileStaging - safeName: MicrosoftAzureBatchFileStaging - - name: Microsoft.Azure.Batch.Conventions.Files - safeName: MicrosoftAzureBatchConventionsFiles + safeName: MicrosoftAzureBatch \ No newline at end of file diff --git a/sdk/batch/service.projects b/sdk/batch/service.projects index 4dab13fedd216..519aced9b150b 100644 --- a/sdk/batch/service.projects +++ b/sdk/batch/service.projects @@ -20,7 +20,7 @@ - + From a133d479b8f5757bab6863f36cee012faf21f461 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:44:45 -0700 Subject: [PATCH 55/71] Sync eng/common directory with azure-sdk-tools for PR 8900 (#45733) * Add save-package-properties yaml * Encapsulate Save-Package-Properties.ps1 invocation into yaml * Fix output formatting * Fix code style --------- Co-authored-by: Patrick Hallisey --- .../steps/save-package-properties.yml | 46 +++++++++++++++ eng/common/scripts/Generate-PR-Diff.ps1 | 36 +++++++----- .../scripts/Save-Package-Properties.ps1 | 58 ++++++++++++------- 3 files changed, 104 insertions(+), 36 deletions(-) create mode 100644 eng/common/pipelines/templates/steps/save-package-properties.yml diff --git a/eng/common/pipelines/templates/steps/save-package-properties.yml b/eng/common/pipelines/templates/steps/save-package-properties.yml new file mode 100644 index 0000000000000..7560f69e3213e --- /dev/null +++ b/eng/common/pipelines/templates/steps/save-package-properties.yml @@ -0,0 +1,46 @@ +parameters: + - name: ServiceDirectory + type: string + default: "" + - name: DiffDirectory + type: string + default: $(Build.ArtifactStagingDirectory)/diff + - name: PackageInfoDirectory + type: string + default: $(Build.ArtifactStagingDirectory)/PackageInfo + - name: TargetPath + type: string + default: $(Build.SourcesDirectory) + - name: ScriptDirectory + type: string + default: eng/common/scripts + +steps: + - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + - task: Powershell@2 + displayName: Generate PR Diff + inputs: + filePath: ${{ parameters.ScriptDirectory }}/Generate-PR-Diff.ps1 + arguments: > + -TargetPath '${{ parameters.TargetPath }}' + -ArtifactPath '${{ parameters.DiffDirectory }}' + pwsh: true + + - task: Powershell@2 + displayName: Save package properties filtered for PR + inputs: + filePath: ${{ parameters.ScriptDirectory }}/Save-Package-Properties.ps1 + arguments: > + -PrDiff ${{ parameters.DiffDirectory }}/diff.json + -OutDirectory ${{ parameters.PackageInfoDirectory }} + pwsh: true + - ${{ else }}: + - task: Powershell@2 + displayName: Save package properties + inputs: + filePath: ${{ parameters.ScriptDirectory }}/Save-Package-Properties.ps1 + arguments: > + -ServiceDirectory ${{parameters.ServiceDirectory}} + -OutDirectory ${{ parameters.PackageInfoDirectory }} + -AddDevVersion:$${{ eq(variables['SetDevVersion'],'true') }} + pwsh: true diff --git a/eng/common/scripts/Generate-PR-Diff.ps1 b/eng/common/scripts/Generate-PR-Diff.ps1 index 7a31456b36ca8..3b508b1cb9942 100644 --- a/eng/common/scripts/Generate-PR-Diff.ps1 +++ b/eng/common/scripts/Generate-PR-Diff.ps1 @@ -13,27 +13,29 @@ The path under which changes will be detected. #> [CmdletBinding()] Param ( - [Parameter(Mandatory=$True)] + [Parameter(Mandatory = $True)] [string] $ArtifactPath, - [Parameter(Mandatory=$True)] + [Parameter(Mandatory = $True)] [string] $TargetPath ) . (Join-Path $PSScriptRoot "Helpers" "git-helpers.ps1") -function Get-ChangedServices { - Param ( - [Parameter(Mandatory=$True)] - [string[]] $ChangedFiles - ) +function Get-ChangedServices +{ + Param ( + [Parameter(Mandatory = $True)] + [string[]] $ChangedFiles + ) - $changedServices = $ChangedFiles | Foreach-Object { if ($_ -match "sdk/([^/]+)") { $matches[1] } } | Sort-Object -Unique + $changedServices = $ChangedFiles | Foreach-Object { if ($_ -match "sdk/([^/]+)") { $matches[1] } } | Sort-Object -Unique - return $changedServices + return $changedServices } -if (!(Test-Path $ArtifactPath)) { - New-Item -ItemType Directory -Path $ArtifactPath | Out-Null +if (!(Test-Path $ArtifactPath)) +{ + New-Item -ItemType Directory -Path $ArtifactPath | Out-Null } $ArtifactPath = Resolve-Path $ArtifactPath @@ -43,9 +45,13 @@ $changedFiles = Get-ChangedFiles -DiffPath $TargetPath $changedServices = Get-ChangedServices -ChangedFiles $changedFiles $result = [PSCustomObject]@{ - "ChangedFiles" = $changedFiles - "ChangedServices" = $changedServices - "PRNumber" = if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) { $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER } else { "-1" } + "ChangedFiles" = $changedFiles + "ChangedServices" = $changedServices + "PRNumber" = if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) { $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER } else { "-1" } } -$result | ConvertTo-Json | Out-File $ArtifactName +$json = $result | ConvertTo-Json +$json | Out-File $ArtifactName + +Write-Host "`nGenerated diff.json file at $ArtifactName" +Write-Host " $($json -replace "`n", "`n ")" diff --git a/eng/common/scripts/Save-Package-Properties.ps1 b/eng/common/scripts/Save-Package-Properties.ps1 index 1922da5adff48..0257e73a15452 100644 --- a/eng/common/scripts/Save-Package-Properties.ps1 +++ b/eng/common/scripts/Save-Package-Properties.ps1 @@ -7,10 +7,10 @@ Saves package properties in source of a given service directory to JSON files. JSON files are named in the form .json or .json if an artifact name property is available in the package properties. -Can optionally add a dev version property which can be used logic for daily +Can optionally add a dev version property which can be used logic for daily builds. -In cases of collisions where track 2 packages (IsNewSdk = true) have the same +In cases of collisions where track 2 packages (IsNewSdk = true) have the same filename as track 1 packages (e.g. same artifact name or package name), the track 2 package properties will be written. @@ -21,22 +21,22 @@ Service directory in which to search for packages. A file path leading to a file generated from Generate-PR-Diff.json. This parameter takes precedence over serviceDirectory, do not provide both. .PARAMETER outDirectory -Output location (generally a package artifact directory in DevOps) for JSON +Output location (generally a package artifact directory in DevOps) for JSON files .PARAMETER addDevVersion -Reads the version out of the source and adds a DevVersion property to the -package properties JSON file. If the package properties JSON file already +Reads the version out of the source and adds a DevVersion property to the +package properties JSON file. If the package properties JSON file already exists, read the Version property from the existing package properties JSON file and set that as the Version property for the new output. This has the effect of -"adding" a DevVersion property to the file which could be different from the +"adding" a DevVersion property to the file which could be different from the Verison property in that file. #> [CmdletBinding()] Param ( [string] $serviceDirectory, - [Parameter(Mandatory=$True)] + [Parameter(Mandatory = $True)] [string] $outDirectory, [string] $prDiff, [switch] $addDevVersion @@ -44,7 +44,8 @@ Param ( . (Join-Path $PSScriptRoot common.ps1) -function SetOutput($outputPath, $incomingPackageSpec) { +function SetOutput($outputPath, $incomingPackageSpec) +{ # If there is an exsiting package info json file read that and set that as output object which gets properties updated here. if (Test-Path $outputPath) @@ -56,7 +57,7 @@ function SetOutput($outputPath, $incomingPackageSpec) { { $outputObject = $incomingPackageSpec } - + if ($addDevVersion) { @@ -75,16 +76,19 @@ function SetOutput($outputPath, $incomingPackageSpec) { -Value (ConvertTo-Json -InputObject $outputObject -Depth 100) } -function GetRelativePath($path) { +function GetRelativePath($path) +{ # If the path is empty return an empty string - if (!$path) { + if (!$path) + { return '' } # If the path is already relative return the path. Calling `GetRelativePath` # on a relative path converts the relative path to an absolute path based on # the current working directory which can result in unexpected outputs. - if (![IO.Path]::IsPathRooted($path)) { + if (![IO.Path]::IsPathRooted($path)) + { return $path } @@ -98,22 +102,26 @@ $exportedPaths = @{} $allPackageProperties = @() -if ($prDiff) { +if ($prDiff) +{ Write-Host "Getting package properties for PR diff file: $prDiff" $allPackageProperties = Get-PrPkgProperties $prDiff - if (!$allPackageProperties) { + if (!$allPackageProperties) + { Write-Host "No packages found matching PR diff file $prDiff" Write-Host "Setting NoPackagesChanged variable to true" Write-Host "##vso[task.setvariable variable=NoPackagesChanged]true" exit 0 } } -else { +else +{ Write-Host "Getting package properties for service directory: $serviceDirectory" $allPackageProperties = Get-AllPkgProperties $serviceDirectory - if (!$allPackageProperties) { + if (!$allPackageProperties) + { Write-Error "Package properties are not available for service directory $serviceDirectory" exit 1 } @@ -124,21 +132,26 @@ if (-not (Test-Path -Path $outDirectory)) New-Item -ItemType Directory -Force -Path $outDirectory | Out-Null } -foreach($pkg in $allPackageProperties) +foreach ($pkg in $allPackageProperties) { - if ($pkg.Name) { + if ($pkg.Name) + { + Write-Host "" Write-Host "Package Name: $($pkg.Name)" Write-Host "Package Version: $($pkg.Version)" Write-Host "Package SDK Type: $($pkg.SdkType)" Write-Host "Artifact Name: $($pkg.ArtifactName)" Write-Host "Release date: $($pkg.ReleaseStatus)" $configFilePrefix = $pkg.Name + if ($pkg.ArtifactName) { $configFilePrefix = $pkg.ArtifactName } + $outputPath = Join-Path -Path $outDirectory "$configFilePrefix.json" Write-Host "Output path of json file: $outputPath" + $outDir = Split-Path $outputPath -parent if (-not (Test-Path -path $outDir)) { @@ -148,14 +161,17 @@ foreach($pkg in $allPackageProperties) # If package properties for a track 2 (IsNewSdk = true) package has # already been written, skip writing to that same path. - if ($exportedPaths.ContainsKey($outputPath) -and $exportedPaths[$outputPath].IsNewSdk -eq $true) { + if ($exportedPaths.ContainsKey($outputPath) -and $exportedPaths[$outputPath].IsNewSdk -eq $true) + { Write-Host "Track 2 package info with file name $($outputPath) already exported. Skipping export." continue } - $exportedPaths[$outputPath] = $pkg + $exportedPaths[$outputPath] = $pkg SetOutput $outputPath $pkg } } -Get-ChildItem -Path $outDirectory +$fileNames = (Get-ChildItem -Path $outDirectory).Name +Write-Host "`nFiles written to $outDirectory`:" +Write-Host " $($fileNames -join "`n ")" From 63adc5f02e855ab37200c8a93b8b00e451528940 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 29 Aug 2024 21:14:41 -0700 Subject: [PATCH 56/71] Increment package version after release of Azure.ResourceManager.NetApp (#45564) --- sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md | 12 +++++++++++- .../src/Azure.ResourceManager.NetApp.csproj | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md b/sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md index 12d7010056654..ecdf34098fd11 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md +++ b/sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.8.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.7.0 (2024-08-16) ### Features Added @@ -182,4 +192,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). \ No newline at end of file +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/src/Azure.ResourceManager.NetApp.csproj b/sdk/netapp/Azure.ResourceManager.NetApp/src/Azure.ResourceManager.NetApp.csproj index b16bbba235c9b..451cf047aeeae 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/src/Azure.ResourceManager.NetApp.csproj +++ b/sdk/netapp/Azure.ResourceManager.NetApp/src/Azure.ResourceManager.NetApp.csproj @@ -1,8 +1,8 @@ - 1.7.0 + 1.8.0-beta.1 - 1.6.0 + 1.7.0 Azure.ResourceManager.NetApp Microsoft Azure Resource Manager client SDK for Azure resource provider Microsoft.NetApp. azure;management;arm;resource manager;netapp From 7f6cde71772ea898cf2f51c75ccd248bc180de5d Mon Sep 17 00:00:00 2001 From: Zhonglei Ma Date: Fri, 30 Aug 2024 12:26:14 +0800 Subject: [PATCH 57/71] Update Sample3_CreatingAVirtualNetwork (#45724) --- .../docs/Sample3_CreatingAVirtualNetwork.md | 58 +++---- .../Sample3_CreatingAVirtualNetwork.cs | 147 +++++++++++++++++- 2 files changed, 177 insertions(+), 28 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager/docs/Sample3_CreatingAVirtualNetwork.md b/sdk/resourcemanager/Azure.ResourceManager/docs/Sample3_CreatingAVirtualNetwork.md index dfba1f39393c3..939573e57e158 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/docs/Sample3_CreatingAVirtualNetwork.md +++ b/sdk/resourcemanager/Azure.ResourceManager/docs/Sample3_CreatingAVirtualNetwork.md @@ -5,14 +5,13 @@ In this example, we'll create a virtual network. Since the SDK follows the resou ## Import the namespaces These are the namespaces needed for this project: -```C# +```C# Snippet:Creating_A_Virtual_Network_Namespaces using System; using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; using Azure.ResourceManager.Network; +using Azure.ResourceManager.Resources; ``` ## Create a Resource Group @@ -31,72 +30,77 @@ ResourceGroupResource resourceGroup = operation.Value; ## Create a Virtual Network Now that we have a resource group, we'll create our virtual network. To do this, we will create a `VirtualNetworkData` object for the parameters that we want our Virtual Network to have, then we will get the Virtual Network collection and from there we call `CreateOrUpdateAsync()`. -```C# +```C# Snippet:Creating_A_Virtual_Network_CreateVirtualNetwork string vnetName = "myVnetName"; -VirtualNetworkData vnetData = new VirtualNetworkData() +VirtualNetworkData virtualNetworkData = new VirtualNetworkData() { // You can specify many options for the Virtual Network in here Location = "WestUS2", - AddressSpace = new AddressSpace() - { - AddressPrefixes = { "10.0.0.0/16", } - } + AddressPrefixes = { "10.0.0.0/16", } }; -VirtualNetwork vnet = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(vnetName, vnetData); +ArmOperation armOperation = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(WaitUntil.Completed, vnetName, virtualNetworkData); +VirtualNetworkResource virtualNetworkResource = armOperation.Value; ``` ## Create a Subnet Now that we have a virtual network, we must create at least one subnet in order to add any virtual machines. Following the hierarchy in Azure, subnets belong to a virtual network, so that's where we'll get our `SubnetCollection` instance. Before that, a `SubnetData` object must be created to specify the parameters for the Subnet. -```C# -string subnetName = vnetName + "_Subnet1"; +```C# Snippet:Creating_A_Virtual_Network_CreateSubnet +string subnetName = $"{vnetName}_Subnet1"; SubnetData subnetData = new SubnetData() { Name = subnetName, AddressPrefix = "10.0.1.0/24" }; -Subnet subnet = await vnet.GetSubnets().CreateOrUpdateAsync(subnetName, subnetData); +ArmOperation armOperation = await virtualNetworkResource.GetSubnets().CreateOrUpdateAsync(WaitUntil.Completed, subnetName, subnetData); +SubnetResource subnetResource = armOperation.Value; ``` ## Another way to create a Virtual Network with a Subnet It is possible to define an create a virtual network with its subnets in a single step. This is achieved by defining the subnets in the `VirtualNetworkData` object that is given as a parameter. -```C# +```C# Snippet:Creating_A_Virtual_Network_CreateSubnetByAnotherWay string vnetName = "myVnetName"; -string subnet1Name = vnetName + "_Subnet1"; +string subnet1Name = $"{vnetName}_Subnet1"; -var vnetData = new VirtualNetworkData() +VirtualNetworkData virtualNetworkData = new VirtualNetworkData() { Location = "WestUS2", - AddressSpace = new AddressSpace() + AddressPrefixes = { "10.0.0.0/16" }, + Subnets = { - AddressPrefixes = { "10.0.0.0/16", } - }, - Subnets = { new SubnetData() { Name = subnet1Name, AddressPrefix = "10.0.0.0/24", } } + new SubnetData + { + Name = subnet1Name, + AddressPrefix = "10.0.0.0/24" + } + } }; -VirtualNetwork vnet = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(vnetName, vnetData); +ArmOperation armOperation = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(WaitUntil.Completed, vnetName, virtualNetworkData); +VirtualNetworkResource virtualNetworkResource = armOperation.Value; ``` ### Modifying the Subnets of an existing Virtual Network Using the SubnetCollection it is possible to add a subnet into the virtual network we created above. -```C# -string subnet2Name = vnetName + "_Subnet2"; +```C# Snippet:Creating_A_Virtual_Network_ModifyingSubnetsInVirtualNetwork +string subnet2Name = $"{vnetName}_Subnet2"; SubnetData subnetData = new SubnetData() { Name = subnet2Name, AddressPrefix = "10.0.1.0/24" }; -Subnet subnet = await vnet.GetSubnets().CreateOrUpdateAsync(subnet2Name, subnetData); +ArmOperation armOperation = await virtualNetworkResource.GetSubnets().CreateOrUpdateAsync(WaitUntil.Completed, subnet2Name, subnetData); +SubnetResource subnetResource = armOperation.Value; ``` You can verify that your virtual network now has 2 subnets by doing the following: -```C# -VirtualNetwork myVNet = await resourceGroup.GetVirtualNetworks().GetAsync(vnetName); -Console.WriteLine(myVNet.Data.Subnets.Count); +```C# Snippet:Creating_A_Virtual_Network_GetAllSubnetsCount +VirtualNetworkResource virtualNetworkResource = await resourceGroup.GetVirtualNetworks().GetAsync(vnetName); +Console.WriteLine(virtualNetworkResource.Data.Subnets.Count); ``` ## Next steps diff --git a/sdk/resourcemanager/Azure.ResourceManager/samples/DocSamples/Sample3_CreatingAVirtualNetwork.cs b/sdk/resourcemanager/Azure.ResourceManager/samples/DocSamples/Sample3_CreatingAVirtualNetwork.cs index c32040699f7e6..367744a53840d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/samples/DocSamples/Sample3_CreatingAVirtualNetwork.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/samples/DocSamples/Sample3_CreatingAVirtualNetwork.cs @@ -1,11 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +#region Snippet:Creating_A_Virtual_Network_Namespaces + +using System; using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Network; using Azure.ResourceManager.Resources; -using Azure.ResourceManager.Resources.Models; + +#endregion Snippet:Creating_A_Virtual_Network_Namespaces + using NUnit.Framework; namespace Azure.ResourceManager.Tests.Samples @@ -17,6 +23,7 @@ public class Sample3_CreatingAVirtualNetwork public async Task CreateResourceGroupAsync() { #region Snippet:Creating_A_Virtual_Network_CreateResourceGroup + ArmClient client = new ArmClient(new DefaultAzureCredential()); SubscriptionResource subscription = await client.GetDefaultSubscriptionAsync(); ResourceGroupCollection resourceGroups = subscription.GetResourceGroups(); @@ -25,7 +32,145 @@ public async Task CreateResourceGroupAsync() ResourceGroupData resourceGroupData = new ResourceGroupData(AzureLocation.WestUS2); ArmOperation operation = await resourceGroups.CreateOrUpdateAsync(WaitUntil.Completed, resourceGroupName, resourceGroupData); ResourceGroupResource resourceGroup = operation.Value; + #endregion Snippet:Creating_A_Virtual_Network_CreateResourceGroup } + + [Test] + [Ignore("Only verifying that the sample builds")] + public async Task CreateVirtualNetworkAsync() + { + ArmClient client = new ArmClient(new DefaultAzureCredential()); + ResourceGroupCollection resourceGroups = (await client.GetDefaultSubscriptionAsync()).GetResourceGroups(); + + string resouceGroupName = "myResourceGroup"; + ResourceGroupResource resourceGroup = await resourceGroups.GetAsync(resouceGroupName); + + #region Snippet:Creating_A_Virtual_Network_CreateVirtualNetwork + + string vnetName = "myVnetName"; + VirtualNetworkData virtualNetworkData = new VirtualNetworkData() + { + // You can specify many options for the Virtual Network in here + Location = "WestUS2", + AddressPrefixes = { "10.0.0.0/16", } + }; + + ArmOperation armOperation = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(WaitUntil.Completed, vnetName, virtualNetworkData); + VirtualNetworkResource virtualNetworkResource = armOperation.Value; + + #endregion Snippet:Creating_A_Virtual_Network_CreateVirtualNetwork + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public async Task CreateSubnetAsync() + { + ArmClient client = new ArmClient(new DefaultAzureCredential()); + ResourceGroupCollection resourceGroups = (await client.GetDefaultSubscriptionAsync()).GetResourceGroups(); + + string resouceGroupName = "myResourceGroup"; + ResourceGroupResource resourceGroup = await resourceGroups.GetAsync(resouceGroupName); + + string vnetName = "myVnetName"; + VirtualNetworkResource virtualNetworkResource = await resourceGroup.GetVirtualNetworks().GetAsync(vnetName); + + #region Snippet:Creating_A_Virtual_Network_CreateSubnet + + string subnetName = $"{vnetName}_Subnet1"; + SubnetData subnetData = new SubnetData() + { + Name = subnetName, + AddressPrefix = "10.0.1.0/24" + }; + + ArmOperation armOperation = await virtualNetworkResource.GetSubnets().CreateOrUpdateAsync(WaitUntil.Completed, subnetName, subnetData); + SubnetResource subnetResource = armOperation.Value; + + #endregion Snippet:Creating_A_Virtual_Network_CreateSubnet + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public async Task CreateSubnetByAnotherWayAsync() + { + ArmClient client = new ArmClient(new DefaultAzureCredential()); + ResourceGroupCollection resourceGroups = (await client.GetDefaultSubscriptionAsync()).GetResourceGroups(); + + string resouceGroupName = "myResourceGroup"; + ResourceGroupResource resourceGroup = await resourceGroups.GetAsync(resouceGroupName); + + #region Snippet:Creating_A_Virtual_Network_CreateSubnetByAnotherWay + + string vnetName = "myVnetName"; + string subnet1Name = $"{vnetName}_Subnet1"; + + VirtualNetworkData virtualNetworkData = new VirtualNetworkData() + { + Location = "WestUS2", + AddressPrefixes = { "10.0.0.0/16" }, + Subnets = + { + new SubnetData + { + Name = subnet1Name, + AddressPrefix = "10.0.0.0/24" + } + } + }; + + ArmOperation armOperation = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(WaitUntil.Completed, vnetName, virtualNetworkData); + VirtualNetworkResource virtualNetworkResource = armOperation.Value; + + #endregion Snippet:Creating_A_Virtual_Network_CreateSubnetByAnotherWay + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public async Task ModifyingSubnetsInVirtualNetworkAsync() + { + ArmClient client = new ArmClient(new DefaultAzureCredential()); + ResourceGroupCollection resourceGroups = (await client.GetDefaultSubscriptionAsync()).GetResourceGroups(); + + string resouceGroupName = "myResourceGroup"; + ResourceGroupResource resourceGroup = await resourceGroups.GetAsync(resouceGroupName); + + string vnetName = "myVnetName"; + VirtualNetworkResource virtualNetworkResource = await resourceGroup.GetVirtualNetworks().GetAsync(vnetName); + + #region Snippet:Creating_A_Virtual_Network_ModifyingSubnetsInVirtualNetwork + + string subnet2Name = $"{vnetName}_Subnet2"; + SubnetData subnetData = new SubnetData() + { + Name = subnet2Name, + AddressPrefix = "10.0.1.0/24" + }; + + ArmOperation armOperation = await virtualNetworkResource.GetSubnets().CreateOrUpdateAsync(WaitUntil.Completed, subnet2Name, subnetData); + SubnetResource subnetResource = armOperation.Value; + + #endregion Snippet:Creating_A_Virtual_Network_ModifyingSubnetsInVirtualNetwork + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public async Task GetAllSubnetsCountAsync() + { + ArmClient client = new ArmClient(new DefaultAzureCredential()); + ResourceGroupCollection resourceGroups = (await client.GetDefaultSubscriptionAsync()).GetResourceGroups(); + + string resouceGroupName = "myResourceGroup"; + ResourceGroupResource resourceGroup = await resourceGroups.GetAsync(resouceGroupName); + + string vnetName = "myVnetName"; + + #region Snippet:Creating_A_Virtual_Network_GetAllSubnetsCount + + VirtualNetworkResource virtualNetworkResource = await resourceGroup.GetVirtualNetworks().GetAsync(vnetName); + Console.WriteLine(virtualNetworkResource.Data.Subnets.Count); + + #endregion Snippet:Creating_A_Virtual_Network_GetAllSubnetsCount + } } } From 20ec3f7928522d3fdb1bc9728352c19c38917267 Mon Sep 17 00:00:00 2001 From: Pan Shao <97225342+pshao25@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:23:40 +0800 Subject: [PATCH 58/71] update readme of resourcemanager (#45723) --- sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md | 7 ++----- .../Azure.ResourceManager/src/Azure.ResourceManager.csproj | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md b/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md index 3e844a7a0191e..7e2110154dd36 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md +++ b/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md @@ -1,12 +1,9 @@ # Release History -## 1.13.0-beta.1 (Unreleased) +## 1.13.0 (2024-09-03) ### Features Added - -### Breaking Changes - -### Bugs Fixed +- Added `JsonModelWriteCore` to serialization file so that derived models could call it without doing the serialization of base properties themselves. ### Other Changes - Added to the sample code to authenticate with the azure in China in the README.md file. diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj b/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj index 9caf255017650..b668a3c5ce2d2 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj @@ -1,7 +1,7 @@ - 1.13.0-beta.1 + 1.13.0 1.12.0 Azure.ResourceManager From 86b5149db797a199ddf985f92a77b69a08d444eb Mon Sep 17 00:00:00 2001 From: Sahil Arora Date: Fri, 30 Aug 2024 00:25:03 -0700 Subject: [PATCH 59/71] Compute Fleet SDK release for 2024-05-01-preview (#45353) --- .github/CODEOWNERS | 6 + .vscode/cspell.json | 8 + .../Azure.ResourceManager.ComputeFleet.sln | 65 + .../CHANGELOG.md | 19 + .../Directory.Build.props | 6 + .../README.md | 80 + ...urceManager.ComputeFleet.netstandard2.0.cs | 1438 +++++++++++++++++ .../assets.json | 6 + ...esourceManager.ComputeFleet.Samples.csproj | 10 + .../Samples/Sample_ComputeFleetCollection.cs | 160 ++ .../Samples/Sample_ComputeFleetResource.cs | 139 ++ .../Azure.ResourceManager.ComputeFleet.csproj | 8 + .../src/Custom/Models/ComputeFleetPatch.cs | 16 + .../Generated/ArmComputeFleetModelFactory.cs | 331 ++++ .../src/Generated/ComputeFleetCollection.cs | 494 ++++++ .../ComputeFleetData.Serialization.cs | 278 ++++ .../src/Generated/ComputeFleetData.cs | 96 ++ .../ComputeFleetResource.Serialization.cs | 26 + .../src/Generated/ComputeFleetResource.cs | 768 +++++++++ .../Extensions/ComputeFleetExtensions.cs | 219 +++ .../MockableComputeFleetArmClient.cs | 49 + ...ckableComputeFleetResourceGroupResource.cs | 105 ++ ...ockableComputeFleetSubscriptionResource.cs | 102 ++ .../src/Generated/Internal/Argument.cs | 129 ++ .../Internal/ChangeTrackingDictionary.cs | 167 ++ .../Generated/Internal/ChangeTrackingList.cs | 153 ++ .../Internal/ModelSerializationExtensions.cs | 398 +++++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + .../ComputeFleetArmOperation.cs | 94 ++ .../ComputeFleetArmOperationOfT.cs | 100 ++ .../ComputeFleetOperationSource.cs | 38 + .../AdditionalInformationSettingName.cs | 54 + ...apacityReservationProfile.Serialization.cs | 127 ++ .../Models/CapacityReservationProfile.cs | 88 + .../ComputeFleetApiError.Serialization.cs | 190 +++ .../Generated/Models/ComputeFleetApiError.cs | 82 + .../ComputeFleetApiErrorInfo.Serialization.cs | 144 ++ .../Models/ComputeFleetApiErrorInfo.cs | 73 + ...teFleetApplicationProfile.Serialization.cs | 136 ++ .../Models/ComputeFleetApplicationProfile.cs | 69 + ...mputeFleetBootDiagnostics.Serialization.cs | 141 ++ .../Models/ComputeFleetBootDiagnostics.cs | 82 + .../Models/ComputeFleetCachingType.cs | 54 + ...omputeFleetComputeProfile.Serialization.cs | 145 ++ .../Models/ComputeFleetComputeProfile.cs | 101 ++ ...teFleetDiagnosticsProfile.Serialization.cs | 126 ++ .../Models/ComputeFleetDiagnosticsProfile.cs | 77 + .../Models/ComputeFleetDiffDiskOption.cs | 48 + .../Models/ComputeFleetDiffDiskPlacement.cs | 64 + ...puteFleetDiffDiskSettings.Serialization.cs | 141 ++ .../Models/ComputeFleetDiffDiskSettings.cs | 89 + .../Models/ComputeFleetDiskControllerType.cs | 61 + .../ComputeFleetDiskCreateOptionType.cs | 65 + .../ComputeFleetDiskDeleteOptionType.cs | 57 + .../ComputeFleetDomainNameLabelScopeType.cs | 62 + ...teFleetEncryptionIdentity.Serialization.cs | 126 ++ .../Models/ComputeFleetEncryptionIdentity.cs | 69 + .../Models/ComputeFleetEvictionPolicy.cs | 51 + .../Generated/Models/ComputeFleetIPVersion.cs | 55 + ...omputeFleetImageReference.Serialization.cs | 212 +++ .../Models/ComputeFleetImageReference.cs | 148 ++ .../ComputeFleetInnerError.Serialization.cs | 133 ++ .../Models/ComputeFleetInnerError.cs | 69 + ...etKeyVaultSecretReference.Serialization.cs | 128 ++ .../ComputeFleetKeyVaultSecretReference.cs | 95 ++ ...teFleetLinuxConfiguration.Serialization.cs | 192 +++ .../Models/ComputeFleetLinuxConfiguration.cs | 112 ++ .../ComputeFleetLinuxPatchAssessmentMode.cs | 57 + ...teFleetLinuxPatchSettings.Serialization.cs | 156 ++ .../Models/ComputeFleetLinuxPatchSettings.cs | 105 ++ ...stPatchAutomaticByPlatformRebootSetting.cs | 60 + ...tomaticByPlatformSettings.Serialization.cs | 141 ++ ...VmGuestPatchAutomaticByPlatformSettings.cs | 78 + .../ComputeFleetLinuxVmGuestPatchMode.cs | 55 + .../Models/ComputeFleetNetworkApiVersion.cs | 52 + ...mputeFleetNetworkInterfaceAuxiliaryMode.cs | 57 + ...omputeFleetNetworkInterfaceAuxiliarySku.cs | 63 + ...SImageNotificationProfile.Serialization.cs | 137 ++ .../ComputeFleetOSImageNotificationProfile.cs | 79 + .../Models/ComputeFleetOperatingSystemType.cs | 55 + .../Models/ComputeFleetPatch.Serialization.cs | 183 +++ .../src/Generated/Models/ComputeFleetPatch.cs | 77 + .../ComputeFleetProperties.Serialization.cs | 216 +++ .../Models/ComputeFleetProperties.cs | 103 ++ .../Models/ComputeFleetProtocolType.cs | 54 + .../Models/ComputeFleetProvisioningState.cs | 66 + ...teFleetProxyAgentSettings.Serialization.cs | 156 ++ .../Models/ComputeFleetProxyAgentSettings.cs | 98 ++ ...teFleetPublicIPAddressSku.Serialization.cs | 141 ++ .../Models/ComputeFleetPublicIPAddressSku.cs | 72 + .../ComputeFleetPublicIPAddressSkuName.cs | 51 + .../ComputeFleetPublicIPAddressSkuTier.cs | 51 + ...eetScheduledEventsProfile.Serialization.cs | 141 ++ .../ComputeFleetScheduledEventsProfile.cs | 69 + .../ComputeFleetSecurityEncryptionType.cs | 66 + ...tSecurityPostureReference.Serialization.cs | 162 ++ .../ComputeFleetSecurityPostureReference.cs | 89 + ...mputeFleetSecurityProfile.Serialization.cs | 192 +++ .../Models/ComputeFleetSecurityProfile.cs | 135 ++ .../Models/ComputeFleetSecurityType.cs | 55 + ...puteFleetSshConfiguration.Serialization.cs | 136 ++ .../Models/ComputeFleetSshConfiguration.cs | 66 + .../ComputeFleetSshPublicKey.Serialization.cs | 133 ++ .../Models/ComputeFleetSshPublicKey.cs | 90 ++ .../Models/ComputeFleetStorageAccountType.cs | 78 + ...minateNotificationProfile.Serialization.cs | 137 ++ ...omputeFleetTerminateNotificationProfile.cs | 79 + .../ComputeFleetUefiSettings.Serialization.cs | 141 ++ .../Models/ComputeFleetUefiSettings.cs | 84 + ...puteFleetVaultCertificate.Serialization.cs | 137 ++ .../Models/ComputeFleetVaultCertificate.cs | 116 ++ ...puteFleetVaultSecretGroup.Serialization.cs | 152 ++ .../Models/ComputeFleetVaultSecretGroup.cs | 90 ++ ...mputeFleetVirtualHardDisk.Serialization.cs | 126 ++ .../Models/ComputeFleetVirtualHardDisk.cs | 65 + .../Models/ComputeFleetVmDeleteOption.cs | 51 + ...leetVmDiskSecurityProfile.Serialization.cs | 142 ++ .../ComputeFleetVmDiskSecurityProfile.cs | 105 ++ ...FleetVmGalleryApplication.Serialization.cs | 193 +++ .../ComputeFleetVmGalleryApplication.cs | 126 ++ ...FleetVmGuestPatchSettings.Serialization.cs | 171 ++ .../ComputeFleetVmGuestPatchSettings.cs | 127 ++ .../ComputeFleetVmProfile.Serialization.cs | 345 ++++ .../Generated/Models/ComputeFleetVmProfile.cs | 282 ++++ ...ComputeFleetVmSizeProfile.Serialization.cs | 134 ++ .../Models/ComputeFleetVmSizeProfile.cs | 85 + ...puteFleetVmSizeProperties.Serialization.cs | 141 ++ .../Models/ComputeFleetVmSizeProperties.cs | 95 ++ .../Models/ComputeFleetVmss.Serialization.cs | 159 ++ .../src/Generated/Models/ComputeFleetVmss.cs | 95 ++ .../ComputeFleetVmssDataDisk.Serialization.cs | 254 +++ .../Models/ComputeFleetVmssDataDisk.cs | 170 ++ ...ComputeFleetVmssExtension.Serialization.cs | 163 ++ .../Models/ComputeFleetVmssExtension.cs | 78 + ...FleetVmssExtensionProfile.Serialization.cs | 147 ++ .../ComputeFleetVmssExtensionProfile.cs | 80 + ...etVmssExtensionProperties.Serialization.cs | 354 ++++ .../ComputeFleetVmssExtensionProperties.cs | 216 +++ ...eFleetVmssHardwareProfile.Serialization.cs | 126 ++ .../Models/ComputeFleetVmssHardwareProfile.cs | 73 + ...eFleetVmssIPConfiguration.Serialization.cs | 134 ++ .../Models/ComputeFleetVmssIPConfiguration.cs | 85 + ...IPConfigurationProperties.Serialization.cs | 281 ++++ ...mputeFleetVmssIPConfigurationProperties.cs | 154 ++ .../ComputeFleetVmssIPTag.Serialization.cs | 133 ++ .../Generated/Models/ComputeFleetVmssIPTag.cs | 69 + ...mputeFleetVmssManagedDisk.Serialization.cs | 157 ++ .../Models/ComputeFleetVmssManagedDisk.cs | 99 ++ ...tVmssNetworkConfiguration.Serialization.cs | 134 ++ .../ComputeFleetVmssNetworkConfiguration.cs | 79 + ...rkConfigurationProperties.Serialization.cs | 292 ++++ ...FleetVmssNetworkConfigurationProperties.cs | 159 ++ ...eetVmssNetworkDnsSettings.Serialization.cs | 136 ++ .../ComputeFleetVmssNetworkDnsSettings.cs | 66 + ...teFleetVmssNetworkProfile.Serialization.cs | 167 ++ .../Models/ComputeFleetVmssNetworkProfile.cs | 104 ++ .../ComputeFleetVmssOSDisk.Serialization.cs | 287 ++++ .../Models/ComputeFleetVmssOSDisk.cs | 199 +++ ...ComputeFleetVmssOSProfile.Serialization.cs | 250 +++ .../Models/ComputeFleetVmssOSProfile.cs | 194 +++ ...licIPAddressConfiguration.Serialization.cs | 149 ++ ...teFleetVmssPublicIPAddressConfiguration.cs | 98 ++ ...ssConfigurationProperties.Serialization.cs | 219 +++ ...sPublicIPAddressConfigurationProperties.cs | 111 ++ ...ublicIPAddressDnsSettings.Serialization.cs | 134 ++ ...puteFleetVmssPublicIPAddressDnsSettings.cs | 101 ++ ...teFleetVmssStorageProfile.Serialization.cs | 181 +++ .../Models/ComputeFleetVmssStorageProfile.cs | 108 ++ ...ComputeFleetWinRMListener.Serialization.cs | 141 ++ .../Models/ComputeFleetWinRMListener.cs | 103 ++ ...FleetWindowsConfiguration.Serialization.cs | 230 +++ .../ComputeFleetWindowsConfiguration.cs | 149 ++ .../ComputeFleetWindowsPatchAssessmentMode.cs | 51 + ...stPatchAutomaticByPlatformRebootSetting.cs | 57 + ...tomaticByPlatformSettings.Serialization.cs | 141 ++ ...VmGuestPatchAutomaticByPlatformSettings.cs | 78 + .../ComputeFleetWindowsVmGuestPatchMode.cs | 69 + .../Models/FleetListResult.Serialization.cs | 144 ++ .../src/Generated/Models/FleetListResult.cs | 80 + .../Generated/Models/ProxyAgentExecuteMode.cs | 56 + .../RegularPriorityAllocationStrategy.cs | 51 + .../RegularPriorityProfile.Serialization.cs | 156 ++ .../Models/RegularPriorityProfile.cs | 73 + .../Models/SpotAllocationStrategy.cs | 54 + .../SpotPriorityProfile.Serialization.cs | 208 +++ .../Generated/Models/SpotPriorityProfile.cs | 95 ++ ...MachineScaleSetListResult.Serialization.cs | 144 ++ .../VirtualMachineScaleSetListResult.cs | 80 + .../WinRMConfiguration.Serialization.cs | 136 ++ .../Generated/Models/WinRMConfiguration.cs | 66 + ...etupAdditionalInformation.Serialization.cs | 167 ++ .../WindowsSetupAdditionalInformation.cs | 101 ++ ...SetupAdditionalInformationComponentName.cs | 48 + ...ndowsSetupAdditionalInformationPassName.cs | 48 + .../src/Generated/ProviderConstants.cs | 16 + .../RestOperations/FleetsRestOperations.cs | 901 +++++++++++ .../src/Properties/AssemblyInfo.cs | 9 + .../src/autorest.md.bak | 199 +++ ....ResourceManager.ComputeFleet.Tests.csproj | 5 + .../tests/ComputeFleetManagementTestBase.cs | 43 + .../ComputeFleetManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 3 + sdk/computefleet/ci.mgmt.yml | 23 + sdk/resourcemanager/ci.mgmt.yml | 2 + 205 files changed, 26312 insertions(+) create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/Azure.ResourceManager.ComputeFleet.sln create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/Directory.Build.props create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Azure.ResourceManager.ComputeFleet.Samples.csproj create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetCollection.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetResource.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Custom/Models/ComputeFleetPatch.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ArmComputeFleetModelFactory.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetCollection.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/ComputeFleetExtensions.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetArmClient.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetResourceGroupResource.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetSubscriptionResource.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Argument.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Optional.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperation.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperationOfT.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetOperationSource.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalInformationSettingName.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetCachingType.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskOption.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskPlacement.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskControllerType.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskCreateOptionType.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskDeleteOptionType.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDomainNameLabelScopeType.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEvictionPolicy.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetIPVersion.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchAssessmentMode.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchMode.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkApiVersion.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliaryMode.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliarySku.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOperatingSystemType.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProtocolType.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProvisioningState.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuName.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuTier.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityEncryptionType.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityType.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetStorageAccountType.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDeleteOption.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsPatchAssessmentMode.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchMode.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ProxyAgentExecuteMode.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityAllocationStrategy.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotAllocationStrategy.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.Serialization.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationComponentName.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationPassName.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ProviderConstants.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/RestOperations/FleetsRestOperations.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Properties/AssemblyInfo.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/autorest.md.bak create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/Azure.ResourceManager.ComputeFleet.Tests.csproj create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestBase.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestEnvironment.cs create mode 100644 sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml create mode 100644 sdk/computefleet/ci.mgmt.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d446704467e1f..be97ea39ebc42 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1046,6 +1046,12 @@ # ServiceLabel: %Spring App Discovery %Mgmt # ServiceOwners: @sunkun99 +# PRLabel: %Compute - Fleet +/sdk/computefleet/ @sahilarora92 @dhruvil009 + +# ServiceLabel: %Compute - Fleet +# ServiceOwners: @sahilarora92 @dhruvil009 + # ######## Eng Sys ######## /eng/ @hallipr @weshaggard @benbp /eng/common/ @Azure/azure-sdk-eng diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 0284b24acadc5..8c17a695edcda 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -267,6 +267,14 @@ "Nvme" ] }, + { + "filename": "**/sdk/computefleet/**/*.cs", + "words": [ + "mbps", + "unattend", + "nvme" + ] + }, { "filename": "**/sdk/confidentialledger/**/*.cs", "words": [ diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Azure.ResourceManager.ComputeFleet.sln b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Azure.ResourceManager.ComputeFleet.sln new file mode 100644 index 0000000000000..7a24cf7855ce4 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Azure.ResourceManager.ComputeFleet.sln @@ -0,0 +1,65 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30309.148 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{4C116B47-8025-4661-8132-7285E6F6A0E6}") = "Azure.ResourceManager.ComputeFleet", "src\Azure.ResourceManager.ComputeFleet.csproj", "{2C45D581-85D6-4CBF-A13E-AD042A797542}" +EndProject +Project("{4C116B47-8025-4661-8132-7285E6F6A0E6}") = "Azure.ResourceManager.ComputeFleet.Tests", "tests\Azure.ResourceManager.ComputeFleet.Tests.csproj", "{9F3B80CD-FF80-44EC-97AB-E85DC75172E4}" +EndProject +Project("{4C116B47-8025-4661-8132-7285E6F6A0E6}") = "Azure.ResourceManager.ComputeFleet.Samples", "samples\Azure.ResourceManager.ComputeFleet.Samples.csproj", "{0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}" +EndProject +Global + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {679CD23D-054A-44B1-BA43-4ECD5D4DC0D4} + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Debug|x64.ActiveCfg = Debug|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Debug|x64.Build.0 = Debug|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Debug|x86.ActiveCfg = Debug|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Debug|x86.Build.0 = Debug|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Release|Any CPU.Build.0 = Release|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Release|x64.ActiveCfg = Release|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Release|x64.Build.0 = Release|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Release|x86.ActiveCfg = Release|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Release|x86.Build.0 = Release|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Debug|x64.ActiveCfg = Debug|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Debug|x64.Build.0 = Debug|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Debug|x86.ActiveCfg = Debug|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Debug|x86.Build.0 = Debug|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Release|Any CPU.Build.0 = Release|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Release|x64.ActiveCfg = Release|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Release|x64.Build.0 = Release|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Release|x86.ActiveCfg = Release|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Release|x86.Build.0 = Release|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Debug|x64.ActiveCfg = Debug|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Debug|x64.Build.0 = Debug|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Debug|x86.ActiveCfg = Debug|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Debug|x86.Build.0 = Debug|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Release|Any CPU.Build.0 = Release|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Release|x64.ActiveCfg = Release|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Release|x64.Build.0 = Release|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Release|x86.ActiveCfg = Release|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md new file mode 100644 index 0000000000000..b95412eba9abe --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md @@ -0,0 +1,19 @@ +# Release History + +## 1.0.0-beta.1 (2024-08-28) + +- Initial beta version + +### Features Added + +This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). + +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Directory.Build.props b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Directory.Build.props new file mode 100644 index 0000000000000..1a9611bd49242 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md new file mode 100644 index 0000000000000..2225489198000 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure Compute Fleet management client library for .NET + +Azure Compute Fleet is a building block that gives you accelerated access to Azure's capacity in a given region. Compute Fleet launches a combination of virtual machines (VMs) at the lowest price and highest capacity. There are many ways you can use this product, whether by running a stateless web service, a big data cluster, or a Continuous Integration pipeline. Workloads such as financial risk analysis, log processing, or image rendering can benefit from the ability to run hundreds of concurrent core instances. + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure Compute Fleet management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.ComputeFleet --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs new file mode 100644 index 0000000000000..df5f5a8b381b8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs @@ -0,0 +1,1438 @@ +namespace Azure.ResourceManager.ComputeFleet +{ + public partial class ComputeFleetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ComputeFleetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.ComputeFleet.ComputeFleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.ComputeFleet.ComputeFleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ComputeFleetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.Models.ArmPlan Plan { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IList Zones { get { throw null; } } + Azure.ResourceManager.ComputeFleet.ComputeFleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.ComputeFleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ComputeFleetExtensions + { + public static Azure.Response GetComputeFleet(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetComputeFleetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ComputeFleet.ComputeFleetResource GetComputeFleetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ComputeFleet.ComputeFleetCollection GetComputeFleets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetComputeFleets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetComputeFleetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ComputeFleetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ComputeFleetResource() { } + public virtual Azure.ResourceManager.ComputeFleet.ComputeFleetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetVirtualMachineScaleSets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetVirtualMachineScaleSetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ComputeFleet.ComputeFleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.ComputeFleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ComputeFleet.Mocking +{ + public partial class MockableComputeFleetArmClient : Azure.ResourceManager.ArmResource + { + protected MockableComputeFleetArmClient() { } + public virtual Azure.ResourceManager.ComputeFleet.ComputeFleetResource GetComputeFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableComputeFleetResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableComputeFleetResourceGroupResource() { } + public virtual Azure.Response GetComputeFleet(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetComputeFleetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ComputeFleet.ComputeFleetCollection GetComputeFleets() { throw null; } + } + public partial class MockableComputeFleetSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableComputeFleetSubscriptionResource() { } + public virtual Azure.Pageable GetComputeFleets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetComputeFleetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ComputeFleet.Models +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AdditionalInformationSettingName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AdditionalInformationSettingName(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName AutoLogon { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName FirstLogonCommands { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName left, Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName left, Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName right) { throw null; } + public override string ToString() { throw null; } + } + public static partial class ArmComputeFleetModelFactory + { + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError ComputeFleetApiError(string code = null, string target = null, string message = null, System.Collections.Generic.IEnumerable details = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError innererror = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiErrorInfo ComputeFleetApiErrorInfo(string code = null, string target = null, string message = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.ComputeFleetData ComputeFleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties properties = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Models.ArmPlan plan = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetImageReference ComputeFleetImageReference(Azure.Core.ResourceIdentifier id = null, string publisher = null, string offer = null, string sku = null, string version = null, string exactVersion = null, string sharedGalleryImageId = null, string communityGalleryImageId = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError ComputeFleetInnerError(string exceptionType = null, string errorDetail = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties ComputeFleetProperties(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState?), Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile spotPriorityProfile = null, Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile regularPriorityProfile = null, System.Collections.Generic.IEnumerable vmSizesProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile computeProfile = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string uniqueId = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile ComputeFleetVmProfile(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSProfile osProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssStorageProfile storageProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkProfile networkProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityProfile securityProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetBootDiagnostics bootDiagnostics = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProfile extensionProfile = null, string licenseType = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetScheduledEventsProfile scheduledEventsProfile = null, string userData = null, Azure.Core.ResourceIdentifier capacityReservationGroupId = null, System.Collections.Generic.IEnumerable galleryApplications = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProperties hardwareVmSizeProperties = null, Azure.Core.ResourceIdentifier serviceArtifactReferenceId = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityPostureReference securityPostureReference = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmss ComputeFleetVmss(string id = null, string type = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState operationStatus = default(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState), Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError error = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtension ComputeFleetVmssExtension(Azure.Core.ResourceIdentifier id = null, string name = null, string extensionType = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties properties = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties ComputeFleetVmssExtensionProperties(string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? shouldAutoUpgradeMinorVersion = default(bool?), bool? isAutomaticUpgradeEnabled = default(bool?), System.Collections.Generic.IDictionary settings = null, System.Collections.Generic.IDictionary protectedSettings = null, string provisioningState = null, System.Collections.Generic.IEnumerable provisionAfterExtensions = null, bool? isSuppressFailuresEnabled = default(bool?), Azure.ResourceManager.ComputeFleet.Models.ComputeFleetKeyVaultSecretReference protectedSettingsFromKeyVault = null) { throw null; } + } + public partial class ComputeFleetApiError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ComputeFleetApiError() { } + public string Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError Innererror { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetApiErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ComputeFleetApiErrorInfo() { } + public string Code { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetBootDiagnostics : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetBootDiagnostics() { } + public bool? IsEnabled { get { throw null; } set { } } + public System.Uri StorageUri { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetBootDiagnostics System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetBootDiagnostics System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetCachingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetCachingType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType None { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType ReadOnly { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType ReadWrite { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetComputeProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetComputeProfile(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile baseVirtualMachineProfile) { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile BaseVirtualMachineProfile { get { throw null; } set { } } + public string ComputeApiVersion { get { throw null; } set { } } + public int? PlatformFaultDomainCount { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetDiffDiskOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetDiffDiskOption(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption Local { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetDiffDiskPlacement : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetDiffDiskPlacement(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement CacheDisk { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement NvmeDisk { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement ResourceDisk { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetDiffDiskSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetDiffDiskSettings() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption? Option { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement? Placement { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetDiskControllerType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetDiskControllerType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType Nvme { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType Scsi { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetDiskCreateOptionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetDiskCreateOptionType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType Attach { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType Copy { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType Empty { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType FromImage { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType Restore { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetDiskDeleteOptionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetDiskDeleteOptionType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType Delete { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType Detach { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetDomainNameLabelScopeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetDomainNameLabelScopeType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType NoReuse { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType ResourceGroupReuse { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType SubscriptionReuse { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType TenantReuse { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetEvictionPolicy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetEvictionPolicy(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy Deallocate { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy Delete { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetImageReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetImageReference() { } + public string CommunityGalleryImageId { get { throw null; } set { } } + public string ExactVersion { get { throw null; } } + public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } + public string Offer { get { throw null; } set { } } + public string Publisher { get { throw null; } set { } } + public string SharedGalleryImageId { get { throw null; } set { } } + public string Sku { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetImageReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetImageReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetInnerError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ComputeFleetInnerError() { } + public string ErrorDetail { get { throw null; } } + public string ExceptionType { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetIPVersion : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetIPVersion(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion IPv4 { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion IPv6 { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetKeyVaultSecretReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetKeyVaultSecretReference(System.Uri secretUri, Azure.ResourceManager.Resources.Models.WritableSubResource sourceVault) { } + public System.Uri SecretUri { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SourceVaultId { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetKeyVaultSecretReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetKeyVaultSecretReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetLinuxConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetLinuxConfiguration() { } + public bool? IsPasswordAuthenticationDisabled { get { throw null; } set { } } + public bool? IsVmAgentPlatformUpdatesEnabled { get { throw null; } set { } } + public bool? IsVmAgentProvisioned { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchSettings PatchSettings { get { throw null; } set { } } + public System.Collections.Generic.IList SshPublicKeys { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetLinuxPatchAssessmentMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetLinuxPatchAssessmentMode(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode AutomaticByPlatform { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode ImageDefault { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetLinuxPatchSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetLinuxPatchSettings() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode? AssessmentMode { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode? PatchMode { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting Always { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting IfRequired { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting Never { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings() { } + public bool? IsBypassPlatformSafetyChecksOnUserScheduleEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting? RebootSetting { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetLinuxVmGuestPatchMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetLinuxVmGuestPatchMode(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode AutomaticByPlatform { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode ImageDefault { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetNetworkApiVersion : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetNetworkApiVersion(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion V20201101 { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetNetworkInterfaceAuxiliaryMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetNetworkInterfaceAuxiliaryMode(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode AcceleratedConnections { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode Floating { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode None { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetNetworkInterfaceAuxiliarySku : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetNetworkInterfaceAuxiliarySku(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku A1 { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku A2 { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku A4 { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku A8 { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku None { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetOperatingSystemType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetOperatingSystemType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType Linux { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType Windows { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetOSImageNotificationProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetOSImageNotificationProfile() { } + public bool? IsEnabled { get { throw null; } set { } } + public string NotBeforeTimeout { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOSImageNotificationProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOSImageNotificationProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.Models.ArmPlan Plan { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetProperties(System.Collections.Generic.IEnumerable vmSizesProfile, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile computeProfile) { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile ComputeProfile { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile RegularPriorityProfile { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile SpotPriorityProfile { get { throw null; } set { } } + public string UniqueId { get { throw null; } } + public System.Collections.Generic.IList VmSizesProfile { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetProtocolType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetProtocolType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType Http { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType Https { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Migrating { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetProxyAgentSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetProxyAgentSettings() { } + public bool? IsEnabled { get { throw null; } set { } } + public int? KeyIncarnationId { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode? Mode { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProxyAgentSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProxyAgentSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetPublicIPAddressSku : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetPublicIPAddressSku() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName? Name { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier? Tier { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSku System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetPublicIPAddressSkuName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetPublicIPAddressSkuName(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName Basic { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName Standard { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetPublicIPAddressSkuTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetPublicIPAddressSkuTier(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier Global { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier Regional { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetScheduledEventsProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetScheduledEventsProfile() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOSImageNotificationProfile OSImageNotificationProfile { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetTerminateNotificationProfile TerminateNotificationProfile { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetScheduledEventsProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetScheduledEventsProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetSecurityEncryptionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetSecurityEncryptionType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType DiskWithVmGuestState { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType NonPersistedTpm { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType VmGuestStateOnly { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetSecurityPostureReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetSecurityPostureReference() { } + public System.Collections.Generic.IList ExcludeExtensions { get { throw null; } } + public string Id { get { throw null; } set { } } + public bool? IsOverridable { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityPostureReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityPostureReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetSecurityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetSecurityProfile() { } + public bool? IsEncryptionAtHostEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProxyAgentSettings ProxyAgentSettings { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType? SecurityType { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetUefiSettings UefiSettings { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier UserAssignedIdentityResourceId { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetSecurityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetSecurityType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType ConfidentialVm { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType TrustedLaunch { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetSshPublicKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetSshPublicKey() { } + public string KeyData { get { throw null; } set { } } + public string Path { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSshPublicKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSshPublicKey System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetStorageAccountType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetStorageAccountType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType PremiumLrs { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType PremiumV2LRS { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType PremiumZrs { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType StandardLrs { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType StandardSsdLrd { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType StandardSsdZrs { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType UltraSsdLrs { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetTerminateNotificationProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetTerminateNotificationProfile() { } + public bool? IsEnabled { get { throw null; } set { } } + public string NotBeforeTimeout { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetTerminateNotificationProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetTerminateNotificationProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetUefiSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetUefiSettings() { } + public bool? IsSecureBootEnabled { get { throw null; } set { } } + public bool? IsVTpmEnabled { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetUefiSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetUefiSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVaultCertificate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVaultCertificate() { } + public string CertificateStore { get { throw null; } set { } } + public System.Uri CertificateUri { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVaultCertificate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVaultCertificate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVaultSecretGroup : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVaultSecretGroup() { } + public Azure.Core.ResourceIdentifier SourceVaultId { get { throw null; } set { } } + public System.Collections.Generic.IList VaultCertificates { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVaultSecretGroup System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVaultSecretGroup System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetVmDeleteOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetVmDeleteOption(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption Delete { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption Detach { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetVmDiskSecurityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmDiskSecurityProfile() { } + public Azure.Core.ResourceIdentifier DiskEncryptionSetId { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType? SecurityEncryptionType { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDiskSecurityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDiskSecurityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmGalleryApplication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmGalleryApplication(Azure.Core.ResourceIdentifier packageReferenceId) { } + public string ConfigurationReference { get { throw null; } set { } } + public bool? IsAutomaticUpgradeEnabled { get { throw null; } set { } } + public bool? IsTreatFailureAsDeploymentFailureEnabled { get { throw null; } set { } } + public int? Order { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PackageReferenceId { get { throw null; } set { } } + public string Tags { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGalleryApplication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGalleryApplication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmGuestPatchSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmGuestPatchSettings() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode? AssessmentMode { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings { get { throw null; } set { } } + public bool? IsHotPatchingEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode? PatchMode { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGuestPatchSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGuestPatchSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmProfile() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetBootDiagnostics BootDiagnostics { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier CapacityReservationGroupId { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProfile ExtensionProfile { get { throw null; } set { } } + public System.Collections.Generic.IList GalleryApplications { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProperties HardwareVmSizeProperties { get { throw null; } set { } } + public string LicenseType { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkProfile NetworkProfile { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSProfile OSProfile { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetScheduledEventsProfile ScheduledEventsProfile { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityPostureReference SecurityPostureReference { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityProfile SecurityProfile { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ServiceArtifactReferenceId { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssStorageProfile StorageProfile { get { throw null; } set { } } + public string UserData { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmSizeProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmSizeProfile(string name) { } + public string Name { get { throw null; } set { } } + public int? Rank { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmSizeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmSizeProperties() { } + public int? VCPUsAvailable { get { throw null; } set { } } + public int? VCPUsPerCore { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmss : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ComputeFleetVmss() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError Error { get { throw null; } } + public string Id { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState OperationStatus { get { throw null; } } + public string Type { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmss System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmss System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssDataDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssDataDisk(int lun, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType createOption) { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType? Caching { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType CreateOption { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType? DeleteOption { get { throw null; } set { } } + public long? DiskIopsReadWrite { get { throw null; } set { } } + public long? DiskMbpsReadWrite { get { throw null; } set { } } + public int? DiskSizeGB { get { throw null; } set { } } + public bool? IsWriteAcceleratorEnabled { get { throw null; } set { } } + public int Lun { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssManagedDisk ManagedDisk { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssDataDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssDataDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssExtension : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssExtension() { } + public string ExtensionType { get { throw null; } } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtension System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtension System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssExtensionProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssExtensionProfile() { } + public System.Collections.Generic.IList Extensions { get { throw null; } } + public string ExtensionsTimeBudget { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssExtensionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssExtensionProperties() { } + public string ExtensionType { get { throw null; } set { } } + public string ForceUpdateTag { get { throw null; } set { } } + public bool? IsAutomaticUpgradeEnabled { get { throw null; } set { } } + public bool? IsSuppressFailuresEnabled { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ProtectedSettings { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetKeyVaultSecretReference ProtectedSettingsFromKeyVault { get { throw null; } set { } } + public System.Collections.Generic.IList ProvisionAfterExtensions { get { throw null; } } + public string ProvisioningState { get { throw null; } } + public string Publisher { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Settings { get { throw null; } } + public bool? ShouldAutoUpgradeMinorVersion { get { throw null; } set { } } + public string TypeHandlerVersion { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssIPConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssIPConfiguration(string name) { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfigurationProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssIPConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssIPConfigurationProperties() { } + public System.Collections.Generic.IList ApplicationGatewayBackendAddressPools { get { throw null; } } + public System.Collections.Generic.IList ApplicationSecurityGroups { get { throw null; } } + public bool? IsPrimary { get { throw null; } set { } } + public System.Collections.Generic.IList LoadBalancerBackendAddressPools { get { throw null; } } + public System.Collections.Generic.IList LoadBalancerInboundNatPools { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion? PrivateIPAddressVersion { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfiguration PublicIPAddressConfiguration { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssIPTag : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssIPTag() { } + public string IPTagType { get { throw null; } set { } } + public string Tag { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPTag System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPTag System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssManagedDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssManagedDisk() { } + public Azure.Core.ResourceIdentifier DiskEncryptionSetId { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDiskSecurityProfile SecurityProfile { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType? StorageAccountType { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssManagedDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssManagedDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssNetworkConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssNetworkConfiguration(string name) { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfigurationProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssNetworkConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssNetworkConfigurationProperties(System.Collections.Generic.IEnumerable ipConfigurations) { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode? AuxiliaryMode { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku? AuxiliarySku { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption? DeleteOption { get { throw null; } set { } } + public System.Collections.Generic.IList DnsServers { get { throw null; } } + public System.Collections.Generic.IList IPConfigurations { get { throw null; } } + public bool? IsAcceleratedNetworkingEnabled { get { throw null; } set { } } + public bool? IsFpgaEnabled { get { throw null; } set { } } + public bool? IsIPForwardingEnabled { get { throw null; } set { } } + public bool? IsPrimary { get { throw null; } set { } } + public bool? IsTcpStateTrackingDisabled { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier NetworkSecurityGroupId { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssNetworkProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssNetworkProfile() { } + public Azure.Core.ResourceIdentifier HealthProbeId { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion? NetworkApiVersion { get { throw null; } set { } } + public System.Collections.Generic.IList NetworkInterfaceConfigurations { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssOSDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssOSDisk(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType createOption) { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType? Caching { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType CreateOption { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType? DeleteOption { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskSettings DiffDiskSettings { get { throw null; } set { } } + public int? DiskSizeGB { get { throw null; } set { } } + public System.Uri ImageUri { get { throw null; } set { } } + public bool? IsWriteAcceleratorEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssManagedDisk ManagedDisk { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType? OSType { get { throw null; } set { } } + public System.Collections.Generic.IList VhdContainers { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssOSProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssOSProfile() { } + public string AdminPassword { get { throw null; } set { } } + public string AdminUsername { get { throw null; } set { } } + public bool? AreExtensionOperationsAllowed { get { throw null; } set { } } + public string ComputerNamePrefix { get { throw null; } set { } } + public string CustomData { get { throw null; } set { } } + public bool? IsGuestProvisionSignalRequired { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxConfiguration LinuxConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IList Secrets { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsConfiguration WindowsConfiguration { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssPublicIPAddressConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssPublicIPAddressConfiguration(string name) { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfigurationProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSku Sku { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssPublicIPAddressConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssPublicIPAddressConfigurationProperties() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption? DeleteOption { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressDnsSettings DnsSettings { get { throw null; } set { } } + public int? IdleTimeoutInMinutes { get { throw null; } set { } } + public System.Collections.Generic.IList IPTags { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion? PublicIPAddressVersion { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PublicIPPrefixId { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssPublicIPAddressDnsSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssPublicIPAddressDnsSettings(string domainNameLabel) { } + public string DomainNameLabel { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType? DomainNameLabelScope { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressDnsSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressDnsSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssStorageProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssStorageProfile() { } + public System.Collections.Generic.IList DataDisks { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType? DiskControllerType { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetImageReference ImageReference { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSDisk OSDisk { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssStorageProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssStorageProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetWindowsConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetWindowsConfiguration() { } + public System.Collections.Generic.IList AdditionalUnattendContent { get { throw null; } } + public bool? IsAutomaticUpdatesEnabled { get { throw null; } set { } } + public bool? IsVmAgentPlatformUpdatesEnabled { get { throw null; } set { } } + public bool? IsVmAgentProvisioned { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGuestPatchSettings PatchSettings { get { throw null; } set { } } + public string TimeZone { get { throw null; } set { } } + public System.Collections.Generic.IList WinRMListeners { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetWindowsPatchAssessmentMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetWindowsPatchAssessmentMode(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode AutomaticByPlatform { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode ImageDefault { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting Always { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting IfRequired { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting Never { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings() { } + public bool? IsBypassPlatformSafetyChecksOnUserScheduleEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting? RebootSetting { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetWindowsVmGuestPatchMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetWindowsVmGuestPatchMode(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode AutomaticByOS { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode AutomaticByPlatform { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode Manual { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetWinRMListener : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetWinRMListener() { } + public System.Uri CertificateUri { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType? Protocol { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWinRMListener System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWinRMListener System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProxyAgentExecuteMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProxyAgentExecuteMode(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode Audit { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode Enforce { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode left, Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode left, Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RegularPriorityAllocationStrategy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RegularPriorityAllocationStrategy(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy LowestPrice { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy Prioritized { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy left, Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy left, Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RegularPriorityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RegularPriorityProfile() { } + public Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy? AllocationStrategy { get { throw null; } set { } } + public int? Capacity { get { throw null; } set { } } + public int? MinCapacity { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SpotAllocationStrategy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SpotAllocationStrategy(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy CapacityOptimized { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy LowestPrice { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy PriceCapacityOptimized { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy left, Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy left, Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SpotPriorityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SpotPriorityProfile() { } + public Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy? AllocationStrategy { get { throw null; } set { } } + public int? Capacity { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy? EvictionPolicy { get { throw null; } set { } } + public bool? IsMaintainEnabled { get { throw null; } set { } } + public float? MaxPricePerVm { get { throw null; } set { } } + public int? MinCapacity { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WindowsSetupAdditionalInformation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WindowsSetupAdditionalInformation() { } + public Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName? ComponentName { get { throw null; } set { } } + public string Content { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName? PassName { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName? SettingName { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WindowsSetupAdditionalInformationComponentName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WindowsSetupAdditionalInformationComponentName(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName MicrosoftWindowsShellSetup { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName left, Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName left, Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WindowsSetupAdditionalInformationPassName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WindowsSetupAdditionalInformationPassName(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName OobeSystem { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName left, Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName left, Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json new file mode 100644 index 0000000000000..ebe690ab171bc --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/computefleet/Azure.ResourceManager.ComputeFleet", + "Tag": "" +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Azure.ResourceManager.ComputeFleet.Samples.csproj b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Azure.ResourceManager.ComputeFleet.Samples.csproj new file mode 100644 index 0000000000000..b29a80f89a430 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Azure.ResourceManager.ComputeFleet.Samples.csproj @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetCollection.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetCollection.cs new file mode 100644 index 0000000000000..4ca6c0427871f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ComputeFleet.Samples +{ + public partial class Sample_ComputeFleetCollection + { + // Fleets_ListByResourceGroup + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_FleetsListByResourceGroup() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_ListByResourceGroup.json + // this example is just showing the usage of "Fleets_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ComputeFleetResource + ComputeFleetCollection collection = resourceGroupResource.GetComputeFleets(); + + // invoke the operation and iterate over the result + await foreach (ComputeFleetResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ComputeFleetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Fleets_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_FleetsGet() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Get.json + // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ComputeFleetResource + ComputeFleetCollection collection = resourceGroupResource.GetComputeFleets(); + + // invoke the operation + string fleetName = "testFleet"; + ComputeFleetResource result = await collection.GetAsync(fleetName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ComputeFleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Fleets_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_FleetsGet() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Get.json + // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ComputeFleetResource + ComputeFleetCollection collection = resourceGroupResource.GetComputeFleets(); + + // invoke the operation + string fleetName = "testFleet"; + bool result = await collection.ExistsAsync(fleetName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Fleets_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_FleetsGet() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Get.json + // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ComputeFleetResource + ComputeFleetCollection collection = resourceGroupResource.GetComputeFleets(); + + // invoke the operation + string fleetName = "testFleet"; + NullableResponse response = await collection.GetIfExistsAsync(fleetName); + ComputeFleetResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ComputeFleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetResource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetResource.cs new file mode 100644 index 0000000000000..db5269c3aa36d --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetResource.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ComputeFleet.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ComputeFleet.Samples +{ + public partial class Sample_ComputeFleetResource + { + // Fleets_ListBySubscription + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetComputeFleets_FleetsListBySubscription() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_ListBySubscription.json + // this example is just showing the usage of "Fleets_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (ComputeFleetResource item in subscriptionResource.GetComputeFleetsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ComputeFleetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Fleets_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_FleetsGet() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Get.json + // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ComputeFleetResource created on azure + // for more information of creating ComputeFleetResource, please refer to the document of ComputeFleetResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + string fleetName = "testFleet"; + ResourceIdentifier computeFleetResourceId = ComputeFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ComputeFleetResource computeFleet = client.GetComputeFleetResource(computeFleetResourceId); + + // invoke the operation + ComputeFleetResource result = await computeFleet.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ComputeFleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Fleets_Delete + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_FleetsDelete() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Delete.json + // this example is just showing the usage of "Fleets_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ComputeFleetResource created on azure + // for more information of creating ComputeFleetResource, please refer to the document of ComputeFleetResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + string fleetName = "testFleet"; + ResourceIdentifier computeFleetResourceId = ComputeFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ComputeFleetResource computeFleet = client.GetComputeFleetResource(computeFleetResourceId); + + // invoke the operation + await computeFleet.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Fleets_ListVirtualMachineScaleSets + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetVirtualMachineScaleSets_FleetsListVirtualMachineScaleSets() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_ListVirtualMachineScaleSets.json + // this example is just showing the usage of "Fleets_ListVirtualMachineScaleSets" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ComputeFleetResource created on azure + // for more information of creating ComputeFleetResource, please refer to the document of ComputeFleetResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + string name = "myFleet"; + ResourceIdentifier computeFleetResourceId = ComputeFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + ComputeFleetResource computeFleet = client.GetComputeFleetResource(computeFleetResourceId); + + // invoke the operation and iterate over the result + await foreach (ComputeFleetVmss item in computeFleet.GetVirtualMachineScaleSetsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj new file mode 100644 index 0000000000000..1142b14b7330f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj @@ -0,0 +1,8 @@ + + + 1.0.0-beta.1 + Azure.ResourceManager.ComputeFleet + Azure Resource Manager client SDK for Azure resource provider ComputeFleet. + azure;management;arm;resource manager;computefleet + + diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Custom/Models/ComputeFleetPatch.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Custom/Models/ComputeFleetPatch.cs new file mode 100644 index 0000000000000..81dd74da4660e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Custom/Models/ComputeFleetPatch.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Fleet Update Model. + public partial class ComputeFleetPatch + { + /// Updatable managed service identity. + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ArmComputeFleetModelFactory.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ArmComputeFleetModelFactory.cs new file mode 100644 index 0000000000000..84ec227471d8f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ArmComputeFleetModelFactory.cs @@ -0,0 +1,331 @@ +// 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.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Model factory for models. + public static partial class ArmComputeFleetModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Zones in which the Compute Fleet is available. + /// The managed service identities assigned to this resource. + /// Details of the resource plan. + /// A new instance for mocking. + public static ComputeFleetData ComputeFleetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ComputeFleetProperties properties = null, IEnumerable zones = null, ManagedServiceIdentity identity = null, ArmPlan plan = null) + { + tags ??= new Dictionary(); + zones ??= new List(); + + return new ComputeFleetData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + zones?.ToList(), + identity, + plan, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the last operation. + /// Configuration Options for Spot instances in Compute Fleet. + /// Configuration Options for Regular instances in Compute Fleet. + /// List of VM sizes supported for Compute Fleet. + /// Compute Profile to use for running user's workloads. + /// Specifies the time at which the Compute Fleet is created. + /// Specifies the ID which uniquely identifies a Compute Fleet. + /// A new instance for mocking. + public static ComputeFleetProperties ComputeFleetProperties(ComputeFleetProvisioningState? provisioningState = null, SpotPriorityProfile spotPriorityProfile = null, RegularPriorityProfile regularPriorityProfile = null, IEnumerable vmSizesProfile = null, ComputeFleetComputeProfile computeProfile = null, DateTimeOffset? createdOn = null, string uniqueId = null) + { + vmSizesProfile ??= new List(); + + return new ComputeFleetProperties( + provisioningState, + spotPriorityProfile, + regularPriorityProfile, + vmSizesProfile?.ToList(), + computeProfile, + createdOn, + uniqueId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Specifies the operating system settings for the virtual machines in the scale + /// set. + /// + /// Specifies the storage settings for the virtual machine disks. + /// + /// Specifies properties of the network interfaces of the virtual machines in the + /// scale set. + /// + /// + /// Specifies the Security related profile settings for the virtual machines in the + /// scale set. + /// + /// Specifies the boot diagnostic settings state. + /// + /// Specifies a collection of settings for extensions installed on virtual machines + /// in the scale set. + /// + /// + /// Specifies that the image or disk that is being used was licensed on-premises. + /// <br><br> Possible values for Windows Server operating system are: <br><br> + /// Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS + /// (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for + /// Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// + /// Specifies Scheduled Event related configurations. + /// + /// UserData for the virtual machines in the scale set, which must be base-64 + /// encoded. Customer should not pass any secrets in here. Minimum api-version: + /// 2021-03-01. + /// + /// + /// Specifies the capacity reservation related details of a scale set. Minimum + /// api-version: 2021-04-01. + /// + /// Specifies the gallery applications that should be made available to the VM/VMSS. + /// + /// Specifies the hardware profile related details of a scale set. Minimum + /// api-version: 2021-11-01. + /// + /// + /// Specifies the service artifact reference id used to set same image version for + /// all virtual machines in the scale set when using 'latest' image version. + /// Minimum api-version: 2022-11-01 + /// + /// + /// Specifies the security posture to be used for all virtual machines in the scale + /// set. Minimum api-version: 2023-03-01 + /// + /// + /// Specifies the time in which this VM profile for the Virtual Machine Scale Set + /// was created. Minimum API version for this property is 2023-09-01. This value + /// will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile + /// with minimum api-version 2023-09-01. Examples: "2024-07-01T00:00:01.1234567+00:00" + /// + /// A new instance for mocking. + public static ComputeFleetVmProfile ComputeFleetVmProfile(ComputeFleetVmssOSProfile osProfile = null, ComputeFleetVmssStorageProfile storageProfile = null, ComputeFleetVmssNetworkProfile networkProfile = null, ComputeFleetSecurityProfile securityProfile = null, ComputeFleetBootDiagnostics bootDiagnostics = null, ComputeFleetVmssExtensionProfile extensionProfile = null, string licenseType = null, ComputeFleetScheduledEventsProfile scheduledEventsProfile = null, string userData = null, ResourceIdentifier capacityReservationGroupId = null, IEnumerable galleryApplications = null, ComputeFleetVmSizeProperties hardwareVmSizeProperties = null, ResourceIdentifier serviceArtifactReferenceId = null, ComputeFleetSecurityPostureReference securityPostureReference = null, DateTimeOffset? createdOn = null) + { + galleryApplications ??= new List(); + + return new ComputeFleetVmProfile( + osProfile, + storageProfile, + networkProfile, + securityProfile, + bootDiagnostics != null ? new ComputeFleetDiagnosticsProfile(bootDiagnostics, serializedAdditionalRawData: null) : null, + extensionProfile, + licenseType, + scheduledEventsProfile, + userData, + capacityReservationGroupId != null ? new CapacityReservationProfile(ResourceManagerModelFactory.WritableSubResource(capacityReservationGroupId), serializedAdditionalRawData: null) : null, + galleryApplications != null ? new ComputeFleetApplicationProfile(galleryApplications?.ToList(), serializedAdditionalRawData: null) : null, + hardwareVmSizeProperties != null ? new ComputeFleetVmssHardwareProfile(hardwareVmSizeProperties, serializedAdditionalRawData: null) : null, + serviceArtifactReferenceId != null ? ResourceManagerModelFactory.WritableSubResource(serviceArtifactReferenceId) : null, + securityPostureReference, + createdOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource Id. + /// The image publisher. + /// + /// Specifies the offer of the platform image or marketplace image used to create + /// the virtual machine. + /// + /// The image SKU. + /// + /// Specifies the version of the platform image or marketplace image used to create + /// the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + /// Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest + /// version of an image available at deploy time. Even if you use 'latest', the VM + /// image will not automatically update after deploy time even if a new version + /// becomes available. Please do not use field 'version' for gallery image + /// deployment, gallery image should always use 'id' field for deployment, to use 'latest' + /// version of gallery image, just set + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + /// in the 'id' field without version input. + /// + /// + /// Specifies in decimal numbers, the version of platform image or marketplace + /// image used to create the virtual machine. This readonly field differs from 'version', + /// only if the value specified in 'version' field is 'latest'. + /// + /// + /// Specified the shared gallery image unique id for vm deployment. This can be + /// fetched from shared gallery image GET call. + /// + /// + /// Specified the community gallery image unique id for vm deployment. This can be + /// fetched from community gallery image GET call. + /// + /// A new instance for mocking. + public static ComputeFleetImageReference ComputeFleetImageReference(ResourceIdentifier id = null, string publisher = null, string offer = null, string sku = null, string version = null, string exactVersion = null, string sharedGalleryImageId = null, string communityGalleryImageId = null) + { + return new ComputeFleetImageReference( + id, + publisher, + offer, + sku, + version, + exactVersion, + sharedGalleryImageId, + communityGalleryImageId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource Id. + /// The name of the extension. + /// Resource type. + /// Describes the properties of a Virtual Machine Scale Set Extension. + /// A new instance for mocking. + public static ComputeFleetVmssExtension ComputeFleetVmssExtension(ResourceIdentifier id = null, string name = null, string extensionType = null, ComputeFleetVmssExtensionProperties properties = null) + { + return new ComputeFleetVmssExtension(id, name, extensionType, properties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// If a value is provided and is different from the previous value, the extension + /// handler will be forced to update even if the extension configuration has not + /// changed. + /// + /// The name of the extension handler publisher. + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// Specifies the version of the script handler. + /// + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will not + /// upgrade minor versions unless redeployed, even with this property set to true. + /// + /// + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + /// Json formatted public settings for the extension. + /// + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + /// The provisioning state, which only appears in the response. + /// + /// Collection of extension names after which this extension needs to be + /// provisioned. + /// + /// + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be suppressed + /// regardless of this value). The default is false. + /// + /// + /// The extensions protected settings that are passed by reference, and consumed + /// from key vault + /// + /// A new instance for mocking. + public static ComputeFleetVmssExtensionProperties ComputeFleetVmssExtensionProperties(string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? shouldAutoUpgradeMinorVersion = null, bool? isAutomaticUpgradeEnabled = null, IDictionary settings = null, IDictionary protectedSettings = null, string provisioningState = null, IEnumerable provisionAfterExtensions = null, bool? isSuppressFailuresEnabled = null, ComputeFleetKeyVaultSecretReference protectedSettingsFromKeyVault = null) + { + settings ??= new Dictionary(); + protectedSettings ??= new Dictionary(); + provisionAfterExtensions ??= new List(); + + return new ComputeFleetVmssExtensionProperties( + forceUpdateTag, + publisher, + extensionType, + typeHandlerVersion, + shouldAutoUpgradeMinorVersion, + isAutomaticUpgradeEnabled, + settings, + protectedSettings, + provisioningState, + provisionAfterExtensions?.ToList(), + isSuppressFailuresEnabled, + protectedSettingsFromKeyVault, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// The compute RP resource id of the virtualMachineScaleSet + /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}" + /// + /// Type of the virtualMachineScaleSet. + /// This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. + /// Error Information when `operationStatus` is `Failed`. + /// A new instance for mocking. + public static ComputeFleetVmss ComputeFleetVmss(string id = null, string type = null, ComputeFleetProvisioningState operationStatus = default, ComputeFleetApiError error = null) + { + return new ComputeFleetVmss(id, type, operationStatus, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The error code. + /// The target of the particular error. + /// The error message. + /// The API error details. + /// The API inner error. + /// A new instance for mocking. + public static ComputeFleetApiError ComputeFleetApiError(string code = null, string target = null, string message = null, IEnumerable details = null, ComputeFleetInnerError innererror = null) + { + details ??= new List(); + + return new ComputeFleetApiError( + code, + target, + message, + details?.ToList(), + innererror, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The error code. + /// The target of the particular error. + /// The error message. + /// A new instance for mocking. + public static ComputeFleetApiErrorInfo ComputeFleetApiErrorInfo(string code = null, string target = null, string message = null) + { + return new ComputeFleetApiErrorInfo(code, target, message, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The exception type. + /// The internal error message or exception dump. + /// A new instance for mocking. + public static ComputeFleetInnerError ComputeFleetInnerError(string exceptionType = null, string errorDetail = null) + { + return new ComputeFleetInnerError(exceptionType, errorDetail, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetCollection.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetCollection.cs new file mode 100644 index 0000000000000..323ce687d8fbd --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetCollection.cs @@ -0,0 +1,494 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ComputeFleet +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetComputeFleets method from an instance of . + /// + public partial class ComputeFleetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _computeFleetFleetsClientDiagnostics; + private readonly FleetsRestOperations _computeFleetFleetsRestClient; + + /// Initializes a new instance of the class for mocking. + protected ComputeFleetCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ComputeFleetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _computeFleetFleetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ComputeFleet", ComputeFleetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ComputeFleetResource.ResourceType, out string computeFleetFleetsApiVersion); + _computeFleetFleetsRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, computeFleetFleetsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of the Compute Fleet. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fleetName, ComputeFleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, cancellationToken).ConfigureAwait(false); + var operation = new ComputeFleetArmOperation(new ComputeFleetOperationSource(Client), _computeFleetFleetsClientDiagnostics, Pipeline, _computeFleetFleetsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of the Compute Fleet. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fleetName, ComputeFleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, cancellationToken); + var operation = new ComputeFleetArmOperation(new ComputeFleetOperationSource(Client), _computeFleetFleetsClientDiagnostics, Pipeline, _computeFleetFleetsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.Get"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ComputeFleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.Get"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ComputeFleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Fleet resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _computeFleetFleetsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _computeFleetFleetsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ComputeFleetResource(Client, ComputeFleetData.DeserializeComputeFleetData(e)), _computeFleetFleetsClientDiagnostics, Pipeline, "ComputeFleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Fleet resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _computeFleetFleetsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _computeFleetFleetsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ComputeFleetResource(Client, ComputeFleetData.DeserializeComputeFleetData(e)), _computeFleetFleetsClientDiagnostics, Pipeline, "ComputeFleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.Exists"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.Exists"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ComputeFleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ComputeFleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.Serialization.cs new file mode 100644 index 0000000000000..25e0baf0c9de5 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.Serialization.cs @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ComputeFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeFleet +{ + public partial class ComputeFleetData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + if (Optional.IsDefined(Plan)) + { + writer.WritePropertyName("plan"u8); + JsonSerializer.Serialize(writer, Plan); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetData 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(ComputeFleetData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetData(document.RootElement, options); + } + + internal static ComputeFleetData DeserializeComputeFleetData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetProperties properties = default; + IList zones = default; + ManagedServiceIdentity identity = default; + ArmPlan plan = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ComputeFleetProperties.DeserializeComputeFleetProperties(property.Value, options); + continue; + } + if (property.NameEquals("zones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("plan"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + plan = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + zones ?? new ChangeTrackingList(), + identity, + plan, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetData)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.cs new file mode 100644 index 0000000000000..21d3c256f4855 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.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 Azure.Core; +using Azure.ResourceManager.ComputeFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeFleet +{ + /// + /// A class representing the ComputeFleet data model. + /// An Compute Fleet resource + /// + public partial class ComputeFleetData : TrackedResourceData + { + /// + /// 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 location. + public ComputeFleetData(AzureLocation location) : base(location) + { + Zones = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Zones in which the Compute Fleet is available. + /// The managed service identities assigned to this resource. + /// Details of the resource plan. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeFleetProperties properties, IList zones, ManagedServiceIdentity identity, ArmPlan plan, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Zones = zones; + Identity = identity; + Plan = plan; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetData() + { + } + + /// The resource-specific properties for this resource. + public ComputeFleetProperties Properties { get; set; } + /// Zones in which the Compute Fleet is available. + public IList Zones { get; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + /// Details of the resource plan. + public ArmPlan Plan { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.Serialization.cs new file mode 100644 index 0000000000000..7b63494c88431 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ComputeFleet +{ + public partial class ComputeFleetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ComputeFleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ComputeFleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.cs new file mode 100644 index 0000000000000..150cc0ab22f8b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.cs @@ -0,0 +1,768 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ComputeFleet.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ComputeFleet +{ + /// + /// A Class representing a ComputeFleet along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetComputeFleetResource method. + /// Otherwise you can get one from its parent resource using the GetComputeFleet method. + /// + public partial class ComputeFleetResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _computeFleetFleetsClientDiagnostics; + private readonly FleetsRestOperations _computeFleetFleetsRestClient; + private readonly ComputeFleetData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.AzureFleet/fleets"; + + /// Initializes a new instance of the class for mocking. + protected ComputeFleetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ComputeFleetResource(ArmClient client, ComputeFleetData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ComputeFleetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _computeFleetFleetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ComputeFleet", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string computeFleetFleetsApiVersion); + _computeFleetFleetsRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, computeFleetFleetsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ComputeFleetData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.Get"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ComputeFleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.Get"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ComputeFleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Delete + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.Delete"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ComputeFleetArmOperation(_computeFleetFleetsClientDiagnostics, Pipeline, _computeFleetFleetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Delete + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.Delete"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ComputeFleetArmOperation(_computeFleetFleetsClientDiagnostics, Pipeline, _computeFleetFleetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Update + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ComputeFleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.Update"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ComputeFleetArmOperation(new ComputeFleetOperationSource(Client), _computeFleetFleetsClientDiagnostics, Pipeline, _computeFleetFleetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Update + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ComputeFleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.Update"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new ComputeFleetArmOperation(new ComputeFleetOperationSource(Client), _computeFleetFleetsClientDiagnostics, Pipeline, _computeFleetFleetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List VirtualMachineScaleSet resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{name}/virtualMachineScaleSets + /// + /// + /// Operation Id + /// VirtualMachineScaleSet_ListVirtualMachineScaleSets + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetVirtualMachineScaleSetsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _computeFleetFleetsRestClient.CreateListVirtualMachineScaleSetsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _computeFleetFleetsRestClient.CreateListVirtualMachineScaleSetsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ComputeFleetVmss.DeserializeComputeFleetVmss(e), _computeFleetFleetsClientDiagnostics, Pipeline, "ComputeFleetResource.GetVirtualMachineScaleSets", "value", "nextLink", cancellationToken); + } + + /// + /// List VirtualMachineScaleSet resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{name}/virtualMachineScaleSets + /// + /// + /// Operation Id + /// VirtualMachineScaleSet_ListVirtualMachineScaleSets + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetVirtualMachineScaleSets(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _computeFleetFleetsRestClient.CreateListVirtualMachineScaleSetsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _computeFleetFleetsRestClient.CreateListVirtualMachineScaleSetsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ComputeFleetVmss.DeserializeComputeFleetVmss(e), _computeFleetFleetsClientDiagnostics, Pipeline, "ComputeFleetResource.GetVirtualMachineScaleSets", "value", "nextLink", cancellationToken); + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ComputeFleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ComputeFleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ComputeFleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ComputeFleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ComputeFleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ComputeFleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ComputeFleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ComputeFleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ComputeFleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ComputeFleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ComputeFleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ComputeFleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/ComputeFleetExtensions.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/ComputeFleetExtensions.cs new file mode 100644 index 0000000000000..70ee5bc010ec5 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/ComputeFleetExtensions.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ComputeFleet.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ComputeFleet +{ + /// A class to add extension methods to Azure.ResourceManager.ComputeFleet. + public static partial class ComputeFleetExtensions + { + private static MockableComputeFleetArmClient GetMockableComputeFleetArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableComputeFleetArmClient(client0)); + } + + private static MockableComputeFleetResourceGroupResource GetMockableComputeFleetResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableComputeFleetResourceGroupResource(client, resource.Id)); + } + + private static MockableComputeFleetSubscriptionResource GetMockableComputeFleetSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableComputeFleetSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ComputeFleetResource GetComputeFleetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableComputeFleetArmClient(client).GetComputeFleetResource(id); + } + + /// + /// Gets a collection of ComputeFleetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of ComputeFleetResources and their operations over a ComputeFleetResource. + public static ComputeFleetCollection GetComputeFleets(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableComputeFleetResourceGroupResource(resourceGroupResource).GetComputeFleets(); + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetComputeFleetAsync(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableComputeFleetResourceGroupResource(resourceGroupResource).GetComputeFleetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetComputeFleet(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableComputeFleetResourceGroupResource(resourceGroupResource).GetComputeFleet(fleetName, cancellationToken); + } + + /// + /// List Fleet resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets + /// + /// + /// Operation Id + /// Fleet_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetComputeFleetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableComputeFleetSubscriptionResource(subscriptionResource).GetComputeFleetsAsync(cancellationToken); + } + + /// + /// List Fleet resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets + /// + /// + /// Operation Id + /// Fleet_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetComputeFleets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableComputeFleetSubscriptionResource(subscriptionResource).GetComputeFleets(cancellationToken); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetArmClient.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetArmClient.cs new file mode 100644 index 0000000000000..3bbfcc756e854 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetArmClient.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableComputeFleetArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableComputeFleetArmClient() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableComputeFleetArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableComputeFleetArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ComputeFleetResource GetComputeFleetResource(ResourceIdentifier id) + { + ComputeFleetResource.ValidateResourceId(id); + return new ComputeFleetResource(Client, id); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetResourceGroupResource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetResourceGroupResource.cs new file mode 100644 index 0000000000000..f1d8341de4eeb --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetResourceGroupResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableComputeFleetResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableComputeFleetResourceGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableComputeFleetResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ComputeFleetResources in the ResourceGroupResource. + /// An object representing collection of ComputeFleetResources and their operations over a ComputeFleetResource. + public virtual ComputeFleetCollection GetComputeFleets() + { + return GetCachedClient(client => new ComputeFleetCollection(client, Id)); + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetComputeFleetAsync(string fleetName, CancellationToken cancellationToken = default) + { + return await GetComputeFleets().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetComputeFleet(string fleetName, CancellationToken cancellationToken = default) + { + return GetComputeFleets().Get(fleetName, cancellationToken); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetSubscriptionResource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetSubscriptionResource.cs new file mode 100644 index 0000000000000..76dd9cbeec5dc --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ComputeFleet.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableComputeFleetSubscriptionResource : ArmResource + { + private ClientDiagnostics _computeFleetFleetsClientDiagnostics; + private FleetsRestOperations _computeFleetFleetsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableComputeFleetSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableComputeFleetSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics ComputeFleetFleetsClientDiagnostics => _computeFleetFleetsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ComputeFleet", ComputeFleetResource.ResourceType.Namespace, Diagnostics); + private FleetsRestOperations ComputeFleetFleetsRestClient => _computeFleetFleetsRestClient ??= new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ComputeFleetResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List Fleet resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets + /// + /// + /// Operation Id + /// Fleet_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetComputeFleetsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ComputeFleetFleetsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ComputeFleetFleetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ComputeFleetResource(Client, ComputeFleetData.DeserializeComputeFleetData(e)), ComputeFleetFleetsClientDiagnostics, Pipeline, "MockableComputeFleetSubscriptionResource.GetComputeFleets", "value", "nextLink", cancellationToken); + } + + /// + /// List Fleet resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets + /// + /// + /// Operation Id + /// Fleet_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetComputeFleets(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ComputeFleetFleetsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ComputeFleetFleetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ComputeFleetResource(Client, ComputeFleetData.DeserializeComputeFleetData(e)), ComputeFleetFleetsClientDiagnostics, Pipeline, "MockableComputeFleetSubscriptionResource.GetComputeFleets", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Argument.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Argument.cs new file mode 100644 index 0000000000000..a0a6cf71885fe --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/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 Azure.ResourceManager.ComputeFleet +{ + 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 0000000000000..aa7e5ec8f7e0b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/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 Azure.ResourceManager.ComputeFleet +{ + 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ChangeTrackingList.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 0000000000000..95357b568c624 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/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 Azure.ResourceManager.ComputeFleet +{ + 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 0000000000000..2c90832af7485 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// 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 Azure.ResourceManager.ComputeFleet +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + 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 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Optional.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Optional.cs new file mode 100644 index 0000000000000..857b37b3e1ced --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/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 Azure.ResourceManager.ComputeFleet +{ + 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 0000000000000..34875b3d7f791 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/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 Azure.ResourceManager.ComputeFleet +{ + 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperation.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperation.cs new file mode 100644 index 0000000000000..7762c42a9062a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperation.cs @@ -0,0 +1,94 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ComputeFleet +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ComputeFleetArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of ComputeFleetArmOperation for mocking. + protected ComputeFleetArmOperation() + { + } + + internal ComputeFleetArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ComputeFleetArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "ComputeFleetArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperationOfT.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperationOfT.cs new file mode 100644 index 0000000000000..1c033561536ee --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperationOfT.cs @@ -0,0 +1,100 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ComputeFleet +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ComputeFleetArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of ComputeFleetArmOperation for mocking. + protected ComputeFleetArmOperation() + { + } + + internal ComputeFleetArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ComputeFleetArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "ComputeFleetArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetOperationSource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetOperationSource.cs new file mode 100644 index 0000000000000..592ac79e55c0d --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet +{ + internal class ComputeFleetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ComputeFleetOperationSource(ArmClient client) + { + _client = client; + } + + ComputeFleetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ComputeFleetData.DeserializeComputeFleetData(document.RootElement); + return new ComputeFleetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ComputeFleetData.DeserializeComputeFleetData(document.RootElement); + return new ComputeFleetResource(_client, data); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalInformationSettingName.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalInformationSettingName.cs new file mode 100644 index 0000000000000..9daa9bdce7a9a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalInformationSettingName.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the name of the setting to which the content applies. Possible values + /// are: FirstLogonCommands and AutoLogon. + /// + public readonly partial struct AdditionalInformationSettingName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AdditionalInformationSettingName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutoLogonValue = "AutoLogon"; + private const string FirstLogonCommandsValue = "FirstLogonCommands"; + + /// AutoLogon setting. + public static AdditionalInformationSettingName AutoLogon { get; } = new AdditionalInformationSettingName(AutoLogonValue); + /// FirstLogonCommands setting. + public static AdditionalInformationSettingName FirstLogonCommands { get; } = new AdditionalInformationSettingName(FirstLogonCommandsValue); + /// Determines if two values are the same. + public static bool operator ==(AdditionalInformationSettingName left, AdditionalInformationSettingName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AdditionalInformationSettingName left, AdditionalInformationSettingName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AdditionalInformationSettingName(string value) => new AdditionalInformationSettingName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AdditionalInformationSettingName other && Equals(other); + /// + public bool Equals(AdditionalInformationSettingName 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.Serialization.cs new file mode 100644 index 0000000000000..bea5e59707db6 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.Serialization.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class CapacityReservationProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CapacityReservationProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(CapacityReservationGroup)) + { + writer.WritePropertyName("capacityReservationGroup"u8); + JsonSerializer.Serialize(writer, CapacityReservationGroup); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CapacityReservationProfile 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(CapacityReservationProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCapacityReservationProfile(document.RootElement, options); + } + + internal static CapacityReservationProfile DeserializeCapacityReservationProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WritableSubResource capacityReservationGroup = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capacityReservationGroup"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityReservationGroup = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CapacityReservationProfile(capacityReservationGroup, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CapacityReservationProfile)} does not support writing '{options.Format}' format."); + } + } + + CapacityReservationProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCapacityReservationProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CapacityReservationProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.cs new file mode 100644 index 0000000000000..06dc7c1cedf40 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.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; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// The parameters of a capacity reservation Profile. + internal partial class CapacityReservationProfile + { + /// + /// 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 . + public CapacityReservationProfile() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the capacity reservation group resource id that should be used for + /// allocating the virtual machine or scaleset vm instances provided enough + /// capacity has been reserved. Please refer to https://aka.ms/CapacityReservation + /// for more details. + /// + /// Keeps track of any properties unknown to the library. + internal CapacityReservationProfile(WritableSubResource capacityReservationGroup, IDictionary serializedAdditionalRawData) + { + CapacityReservationGroup = capacityReservationGroup; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the capacity reservation group resource id that should be used for + /// allocating the virtual machine or scaleset vm instances provided enough + /// capacity has been reserved. Please refer to https://aka.ms/CapacityReservation + /// for more details. + /// + internal WritableSubResource CapacityReservationGroup { get; set; } + /// Gets or sets Id. + public ResourceIdentifier CapacityReservationGroupId + { + get => CapacityReservationGroup is null ? default : CapacityReservationGroup.Id; + set + { + if (CapacityReservationGroup is null) + CapacityReservationGroup = new WritableSubResource(); + CapacityReservationGroup.Id = value; + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.Serialization.cs new file mode 100644 index 0000000000000..d102ec8a91e47 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetApiError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetApiError)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (Optional.IsCollectionDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStartArray(); + foreach (var item in Details) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Innererror)) + { + writer.WritePropertyName("innererror"u8); + writer.WriteObjectValue(Innererror, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetApiError 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(ComputeFleetApiError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetApiError(document.RootElement, options); + } + + internal static ComputeFleetApiError DeserializeComputeFleetApiError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string target = default; + string message = default; + IReadOnlyList details = default; + ComputeFleetInnerError innererror = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetApiErrorInfo.DeserializeComputeFleetApiErrorInfo(item, options)); + } + details = array; + continue; + } + if (property.NameEquals("innererror"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + innererror = ComputeFleetInnerError.DeserializeComputeFleetInnerError(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetApiError( + code, + target, + message, + details ?? new ChangeTrackingList(), + innererror, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetApiError)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetApiError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetApiError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetApiError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.cs new file mode 100644 index 0000000000000..667edfee4a511 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// ApiError for Fleet. + public partial class ComputeFleetApiError + { + /// + /// 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 ComputeFleetApiError() + { + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The error code. + /// The target of the particular error. + /// The error message. + /// The API error details. + /// The API inner error. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetApiError(string code, string target, string message, IReadOnlyList details, ComputeFleetInnerError innererror, IDictionary serializedAdditionalRawData) + { + Code = code; + Target = target; + Message = message; + Details = details; + Innererror = innererror; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The error code. + public string Code { get; } + /// The target of the particular error. + public string Target { get; } + /// The error message. + public string Message { get; } + /// The API error details. + public IReadOnlyList Details { get; } + /// The API inner error. + public ComputeFleetInnerError Innererror { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.Serialization.cs new file mode 100644 index 0000000000000..79e521e9c5ac8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetApiErrorInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetApiErrorInfo)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetApiErrorInfo 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(ComputeFleetApiErrorInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetApiErrorInfo(document.RootElement, options); + } + + internal static ComputeFleetApiErrorInfo DeserializeComputeFleetApiErrorInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string target = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetApiErrorInfo(code, target, message, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetApiErrorInfo)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetApiErrorInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetApiErrorInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetApiErrorInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.cs new file mode 100644 index 0000000000000..e98709c31a714 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// API error base. + public partial class ComputeFleetApiErrorInfo + { + /// + /// 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 ComputeFleetApiErrorInfo() + { + } + + /// Initializes a new instance of . + /// The error code. + /// The target of the particular error. + /// The error message. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetApiErrorInfo(string code, string target, string message, IDictionary serializedAdditionalRawData) + { + Code = code; + Target = target; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The error code. + public string Code { get; } + /// The target of the particular error. + public string Target { get; } + /// The error message. + public string Message { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.Serialization.cs new file mode 100644 index 0000000000000..e9b1c78f85dea --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetApplicationProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetApplicationProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(GalleryApplications)) + { + writer.WritePropertyName("galleryApplications"u8); + writer.WriteStartArray(); + foreach (var item in GalleryApplications) + { + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetApplicationProfile 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(ComputeFleetApplicationProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetApplicationProfile(document.RootElement, options); + } + + internal static ComputeFleetApplicationProfile DeserializeComputeFleetApplicationProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList galleryApplications = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("galleryApplications"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmGalleryApplication.DeserializeComputeFleetVmGalleryApplication(item, options)); + } + galleryApplications = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetApplicationProfile(galleryApplications ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetApplicationProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetApplicationProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetApplicationProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetApplicationProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.cs new file mode 100644 index 0000000000000..57b0bb8014ef3 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Contains the list of gallery applications that should be made available to the + /// VM/VMSS + /// + internal partial class ComputeFleetApplicationProfile + { + /// + /// 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 . + public ComputeFleetApplicationProfile() + { + GalleryApplications = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Specifies the gallery applications that should be made available to the VM/VMSS. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetApplicationProfile(IList galleryApplications, IDictionary serializedAdditionalRawData) + { + GalleryApplications = galleryApplications; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the gallery applications that should be made available to the VM/VMSS. + public IList GalleryApplications { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.Serialization.cs new file mode 100644 index 0000000000000..03f7c0b171489 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetBootDiagnostics : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetBootDiagnostics)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(IsEnabled.Value); + } + if (Optional.IsDefined(StorageUri)) + { + writer.WritePropertyName("storageUri"u8); + writer.WriteStringValue(StorageUri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetBootDiagnostics 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(ComputeFleetBootDiagnostics)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetBootDiagnostics(document.RootElement, options); + } + + internal static ComputeFleetBootDiagnostics DeserializeComputeFleetBootDiagnostics(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + Uri storageUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("storageUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageUri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetBootDiagnostics(enabled, storageUri, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetBootDiagnostics)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetBootDiagnostics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetBootDiagnostics(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetBootDiagnostics)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.cs new file mode 100644 index 0000000000000..c3ab5545ef521 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Boot Diagnostics is a debugging feature which allows you to view Console Output + /// and Screenshot to diagnose VM status. You can easily view the output of your + /// console log. Azure also enables you to see a screenshot of the VM from the + /// hypervisor. + /// + public partial class ComputeFleetBootDiagnostics + { + /// + /// 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 . + public ComputeFleetBootDiagnostics() + { + } + + /// Initializes a new instance of . + /// Whether boot diagnostics should be enabled on the Virtual Machine. + /// + /// Uri of the storage account to use for placing the console output and + /// screenshot. If storageUri is not specified while enabling boot diagnostics, + /// managed storage will be used. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetBootDiagnostics(bool? isEnabled, Uri storageUri, IDictionary serializedAdditionalRawData) + { + IsEnabled = isEnabled; + StorageUri = storageUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether boot diagnostics should be enabled on the Virtual Machine. + public bool? IsEnabled { get; set; } + /// + /// Uri of the storage account to use for placing the console output and + /// screenshot. If storageUri is not specified while enabling boot diagnostics, + /// managed storage will be used. + /// + public Uri StorageUri { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetCachingType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetCachingType.cs new file mode 100644 index 0000000000000..876f6ecbddba1 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetCachingType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies the caching requirements. + public readonly partial struct ComputeFleetCachingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetCachingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string ReadOnlyValue = "ReadOnly"; + private const string ReadWriteValue = "ReadWrite"; + + /// 'None' is default for Standard Storage. + public static ComputeFleetCachingType None { get; } = new ComputeFleetCachingType(NoneValue); + /// 'ReadOnly' is default for Premium Storage. + public static ComputeFleetCachingType ReadOnly { get; } = new ComputeFleetCachingType(ReadOnlyValue); + /// 'ReadWrite' is default for OS Disk. + public static ComputeFleetCachingType ReadWrite { get; } = new ComputeFleetCachingType(ReadWriteValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetCachingType left, ComputeFleetCachingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetCachingType left, ComputeFleetCachingType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetCachingType(string value) => new ComputeFleetCachingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetCachingType other && Equals(other); + /// + public bool Equals(ComputeFleetCachingType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.Serialization.cs new file mode 100644 index 0000000000000..ffb1fc5d58d7e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetComputeProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetComputeProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("baseVirtualMachineProfile"u8); + writer.WriteObjectValue(BaseVirtualMachineProfile, options); + if (Optional.IsDefined(ComputeApiVersion)) + { + writer.WritePropertyName("computeApiVersion"u8); + writer.WriteStringValue(ComputeApiVersion); + } + if (Optional.IsDefined(PlatformFaultDomainCount)) + { + writer.WritePropertyName("platformFaultDomainCount"u8); + writer.WriteNumberValue(PlatformFaultDomainCount.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetComputeProfile 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(ComputeFleetComputeProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetComputeProfile(document.RootElement, options); + } + + internal static ComputeFleetComputeProfile DeserializeComputeFleetComputeProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetVmProfile baseVirtualMachineProfile = default; + string computeApiVersion = default; + int? platformFaultDomainCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("baseVirtualMachineProfile"u8)) + { + baseVirtualMachineProfile = ComputeFleetVmProfile.DeserializeComputeFleetVmProfile(property.Value, options); + continue; + } + if (property.NameEquals("computeApiVersion"u8)) + { + computeApiVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("platformFaultDomainCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + platformFaultDomainCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetComputeProfile(baseVirtualMachineProfile, computeApiVersion, platformFaultDomainCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetComputeProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetComputeProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetComputeProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetComputeProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.cs new file mode 100644 index 0000000000000..149c34e12ef4d --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Compute Profile to use for running user's workloads. + public partial class ComputeFleetComputeProfile + { + /// + /// 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 . + /// Base Virtual Machine Profile Properties to be specified according to "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". + /// is null. + public ComputeFleetComputeProfile(ComputeFleetVmProfile baseVirtualMachineProfile) + { + Argument.AssertNotNull(baseVirtualMachineProfile, nameof(baseVirtualMachineProfile)); + + BaseVirtualMachineProfile = baseVirtualMachineProfile; + } + + /// Initializes a new instance of . + /// Base Virtual Machine Profile Properties to be specified according to "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". + /// + /// Specifies the Microsoft.Compute API version to use when creating underlying Virtual Machine scale sets and Virtual Machines. + /// The default value will be the latest supported computeApiVersion by Compute Fleet. + /// + /// + /// Specifies the number of fault domains to use when creating the underlying VMSS. + /// A fault domain is a logical group of hardware within an Azure datacenter. + /// VMs in the same fault domain share a common power source and network switch. + /// If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible). + /// This property cannot be updated. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetComputeProfile(ComputeFleetVmProfile baseVirtualMachineProfile, string computeApiVersion, int? platformFaultDomainCount, IDictionary serializedAdditionalRawData) + { + BaseVirtualMachineProfile = baseVirtualMachineProfile; + ComputeApiVersion = computeApiVersion; + PlatformFaultDomainCount = platformFaultDomainCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetComputeProfile() + { + } + + /// Base Virtual Machine Profile Properties to be specified according to "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". + public ComputeFleetVmProfile BaseVirtualMachineProfile { get; set; } + /// + /// Specifies the Microsoft.Compute API version to use when creating underlying Virtual Machine scale sets and Virtual Machines. + /// The default value will be the latest supported computeApiVersion by Compute Fleet. + /// + public string ComputeApiVersion { get; set; } + /// + /// Specifies the number of fault domains to use when creating the underlying VMSS. + /// A fault domain is a logical group of hardware within an Azure datacenter. + /// VMs in the same fault domain share a common power source and network switch. + /// If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible). + /// This property cannot be updated. + /// + public int? PlatformFaultDomainCount { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.Serialization.cs new file mode 100644 index 0000000000000..16ec9939b8431 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetDiagnosticsProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetDiagnosticsProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(BootDiagnostics)) + { + writer.WritePropertyName("bootDiagnostics"u8); + writer.WriteObjectValue(BootDiagnostics, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetDiagnosticsProfile 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(ComputeFleetDiagnosticsProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetDiagnosticsProfile(document.RootElement, options); + } + + internal static ComputeFleetDiagnosticsProfile DeserializeComputeFleetDiagnosticsProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetBootDiagnostics bootDiagnostics = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bootDiagnostics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bootDiagnostics = ComputeFleetBootDiagnostics.DeserializeComputeFleetBootDiagnostics(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetDiagnosticsProfile(bootDiagnostics, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetDiagnosticsProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetDiagnosticsProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetDiagnosticsProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetDiagnosticsProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.cs new file mode 100644 index 0000000000000..61135e8781dd0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. + internal partial class ComputeFleetDiagnosticsProfile + { + /// + /// 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 . + public ComputeFleetDiagnosticsProfile() + { + } + + /// Initializes a new instance of . + /// + /// Boot Diagnostics is a debugging feature which allows you to view Console Output + /// and Screenshot to diagnose VM status. **NOTE**: If storageUri is being + /// specified then ensure that the storage account is in the same region and + /// subscription as the VM. You can easily view the output of your console log. + /// Azure also enables you to see a screenshot of the VM from the hypervisor. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetDiagnosticsProfile(ComputeFleetBootDiagnostics bootDiagnostics, IDictionary serializedAdditionalRawData) + { + BootDiagnostics = bootDiagnostics; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Boot Diagnostics is a debugging feature which allows you to view Console Output + /// and Screenshot to diagnose VM status. **NOTE**: If storageUri is being + /// specified then ensure that the storage account is in the same region and + /// subscription as the VM. You can easily view the output of your console log. + /// Azure also enables you to see a screenshot of the VM from the hypervisor. + /// + public ComputeFleetBootDiagnostics BootDiagnostics { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskOption.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskOption.cs new file mode 100644 index 0000000000000..c29a7c40577fe --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskOption.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies the ephemeral disk option for operating system disk. + public readonly partial struct ComputeFleetDiffDiskOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetDiffDiskOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LocalValue = "Local"; + + /// Local Option. + public static ComputeFleetDiffDiskOption Local { get; } = new ComputeFleetDiffDiskOption(LocalValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetDiffDiskOption left, ComputeFleetDiffDiskOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetDiffDiskOption left, ComputeFleetDiffDiskOption right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetDiffDiskOption(string value) => new ComputeFleetDiffDiskOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetDiffDiskOption other && Equals(other); + /// + public bool Equals(ComputeFleetDiffDiskOption 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskPlacement.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskPlacement.cs new file mode 100644 index 0000000000000..49911cf9e4249 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskPlacement.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the ephemeral disk placement for operating system disk. This property + /// can be used by user in the request to choose the location i.e, cache disk or + /// resource disk space for Ephemeral OS disk provisioning. For more information on + /// Ephemeral OS disk size requirements, please refer Ephemeral OS disk size + /// requirements for Windows VM at + /// https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements + /// and Linux VM at + /// https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements + /// Minimum api-version for NvmeDisk: 2024-03-01. + /// + public readonly partial struct ComputeFleetDiffDiskPlacement : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetDiffDiskPlacement(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CacheDiskValue = "CacheDisk"; + private const string ResourceDiskValue = "ResourceDisk"; + private const string NvmeDiskValue = "NvmeDisk"; + + /// CacheDisk option. + public static ComputeFleetDiffDiskPlacement CacheDisk { get; } = new ComputeFleetDiffDiskPlacement(CacheDiskValue); + /// Resource Disk option. + public static ComputeFleetDiffDiskPlacement ResourceDisk { get; } = new ComputeFleetDiffDiskPlacement(ResourceDiskValue); + /// NvmeDisk option. + public static ComputeFleetDiffDiskPlacement NvmeDisk { get; } = new ComputeFleetDiffDiskPlacement(NvmeDiskValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetDiffDiskPlacement left, ComputeFleetDiffDiskPlacement right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetDiffDiskPlacement left, ComputeFleetDiffDiskPlacement right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetDiffDiskPlacement(string value) => new ComputeFleetDiffDiskPlacement(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetDiffDiskPlacement other && Equals(other); + /// + public bool Equals(ComputeFleetDiffDiskPlacement 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.Serialization.cs new file mode 100644 index 0000000000000..6aca5ab4dda3b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetDiffDiskSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetDiffDiskSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Option)) + { + writer.WritePropertyName("option"u8); + writer.WriteStringValue(Option.Value.ToString()); + } + if (Optional.IsDefined(Placement)) + { + writer.WritePropertyName("placement"u8); + writer.WriteStringValue(Placement.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetDiffDiskSettings 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(ComputeFleetDiffDiskSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetDiffDiskSettings(document.RootElement, options); + } + + internal static ComputeFleetDiffDiskSettings DeserializeComputeFleetDiffDiskSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetDiffDiskOption? option = default; + ComputeFleetDiffDiskPlacement? placement = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("option"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + option = new ComputeFleetDiffDiskOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("placement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + placement = new ComputeFleetDiffDiskPlacement(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetDiffDiskSettings(option, placement, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetDiffDiskSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetDiffDiskSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetDiffDiskSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetDiffDiskSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.cs new file mode 100644 index 0000000000000..8e836fbbf15aa --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Describes the parameters of ephemeral disk settings that can be specified for + /// operating system disk. **Note:** The ephemeral disk settings can only be + /// specified for managed disk. + /// + public partial class ComputeFleetDiffDiskSettings + { + /// + /// 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 . + public ComputeFleetDiffDiskSettings() + { + } + + /// Initializes a new instance of . + /// Specifies the ephemeral disk settings for operating system disk. + /// + /// Specifies the ephemeral disk placement for operating system disk. Possible + /// values are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: + /// **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** + /// is used. Refer to the VM size documentation for Windows VM at + /// https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + /// https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM + /// sizes exposes a cache disk. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetDiffDiskSettings(ComputeFleetDiffDiskOption? option, ComputeFleetDiffDiskPlacement? placement, IDictionary serializedAdditionalRawData) + { + Option = option; + Placement = placement; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the ephemeral disk settings for operating system disk. + public ComputeFleetDiffDiskOption? Option { get; set; } + /// + /// Specifies the ephemeral disk placement for operating system disk. Possible + /// values are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: + /// **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** + /// is used. Refer to the VM size documentation for Windows VM at + /// https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + /// https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM + /// sizes exposes a cache disk. + /// + public ComputeFleetDiffDiskPlacement? Placement { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskControllerType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskControllerType.cs new file mode 100644 index 0000000000000..d00b4e4c4badb --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskControllerType.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the disk controller type configured for the VM and + /// VirtualMachineScaleSet. This property is only supported for virtual machines + /// whose operating system disk and VM sku supports Generation 2 + /// (https://docs.microsoft.com/en-us/azure/virtual-machines/generation-2), please + /// check the HyperVGenerations capability returned as part of VM sku capabilities + /// in the response of Microsoft.Compute SKUs api for the region contains V2 + /// (https://docs.microsoft.com/rest/api/compute/resourceskus/list). For more + /// information about Disk Controller Types supported please refer to + /// https://aka.ms/azure-diskcontrollertypes. + /// + public readonly partial struct ComputeFleetDiskControllerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetDiskControllerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ScsiValue = "SCSI"; + private const string NvmeValue = "NVMe"; + + /// SCSI disk type. + public static ComputeFleetDiskControllerType Scsi { get; } = new ComputeFleetDiskControllerType(ScsiValue); + /// NVMe disk type. + public static ComputeFleetDiskControllerType Nvme { get; } = new ComputeFleetDiskControllerType(NvmeValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetDiskControllerType left, ComputeFleetDiskControllerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetDiskControllerType left, ComputeFleetDiskControllerType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetDiskControllerType(string value) => new ComputeFleetDiskControllerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetDiskControllerType other && Equals(other); + /// + public bool Equals(ComputeFleetDiskControllerType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskCreateOptionType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskCreateOptionType.cs new file mode 100644 index 0000000000000..ca045ef145f62 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskCreateOptionType.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies how the virtual machine should be created. + public readonly partial struct ComputeFleetDiskCreateOptionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetDiskCreateOptionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FromImageValue = "FromImage"; + private const string EmptyValue = "Empty"; + private const string AttachValue = "Attach"; + private const string CopyValue = "Copy"; + private const string RestoreValue = "Restore"; + + /// + /// This value is used when you are using an image to create the virtual machine. + /// If you are using a platform image, you also use the imageReference element + /// described above. If you are using a marketplace image, you also use the + /// plan element previously described. + /// + public static ComputeFleetDiskCreateOptionType FromImage { get; } = new ComputeFleetDiskCreateOptionType(FromImageValue); + /// This value is used when creating an empty data disk. + public static ComputeFleetDiskCreateOptionType Empty { get; } = new ComputeFleetDiskCreateOptionType(EmptyValue); + /// This value is used when you are using a specialized disk to create the virtual machine. + public static ComputeFleetDiskCreateOptionType Attach { get; } = new ComputeFleetDiskCreateOptionType(AttachValue); + /// This value is used to create a data disk from a snapshot or another disk. + public static ComputeFleetDiskCreateOptionType Copy { get; } = new ComputeFleetDiskCreateOptionType(CopyValue); + /// This value is used to create a data disk from a disk restore point. + public static ComputeFleetDiskCreateOptionType Restore { get; } = new ComputeFleetDiskCreateOptionType(RestoreValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetDiskCreateOptionType left, ComputeFleetDiskCreateOptionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetDiskCreateOptionType left, ComputeFleetDiskCreateOptionType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetDiskCreateOptionType(string value) => new ComputeFleetDiskCreateOptionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetDiskCreateOptionType other && Equals(other); + /// + public bool Equals(ComputeFleetDiskCreateOptionType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskDeleteOptionType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskDeleteOptionType.cs new file mode 100644 index 0000000000000..911ee07aa984c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskDeleteOptionType.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 Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the behavior of the managed disk when the VM gets deleted, for + /// example whether the managed disk is deleted or detached. Supported values are: + /// **Delete.** If this value is used, the managed disk is deleted when VM gets + /// deleted. **Detach.** If this value is used, the managed disk is retained after + /// VM gets deleted. Minimum api-version: 2021-03-01. + /// + public readonly partial struct ComputeFleetDiskDeleteOptionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetDiskDeleteOptionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "Delete"; + private const string DetachValue = "Detach"; + + /// If this value is used, the managed disk is deleted when VM gets deleted. + public static ComputeFleetDiskDeleteOptionType Delete { get; } = new ComputeFleetDiskDeleteOptionType(DeleteValue); + /// If this value is used, the managed disk is retained after VM gets deleted. + public static ComputeFleetDiskDeleteOptionType Detach { get; } = new ComputeFleetDiskDeleteOptionType(DetachValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetDiskDeleteOptionType left, ComputeFleetDiskDeleteOptionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetDiskDeleteOptionType left, ComputeFleetDiskDeleteOptionType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetDiskDeleteOptionType(string value) => new ComputeFleetDiskDeleteOptionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetDiskDeleteOptionType other && Equals(other); + /// + public bool Equals(ComputeFleetDiskDeleteOptionType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDomainNameLabelScopeType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDomainNameLabelScopeType.cs new file mode 100644 index 0000000000000..8a30a08da20cb --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDomainNameLabelScopeType.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// The Domain name label scope.The concatenation of the hashed domain name label + /// that generated according to the policy from domain name label scope and vm + /// index will be the domain name labels of the PublicIPAddress resources that will + /// be created + /// + public readonly partial struct ComputeFleetDomainNameLabelScopeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetDomainNameLabelScopeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TenantReuseValue = "TenantReuse"; + private const string SubscriptionReuseValue = "SubscriptionReuse"; + private const string ResourceGroupReuseValue = "ResourceGroupReuse"; + private const string NoReuseValue = "NoReuse"; + + /// TenantReuse type. + public static ComputeFleetDomainNameLabelScopeType TenantReuse { get; } = new ComputeFleetDomainNameLabelScopeType(TenantReuseValue); + /// SubscriptionReuse type. + public static ComputeFleetDomainNameLabelScopeType SubscriptionReuse { get; } = new ComputeFleetDomainNameLabelScopeType(SubscriptionReuseValue); + /// ResourceGroupReuse type. + public static ComputeFleetDomainNameLabelScopeType ResourceGroupReuse { get; } = new ComputeFleetDomainNameLabelScopeType(ResourceGroupReuseValue); + /// NoReuse type. + public static ComputeFleetDomainNameLabelScopeType NoReuse { get; } = new ComputeFleetDomainNameLabelScopeType(NoReuseValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetDomainNameLabelScopeType left, ComputeFleetDomainNameLabelScopeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetDomainNameLabelScopeType left, ComputeFleetDomainNameLabelScopeType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetDomainNameLabelScopeType(string value) => new ComputeFleetDomainNameLabelScopeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetDomainNameLabelScopeType other && Equals(other); + /// + public bool Equals(ComputeFleetDomainNameLabelScopeType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.Serialization.cs new file mode 100644 index 0000000000000..02179b39f216e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetEncryptionIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetEncryptionIdentity)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(UserAssignedIdentityResourceId)) + { + writer.WritePropertyName("userAssignedIdentityResourceId"u8); + writer.WriteStringValue(UserAssignedIdentityResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetEncryptionIdentity 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(ComputeFleetEncryptionIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetEncryptionIdentity(document.RootElement, options); + } + + internal static ComputeFleetEncryptionIdentity DeserializeComputeFleetEncryptionIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier userAssignedIdentityResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("userAssignedIdentityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedIdentityResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetEncryptionIdentity(userAssignedIdentityResourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetEncryptionIdentity)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetEncryptionIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetEncryptionIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetEncryptionIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.cs new file mode 100644 index 0000000000000..160e3df57d3c8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the Managed Identity used by ADE to get access token for keyvault + /// operations. + /// + internal partial class ComputeFleetEncryptionIdentity + { + /// + /// 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 . + public ComputeFleetEncryptionIdentity() + { + } + + /// Initializes a new instance of . + /// Specifies ARM Resource ID of one of the user identities associated with the VM. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetEncryptionIdentity(ResourceIdentifier userAssignedIdentityResourceId, IDictionary serializedAdditionalRawData) + { + UserAssignedIdentityResourceId = userAssignedIdentityResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies ARM Resource ID of one of the user identities associated with the VM. + public ResourceIdentifier UserAssignedIdentityResourceId { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEvictionPolicy.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEvictionPolicy.cs new file mode 100644 index 0000000000000..07b0776ceb2cb --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEvictionPolicy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Different kind of eviction policies. + public readonly partial struct ComputeFleetEvictionPolicy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetEvictionPolicy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "Delete"; + private const string DeallocateValue = "Deallocate"; + + /// When evicted, the Spot VM will be deleted and the corresponding capacity will be updated to reflect this. + public static ComputeFleetEvictionPolicy Delete { get; } = new ComputeFleetEvictionPolicy(DeleteValue); + /// When evicted, the Spot VM will be deallocated/stopped. + public static ComputeFleetEvictionPolicy Deallocate { get; } = new ComputeFleetEvictionPolicy(DeallocateValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetEvictionPolicy left, ComputeFleetEvictionPolicy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetEvictionPolicy left, ComputeFleetEvictionPolicy right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetEvictionPolicy(string value) => new ComputeFleetEvictionPolicy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetEvictionPolicy other && Equals(other); + /// + public bool Equals(ComputeFleetEvictionPolicy 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetIPVersion.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetIPVersion.cs new file mode 100644 index 0000000000000..cbf999f7796ae --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetIPVersion.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Available from Api-Version 2017-03-30 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + /// values are: 'IPv4' and 'IPv6'. + /// + public readonly partial struct ComputeFleetIPVersion : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetIPVersion(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IPv4Value = "IPv4"; + private const string IPv6Value = "IPv6"; + + /// IPv4 version. + public static ComputeFleetIPVersion IPv4 { get; } = new ComputeFleetIPVersion(IPv4Value); + /// IPv6 version. + public static ComputeFleetIPVersion IPv6 { get; } = new ComputeFleetIPVersion(IPv6Value); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetIPVersion left, ComputeFleetIPVersion right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetIPVersion left, ComputeFleetIPVersion right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetIPVersion(string value) => new ComputeFleetIPVersion(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetIPVersion other && Equals(other); + /// + public bool Equals(ComputeFleetIPVersion 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.Serialization.cs new file mode 100644 index 0000000000000..774950f0c8e3e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetImageReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetImageReference)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Publisher)) + { + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + } + if (Optional.IsDefined(Offer)) + { + writer.WritePropertyName("offer"u8); + writer.WriteStringValue(Offer); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteStringValue(Sku); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (options.Format != "W" && Optional.IsDefined(ExactVersion)) + { + writer.WritePropertyName("exactVersion"u8); + writer.WriteStringValue(ExactVersion); + } + if (Optional.IsDefined(SharedGalleryImageId)) + { + writer.WritePropertyName("sharedGalleryImageId"u8); + writer.WriteStringValue(SharedGalleryImageId); + } + if (Optional.IsDefined(CommunityGalleryImageId)) + { + writer.WritePropertyName("communityGalleryImageId"u8); + writer.WriteStringValue(CommunityGalleryImageId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetImageReference 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(ComputeFleetImageReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetImageReference(document.RootElement, options); + } + + internal static ComputeFleetImageReference DeserializeComputeFleetImageReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string publisher = default; + string offer = default; + string sku = default; + string version = default; + string exactVersion = default; + string sharedGalleryImageId = default; + string communityGalleryImageId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("publisher"u8)) + { + publisher = property.Value.GetString(); + continue; + } + if (property.NameEquals("offer"u8)) + { + offer = property.Value.GetString(); + continue; + } + if (property.NameEquals("sku"u8)) + { + sku = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("exactVersion"u8)) + { + exactVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("sharedGalleryImageId"u8)) + { + sharedGalleryImageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("communityGalleryImageId"u8)) + { + communityGalleryImageId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetImageReference( + id, + publisher, + offer, + sku, + version, + exactVersion, + sharedGalleryImageId, + communityGalleryImageId, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetImageReference)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetImageReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetImageReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetImageReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.cs new file mode 100644 index 0000000000000..942f9ac529cef --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.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 Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies information about the image to use. You can specify information about + /// platform images, marketplace images, or virtual machine images. This element is + /// required when you want to use a platform image, marketplace image, or virtual + /// machine image, but is not used in other creation operations. NOTE: Image + /// reference publisher and offer can only be set when you create the scale set. + /// + public partial class ComputeFleetImageReference + { + /// + /// 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 . + public ComputeFleetImageReference() + { + } + + /// Initializes a new instance of . + /// Resource Id. + /// The image publisher. + /// + /// Specifies the offer of the platform image or marketplace image used to create + /// the virtual machine. + /// + /// The image SKU. + /// + /// Specifies the version of the platform image or marketplace image used to create + /// the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + /// Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest + /// version of an image available at deploy time. Even if you use 'latest', the VM + /// image will not automatically update after deploy time even if a new version + /// becomes available. Please do not use field 'version' for gallery image + /// deployment, gallery image should always use 'id' field for deployment, to use 'latest' + /// version of gallery image, just set + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + /// in the 'id' field without version input. + /// + /// + /// Specifies in decimal numbers, the version of platform image or marketplace + /// image used to create the virtual machine. This readonly field differs from 'version', + /// only if the value specified in 'version' field is 'latest'. + /// + /// + /// Specified the shared gallery image unique id for vm deployment. This can be + /// fetched from shared gallery image GET call. + /// + /// + /// Specified the community gallery image unique id for vm deployment. This can be + /// fetched from community gallery image GET call. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetImageReference(ResourceIdentifier id, string publisher, string offer, string sku, string version, string exactVersion, string sharedGalleryImageId, string communityGalleryImageId, IDictionary serializedAdditionalRawData) + { + Id = id; + Publisher = publisher; + Offer = offer; + Sku = sku; + Version = version; + ExactVersion = exactVersion; + SharedGalleryImageId = sharedGalleryImageId; + CommunityGalleryImageId = communityGalleryImageId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource Id. + public ResourceIdentifier Id { get; set; } + /// The image publisher. + public string Publisher { get; set; } + /// + /// Specifies the offer of the platform image or marketplace image used to create + /// the virtual machine. + /// + public string Offer { get; set; } + /// The image SKU. + public string Sku { get; set; } + /// + /// Specifies the version of the platform image or marketplace image used to create + /// the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + /// Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest + /// version of an image available at deploy time. Even if you use 'latest', the VM + /// image will not automatically update after deploy time even if a new version + /// becomes available. Please do not use field 'version' for gallery image + /// deployment, gallery image should always use 'id' field for deployment, to use 'latest' + /// version of gallery image, just set + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + /// in the 'id' field without version input. + /// + public string Version { get; set; } + /// + /// Specifies in decimal numbers, the version of platform image or marketplace + /// image used to create the virtual machine. This readonly field differs from 'version', + /// only if the value specified in 'version' field is 'latest'. + /// + public string ExactVersion { get; } + /// + /// Specified the shared gallery image unique id for vm deployment. This can be + /// fetched from shared gallery image GET call. + /// + public string SharedGalleryImageId { get; set; } + /// + /// Specified the community gallery image unique id for vm deployment. This can be + /// fetched from community gallery image GET call. + /// + public string CommunityGalleryImageId { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.Serialization.cs new file mode 100644 index 0000000000000..e255795755e6c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetInnerError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetInnerError)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ExceptionType)) + { + writer.WritePropertyName("exceptionType"u8); + writer.WriteStringValue(ExceptionType); + } + if (Optional.IsDefined(ErrorDetail)) + { + writer.WritePropertyName("errorDetail"u8); + writer.WriteStringValue(ErrorDetail); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetInnerError 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(ComputeFleetInnerError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetInnerError(document.RootElement, options); + } + + internal static ComputeFleetInnerError DeserializeComputeFleetInnerError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string exceptionType = default; + string errorDetail = 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("errorDetail"u8)) + { + errorDetail = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetInnerError(exceptionType, errorDetail, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetInnerError)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetInnerError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetInnerError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetInnerError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.cs new file mode 100644 index 0000000000000..a75c2c26722fb --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Inner error details. + public partial class ComputeFleetInnerError + { + /// + /// 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 ComputeFleetInnerError() + { + } + + /// Initializes a new instance of . + /// The exception type. + /// The internal error message or exception dump. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetInnerError(string exceptionType, string errorDetail, IDictionary serializedAdditionalRawData) + { + ExceptionType = exceptionType; + ErrorDetail = errorDetail; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The exception type. + public string ExceptionType { get; } + /// The internal error message or exception dump. + public string ErrorDetail { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.Serialization.cs new file mode 100644 index 0000000000000..979a435b17d9b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetKeyVaultSecretReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetKeyVaultSecretReference)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("secretUrl"u8); + writer.WriteStringValue(SecretUri.AbsoluteUri); + writer.WritePropertyName("sourceVault"u8); + JsonSerializer.Serialize(writer, SourceVault); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetKeyVaultSecretReference 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(ComputeFleetKeyVaultSecretReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetKeyVaultSecretReference(document.RootElement, options); + } + + internal static ComputeFleetKeyVaultSecretReference DeserializeComputeFleetKeyVaultSecretReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri secretUrl = default; + WritableSubResource sourceVault = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secretUrl"u8)) + { + secretUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceVault"u8)) + { + sourceVault = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetKeyVaultSecretReference(secretUrl, sourceVault, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetKeyVaultSecretReference)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetKeyVaultSecretReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetKeyVaultSecretReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetKeyVaultSecretReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.cs new file mode 100644 index 0000000000000..05224e986a356 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a reference to Key Vault Secret. + public partial class ComputeFleetKeyVaultSecretReference + { + /// + /// 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 URL referencing a secret in a Key Vault. + /// The relative URL of the Key Vault containing the secret. + /// or is null. + public ComputeFleetKeyVaultSecretReference(Uri secretUri, WritableSubResource sourceVault) + { + Argument.AssertNotNull(secretUri, nameof(secretUri)); + Argument.AssertNotNull(sourceVault, nameof(sourceVault)); + + SecretUri = secretUri; + SourceVault = sourceVault; + } + + /// Initializes a new instance of . + /// The URL referencing a secret in a Key Vault. + /// The relative URL of the Key Vault containing the secret. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetKeyVaultSecretReference(Uri secretUri, WritableSubResource sourceVault, IDictionary serializedAdditionalRawData) + { + SecretUri = secretUri; + SourceVault = sourceVault; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetKeyVaultSecretReference() + { + } + + /// The URL referencing a secret in a Key Vault. + public Uri SecretUri { get; set; } + /// The relative URL of the Key Vault containing the secret. + internal WritableSubResource SourceVault { get; set; } + /// Gets or sets Id. + public ResourceIdentifier SourceVaultId + { + get => SourceVault is null ? default : SourceVault.Id; + set + { + if (SourceVault is null) + SourceVault = new WritableSubResource(); + SourceVault.Id = value; + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.Serialization.cs new file mode 100644 index 0000000000000..090b425e6ecfb --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetLinuxConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetLinuxConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IsPasswordAuthenticationDisabled)) + { + writer.WritePropertyName("disablePasswordAuthentication"u8); + writer.WriteBooleanValue(IsPasswordAuthenticationDisabled.Value); + } + if (Optional.IsDefined(Ssh)) + { + writer.WritePropertyName("ssh"u8); + writer.WriteObjectValue(Ssh, options); + } + if (Optional.IsDefined(IsVmAgentProvisioned)) + { + writer.WritePropertyName("provisionVMAgent"u8); + writer.WriteBooleanValue(IsVmAgentProvisioned.Value); + } + if (Optional.IsDefined(PatchSettings)) + { + writer.WritePropertyName("patchSettings"u8); + writer.WriteObjectValue(PatchSettings, options); + } + if (Optional.IsDefined(IsVmAgentPlatformUpdatesEnabled)) + { + writer.WritePropertyName("enableVMAgentPlatformUpdates"u8); + writer.WriteBooleanValue(IsVmAgentPlatformUpdatesEnabled.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetLinuxConfiguration 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(ComputeFleetLinuxConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetLinuxConfiguration(document.RootElement, options); + } + + internal static ComputeFleetLinuxConfiguration DeserializeComputeFleetLinuxConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? disablePasswordAuthentication = default; + ComputeFleetSshConfiguration ssh = default; + bool? provisionVmAgent = default; + ComputeFleetLinuxPatchSettings patchSettings = default; + bool? enableVmAgentPlatformUpdates = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disablePasswordAuthentication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disablePasswordAuthentication = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("ssh"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ssh = ComputeFleetSshConfiguration.DeserializeComputeFleetSshConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("provisionVMAgent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisionVmAgent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("patchSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchSettings = ComputeFleetLinuxPatchSettings.DeserializeComputeFleetLinuxPatchSettings(property.Value, options); + continue; + } + if (property.NameEquals("enableVMAgentPlatformUpdates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableVmAgentPlatformUpdates = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetLinuxConfiguration( + disablePasswordAuthentication, + ssh, + provisionVmAgent, + patchSettings, + enableVmAgentPlatformUpdates, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetLinuxConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetLinuxConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetLinuxConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetLinuxConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.cs new file mode 100644 index 0000000000000..0ec5e9fa09258 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the Linux operating system settings on the virtual machine. For a + /// list of supported Linux distributions, see [Linux on Azure-Endorsed + /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + /// + public partial class ComputeFleetLinuxConfiguration + { + /// + /// 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 . + public ComputeFleetLinuxConfiguration() + { + } + + /// Initializes a new instance of . + /// Specifies whether password authentication should be disabled. + /// Specifies the ssh key configuration for a Linux OS. + /// + /// Indicates whether virtual machine agent should be provisioned on the virtual + /// machine. When this property is not specified in the request body, default + /// behavior is to set it to true. This will ensure that VM Agent is installed on + /// the VM so that extensions can be added to the VM later. + /// + /// [Preview Feature] Specifies settings related to VM Guest Patching on Linux. + /// + /// Indicates whether VMAgent Platform Updates is enabled for the Linux virtual + /// machine. Default value is false. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetLinuxConfiguration(bool? isPasswordAuthenticationDisabled, ComputeFleetSshConfiguration ssh, bool? isVmAgentProvisioned, ComputeFleetLinuxPatchSettings patchSettings, bool? isVmAgentPlatformUpdatesEnabled, IDictionary serializedAdditionalRawData) + { + IsPasswordAuthenticationDisabled = isPasswordAuthenticationDisabled; + Ssh = ssh; + IsVmAgentProvisioned = isVmAgentProvisioned; + PatchSettings = patchSettings; + IsVmAgentPlatformUpdatesEnabled = isVmAgentPlatformUpdatesEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies whether password authentication should be disabled. + public bool? IsPasswordAuthenticationDisabled { get; set; } + /// Specifies the ssh key configuration for a Linux OS. + internal ComputeFleetSshConfiguration Ssh { get; set; } + /// The list of SSH public keys used to authenticate with linux based VMs. + public IList SshPublicKeys + { + get + { + if (Ssh is null) + Ssh = new ComputeFleetSshConfiguration(); + return Ssh.PublicKeys; + } + } + + /// + /// Indicates whether virtual machine agent should be provisioned on the virtual + /// machine. When this property is not specified in the request body, default + /// behavior is to set it to true. This will ensure that VM Agent is installed on + /// the VM so that extensions can be added to the VM later. + /// + public bool? IsVmAgentProvisioned { get; set; } + /// [Preview Feature] Specifies settings related to VM Guest Patching on Linux. + public ComputeFleetLinuxPatchSettings PatchSettings { get; set; } + /// + /// Indicates whether VMAgent Platform Updates is enabled for the Linux virtual + /// machine. Default value is false. + /// + public bool? IsVmAgentPlatformUpdatesEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchAssessmentMode.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchAssessmentMode.cs new file mode 100644 index 0000000000000..89cc72e7c1e70 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchAssessmentMode.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 Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + /// machine.

Possible values are:

**ImageDefault** - You + /// control the timing of patch assessments on a virtual machine.

+ /// **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + /// The property provisionVMAgent must be true. + ///
+ public readonly partial struct ComputeFleetLinuxPatchAssessmentMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetLinuxPatchAssessmentMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ImageDefaultValue = "ImageDefault"; + private const string AutomaticByPlatformValue = "AutomaticByPlatform"; + + /// You control the timing of patch assessments on a virtual machine. + public static ComputeFleetLinuxPatchAssessmentMode ImageDefault { get; } = new ComputeFleetLinuxPatchAssessmentMode(ImageDefaultValue); + /// The platform will trigger periodic patch assessments.The property provisionVMAgent must be true. + public static ComputeFleetLinuxPatchAssessmentMode AutomaticByPlatform { get; } = new ComputeFleetLinuxPatchAssessmentMode(AutomaticByPlatformValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetLinuxPatchAssessmentMode left, ComputeFleetLinuxPatchAssessmentMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetLinuxPatchAssessmentMode left, ComputeFleetLinuxPatchAssessmentMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetLinuxPatchAssessmentMode(string value) => new ComputeFleetLinuxPatchAssessmentMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetLinuxPatchAssessmentMode other && Equals(other); + /// + public bool Equals(ComputeFleetLinuxPatchAssessmentMode 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.Serialization.cs new file mode 100644 index 0000000000000..2df519de962a7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetLinuxPatchSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetLinuxPatchSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PatchMode)) + { + writer.WritePropertyName("patchMode"u8); + writer.WriteStringValue(PatchMode.Value.ToString()); + } + if (Optional.IsDefined(AssessmentMode)) + { + writer.WritePropertyName("assessmentMode"u8); + writer.WriteStringValue(AssessmentMode.Value.ToString()); + } + if (Optional.IsDefined(AutomaticByPlatformSettings)) + { + writer.WritePropertyName("automaticByPlatformSettings"u8); + writer.WriteObjectValue(AutomaticByPlatformSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetLinuxPatchSettings 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(ComputeFleetLinuxPatchSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetLinuxPatchSettings(document.RootElement, options); + } + + internal static ComputeFleetLinuxPatchSettings DeserializeComputeFleetLinuxPatchSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetLinuxVmGuestPatchMode? patchMode = default; + ComputeFleetLinuxPatchAssessmentMode? assessmentMode = default; + ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patchMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchMode = new ComputeFleetLinuxVmGuestPatchMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("assessmentMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assessmentMode = new ComputeFleetLinuxPatchAssessmentMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("automaticByPlatformSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + automaticByPlatformSettings = ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.DeserializeComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetLinuxPatchSettings(patchMode, assessmentMode, automaticByPlatformSettings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetLinuxPatchSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetLinuxPatchSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetLinuxPatchSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetLinuxPatchSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.cs new file mode 100644 index 0000000000000..1c5db0d29f565 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies settings related to VM Guest Patching on Linux. + public partial class ComputeFleetLinuxPatchSettings + { + /// + /// 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 . + public ComputeFleetLinuxPatchSettings() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - The + /// virtual machine's default patching configuration is used. <br /><br /> + /// **AutomaticByPlatform** - The virtual machine will be automatically updated by + /// the platform. The property provisionVMAgent must be true + /// + /// + /// Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + /// machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You + /// control the timing of patch assessments on a virtual machine. <br /><br /> + /// **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + /// The property provisionVMAgent must be true. + /// + /// + /// Specifies additional settings for patch mode AutomaticByPlatform in VM Guest + /// Patching on Linux. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetLinuxPatchSettings(ComputeFleetLinuxVmGuestPatchMode? patchMode, ComputeFleetLinuxPatchAssessmentMode? assessmentMode, ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings, IDictionary serializedAdditionalRawData) + { + PatchMode = patchMode; + AssessmentMode = assessmentMode; + AutomaticByPlatformSettings = automaticByPlatformSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - The + /// virtual machine's default patching configuration is used. <br /><br /> + /// **AutomaticByPlatform** - The virtual machine will be automatically updated by + /// the platform. The property provisionVMAgent must be true + /// + public ComputeFleetLinuxVmGuestPatchMode? PatchMode { get; set; } + /// + /// Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + /// machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You + /// control the timing of patch assessments on a virtual machine. <br /><br /> + /// **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + /// The property provisionVMAgent must be true. + /// + public ComputeFleetLinuxPatchAssessmentMode? AssessmentMode { get; set; } + /// + /// Specifies additional settings for patch mode AutomaticByPlatform in VM Guest + /// Patching on Linux. + /// + public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting.cs new file mode 100644 index 0000000000000..411ab05b0a2c0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting.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 Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the reboot setting for all AutomaticByPlatform patch installation + /// operations. + /// + public readonly partial struct ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string IfRequiredValue = "IfRequired"; + private const string NeverValue = "Never"; + private const string AlwaysValue = "Always"; + + /// Unknown Reboot setting. + public static ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting Unknown { get; } = new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(UnknownValue); + /// IfRequired Reboot setting. + public static ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting IfRequired { get; } = new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(IfRequiredValue); + /// Never Reboot setting. + public static ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting Never { get; } = new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(NeverValue); + /// Always Reboot setting. + public static ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting Always { get; } = new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(AlwaysValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting left, ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting left, ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(string value) => new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting other && Equals(other); + /// + public bool Equals(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.Serialization.cs new file mode 100644 index 0000000000000..2b8bbc2bc9932 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(RebootSetting)) + { + writer.WritePropertyName("rebootSetting"u8); + writer.WriteStringValue(RebootSetting.Value.ToString()); + } + if (Optional.IsDefined(IsBypassPlatformSafetyChecksOnUserScheduleEnabled)) + { + writer.WritePropertyName("bypassPlatformSafetyChecksOnUserSchedule"u8); + writer.WriteBooleanValue(IsBypassPlatformSafetyChecksOnUserScheduleEnabled.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings 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(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings(document.RootElement, options); + } + + internal static ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings DeserializeComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting? rebootSetting = default; + bool? bypassPlatformSafetyChecksOnUserSchedule = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rebootSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rebootSetting = new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(property.Value.GetString()); + continue; + } + if (property.NameEquals("bypassPlatformSafetyChecksOnUserSchedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bypassPlatformSafetyChecksOnUserSchedule = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings(rebootSetting, bypassPlatformSafetyChecksOnUserSchedule, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.cs new file mode 100644 index 0000000000000..432f844b39273 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies additional settings to be applied when patch mode AutomaticByPlatform + /// is selected in Linux patch settings. + /// + public partial class ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings + { + /// + /// 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 . + public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the reboot setting for all AutomaticByPlatform patch installation + /// operations. + /// + /// Enables customer to schedule patching without accidental upgrades. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting? rebootSetting, bool? isBypassPlatformSafetyChecksOnUserScheduleEnabled, IDictionary serializedAdditionalRawData) + { + RebootSetting = rebootSetting; + IsBypassPlatformSafetyChecksOnUserScheduleEnabled = isBypassPlatformSafetyChecksOnUserScheduleEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the reboot setting for all AutomaticByPlatform patch installation + /// operations. + /// + public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting? RebootSetting { get; set; } + /// Enables customer to schedule patching without accidental upgrades. + public bool? IsBypassPlatformSafetyChecksOnUserScheduleEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchMode.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchMode.cs new file mode 100644 index 0000000000000..277ca7b4e3c41 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchMode.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible. + /// + public readonly partial struct ComputeFleetLinuxVmGuestPatchMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetLinuxVmGuestPatchMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ImageDefaultValue = "ImageDefault"; + private const string AutomaticByPlatformValue = "AutomaticByPlatform"; + + /// The virtual machine's default patching configuration is used. + public static ComputeFleetLinuxVmGuestPatchMode ImageDefault { get; } = new ComputeFleetLinuxVmGuestPatchMode(ImageDefaultValue); + /// The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true. + public static ComputeFleetLinuxVmGuestPatchMode AutomaticByPlatform { get; } = new ComputeFleetLinuxVmGuestPatchMode(AutomaticByPlatformValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetLinuxVmGuestPatchMode left, ComputeFleetLinuxVmGuestPatchMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetLinuxVmGuestPatchMode left, ComputeFleetLinuxVmGuestPatchMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetLinuxVmGuestPatchMode(string value) => new ComputeFleetLinuxVmGuestPatchMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetLinuxVmGuestPatchMode other && Equals(other); + /// + public bool Equals(ComputeFleetLinuxVmGuestPatchMode 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkApiVersion.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkApiVersion.cs new file mode 100644 index 0000000000000..8e8b41743bc09 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkApiVersion.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// specifies the Microsoft.Network API version used when creating networking + /// resources in the Network Interface Configurations for Virtual Machine Scale Set + /// with orchestration mode 'Flexible' + /// + public readonly partial struct ComputeFleetNetworkApiVersion : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetNetworkApiVersion(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string V20201101Value = "2020-11-01"; + + /// Initial version supported. Later versions are supported as well. + public static ComputeFleetNetworkApiVersion V20201101 { get; } = new ComputeFleetNetworkApiVersion(V20201101Value); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetNetworkApiVersion left, ComputeFleetNetworkApiVersion right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetNetworkApiVersion left, ComputeFleetNetworkApiVersion right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetNetworkApiVersion(string value) => new ComputeFleetNetworkApiVersion(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetNetworkApiVersion other && Equals(other); + /// + public bool Equals(ComputeFleetNetworkApiVersion 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliaryMode.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliaryMode.cs new file mode 100644 index 0000000000000..27eb491f295cd --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliaryMode.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 Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies whether the Auxiliary mode is enabled for the Network Interface + /// resource. + /// + public readonly partial struct ComputeFleetNetworkInterfaceAuxiliaryMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetNetworkInterfaceAuxiliaryMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string AcceleratedConnectionsValue = "AcceleratedConnections"; + private const string FloatingValue = "Floating"; + + /// None Mode. + public static ComputeFleetNetworkInterfaceAuxiliaryMode None { get; } = new ComputeFleetNetworkInterfaceAuxiliaryMode(NoneValue); + /// AcceleratedConnections Mode. + public static ComputeFleetNetworkInterfaceAuxiliaryMode AcceleratedConnections { get; } = new ComputeFleetNetworkInterfaceAuxiliaryMode(AcceleratedConnectionsValue); + /// Floating Mode. + public static ComputeFleetNetworkInterfaceAuxiliaryMode Floating { get; } = new ComputeFleetNetworkInterfaceAuxiliaryMode(FloatingValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetNetworkInterfaceAuxiliaryMode left, ComputeFleetNetworkInterfaceAuxiliaryMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetNetworkInterfaceAuxiliaryMode left, ComputeFleetNetworkInterfaceAuxiliaryMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetNetworkInterfaceAuxiliaryMode(string value) => new ComputeFleetNetworkInterfaceAuxiliaryMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetNetworkInterfaceAuxiliaryMode other && Equals(other); + /// + public bool Equals(ComputeFleetNetworkInterfaceAuxiliaryMode 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliarySku.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliarySku.cs new file mode 100644 index 0000000000000..600d4967e83f3 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliarySku.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 Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies whether the Auxiliary sku is enabled for the Network Interface + /// resource. + /// + public readonly partial struct ComputeFleetNetworkInterfaceAuxiliarySku : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetNetworkInterfaceAuxiliarySku(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string A1Value = "A1"; + private const string A2Value = "A2"; + private const string A4Value = "A4"; + private const string A8Value = "A8"; + + /// no sku. + public static ComputeFleetNetworkInterfaceAuxiliarySku None { get; } = new ComputeFleetNetworkInterfaceAuxiliarySku(NoneValue); + /// A1 sku. + public static ComputeFleetNetworkInterfaceAuxiliarySku A1 { get; } = new ComputeFleetNetworkInterfaceAuxiliarySku(A1Value); + /// A2 sku. + public static ComputeFleetNetworkInterfaceAuxiliarySku A2 { get; } = new ComputeFleetNetworkInterfaceAuxiliarySku(A2Value); + /// A4 sku. + public static ComputeFleetNetworkInterfaceAuxiliarySku A4 { get; } = new ComputeFleetNetworkInterfaceAuxiliarySku(A4Value); + /// A8 sku. + public static ComputeFleetNetworkInterfaceAuxiliarySku A8 { get; } = new ComputeFleetNetworkInterfaceAuxiliarySku(A8Value); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetNetworkInterfaceAuxiliarySku left, ComputeFleetNetworkInterfaceAuxiliarySku right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetNetworkInterfaceAuxiliarySku left, ComputeFleetNetworkInterfaceAuxiliarySku right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetNetworkInterfaceAuxiliarySku(string value) => new ComputeFleetNetworkInterfaceAuxiliarySku(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetNetworkInterfaceAuxiliarySku other && Equals(other); + /// + public bool Equals(ComputeFleetNetworkInterfaceAuxiliarySku 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.Serialization.cs new file mode 100644 index 0000000000000..5e0a8b25b2e57 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetOSImageNotificationProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetOSImageNotificationProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NotBeforeTimeout)) + { + writer.WritePropertyName("notBeforeTimeout"u8); + writer.WriteStringValue(NotBeforeTimeout); + } + if (Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("enable"u8); + writer.WriteBooleanValue(IsEnabled.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetOSImageNotificationProfile 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(ComputeFleetOSImageNotificationProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetOSImageNotificationProfile(document.RootElement, options); + } + + internal static ComputeFleetOSImageNotificationProfile DeserializeComputeFleetOSImageNotificationProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string notBeforeTimeout = default; + bool? enable = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("notBeforeTimeout"u8)) + { + notBeforeTimeout = property.Value.GetString(); + continue; + } + if (property.NameEquals("enable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enable = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetOSImageNotificationProfile(notBeforeTimeout, enable, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetOSImageNotificationProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetOSImageNotificationProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetOSImageNotificationProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetOSImageNotificationProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.cs new file mode 100644 index 0000000000000..619a0dd51bcff --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies OS Image Scheduled Event related configurations. + public partial class ComputeFleetOSImageNotificationProfile + { + /// + /// 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 . + public ComputeFleetOSImageNotificationProfile() + { + } + + /// Initializes a new instance of . + /// + /// Length of time a Virtual Machine being reimaged or having its OS upgraded will + /// have to potentially approve the OS Image Scheduled Event before the event is + /// auto approved (timed out). The configuration is specified in ISO 8601 format, + /// and the value must not exceed 15 minutes (PT15M) + /// + /// Specifies whether the OS Image Scheduled event is enabled or disabled. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetOSImageNotificationProfile(string notBeforeTimeout, bool? isEnabled, IDictionary serializedAdditionalRawData) + { + NotBeforeTimeout = notBeforeTimeout; + IsEnabled = isEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Length of time a Virtual Machine being reimaged or having its OS upgraded will + /// have to potentially approve the OS Image Scheduled Event before the event is + /// auto approved (timed out). The configuration is specified in ISO 8601 format, + /// and the value must not exceed 15 minutes (PT15M) + /// + public string NotBeforeTimeout { get; set; } + /// Specifies whether the OS Image Scheduled event is enabled or disabled. + public bool? IsEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOperatingSystemType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOperatingSystemType.cs new file mode 100644 index 0000000000000..5591e628c43ab --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOperatingSystemType.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// This property allows you to specify the type of the OS that is included in the + /// disk if creating a VM from user-image or a specialized VHD. Possible values + /// are: **Windows,** **Linux.** + /// + public readonly partial struct ComputeFleetOperatingSystemType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetOperatingSystemType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WindowsValue = "Windows"; + private const string LinuxValue = "Linux"; + + /// Windows OS type. + public static ComputeFleetOperatingSystemType Windows { get; } = new ComputeFleetOperatingSystemType(WindowsValue); + /// Linux OS type. + public static ComputeFleetOperatingSystemType Linux { get; } = new ComputeFleetOperatingSystemType(LinuxValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetOperatingSystemType left, ComputeFleetOperatingSystemType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetOperatingSystemType left, ComputeFleetOperatingSystemType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetOperatingSystemType(string value) => new ComputeFleetOperatingSystemType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetOperatingSystemType other && Equals(other); + /// + public bool Equals(ComputeFleetOperatingSystemType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.Serialization.cs new file mode 100644 index 0000000000000..d573cb9046d8f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetPatch)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + if (Optional.IsDefined(Plan)) + { + writer.WritePropertyName("plan"u8); + JsonSerializer.Serialize(writer, Plan); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetPatch 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(ComputeFleetPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetPatch(document.RootElement, options); + } + + internal static ComputeFleetPatch DeserializeComputeFleetPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + ManagedServiceIdentity identity = default; + ArmPlan plan = default; + ComputeFleetProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("plan"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + plan = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ComputeFleetProperties.DeserializeComputeFleetProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetPatch(tags ?? new ChangeTrackingDictionary(), identity, plan, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetPatch)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.cs new file mode 100644 index 0000000000000..7c9440aec5185 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Fleet Update Model. + public partial class ComputeFleetPatch + { + /// + /// 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 . + public ComputeFleetPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Updatable managed service identity. + /// Updatable resource plan. + /// RP-specific updatable properties. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetPatch(IDictionary tags, ManagedServiceIdentity identity, ArmPlan plan, ComputeFleetProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Identity = identity; + Plan = plan; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// Updatable resource plan. + public ArmPlan Plan { get; set; } + /// RP-specific updatable properties. + public ComputeFleetProperties Properties { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs new file mode 100644 index 0000000000000..ef31137b79808 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(SpotPriorityProfile)) + { + writer.WritePropertyName("spotPriorityProfile"u8); + writer.WriteObjectValue(SpotPriorityProfile, options); + } + if (Optional.IsDefined(RegularPriorityProfile)) + { + writer.WritePropertyName("regularPriorityProfile"u8); + writer.WriteObjectValue(RegularPriorityProfile, options); + } + writer.WritePropertyName("vmSizesProfile"u8); + writer.WriteStartArray(); + foreach (var item in VmSizesProfile) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("computeProfile"u8); + writer.WriteObjectValue(ComputeProfile, options); + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UniqueId)) + { + writer.WritePropertyName("uniqueId"u8); + writer.WriteStringValue(UniqueId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetProperties 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(ComputeFleetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetProperties(document.RootElement, options); + } + + internal static ComputeFleetProperties DeserializeComputeFleetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetProvisioningState? provisioningState = default; + SpotPriorityProfile spotPriorityProfile = default; + RegularPriorityProfile regularPriorityProfile = default; + IList vmSizesProfile = default; + ComputeFleetComputeProfile computeProfile = default; + DateTimeOffset? timeCreated = default; + string uniqueId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ComputeFleetProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("spotPriorityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + spotPriorityProfile = SpotPriorityProfile.DeserializeSpotPriorityProfile(property.Value, options); + continue; + } + if (property.NameEquals("regularPriorityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + regularPriorityProfile = RegularPriorityProfile.DeserializeRegularPriorityProfile(property.Value, options); + continue; + } + if (property.NameEquals("vmSizesProfile"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmSizeProfile.DeserializeComputeFleetVmSizeProfile(item, options)); + } + vmSizesProfile = array; + continue; + } + if (property.NameEquals("computeProfile"u8)) + { + computeProfile = ComputeFleetComputeProfile.DeserializeComputeFleetComputeProfile(property.Value, options); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("uniqueId"u8)) + { + uniqueId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetProperties( + provisioningState, + spotPriorityProfile, + regularPriorityProfile, + vmSizesProfile, + computeProfile, + timeCreated, + uniqueId, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetProperties)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.cs new file mode 100644 index 0000000000000..fe9bffc332da6 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Details of the Compute Fleet. + public partial class ComputeFleetProperties + { + /// + /// 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 . + /// List of VM sizes supported for Compute Fleet. + /// Compute Profile to use for running user's workloads. + /// or is null. + public ComputeFleetProperties(IEnumerable vmSizesProfile, ComputeFleetComputeProfile computeProfile) + { + Argument.AssertNotNull(vmSizesProfile, nameof(vmSizesProfile)); + Argument.AssertNotNull(computeProfile, nameof(computeProfile)); + + VmSizesProfile = vmSizesProfile.ToList(); + ComputeProfile = computeProfile; + } + + /// Initializes a new instance of . + /// The status of the last operation. + /// Configuration Options for Spot instances in Compute Fleet. + /// Configuration Options for Regular instances in Compute Fleet. + /// List of VM sizes supported for Compute Fleet. + /// Compute Profile to use for running user's workloads. + /// Specifies the time at which the Compute Fleet is created. + /// Specifies the ID which uniquely identifies a Compute Fleet. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetProperties(ComputeFleetProvisioningState? provisioningState, SpotPriorityProfile spotPriorityProfile, RegularPriorityProfile regularPriorityProfile, IList vmSizesProfile, ComputeFleetComputeProfile computeProfile, DateTimeOffset? createdOn, string uniqueId, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + SpotPriorityProfile = spotPriorityProfile; + RegularPriorityProfile = regularPriorityProfile; + VmSizesProfile = vmSizesProfile; + ComputeProfile = computeProfile; + CreatedOn = createdOn; + UniqueId = uniqueId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetProperties() + { + } + + /// The status of the last operation. + public ComputeFleetProvisioningState? ProvisioningState { get; } + /// Configuration Options for Spot instances in Compute Fleet. + public SpotPriorityProfile SpotPriorityProfile { get; set; } + /// Configuration Options for Regular instances in Compute Fleet. + public RegularPriorityProfile RegularPriorityProfile { get; set; } + /// List of VM sizes supported for Compute Fleet. + public IList VmSizesProfile { get; } + /// Compute Profile to use for running user's workloads. + public ComputeFleetComputeProfile ComputeProfile { get; set; } + /// Specifies the time at which the Compute Fleet is created. + public DateTimeOffset? CreatedOn { get; } + /// Specifies the ID which uniquely identifies a Compute Fleet. + public string UniqueId { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProtocolType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProtocolType.cs new file mode 100644 index 0000000000000..23910058cb6e7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProtocolType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the protocol of WinRM listener. Possible values are: **http,** + /// **https.** + /// + public readonly partial struct ComputeFleetProtocolType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetProtocolType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HttpValue = "Http"; + private const string HttpsValue = "Https"; + + /// Http protocol. + public static ComputeFleetProtocolType Http { get; } = new ComputeFleetProtocolType(HttpValue); + /// Https protocol. + public static ComputeFleetProtocolType Https { get; } = new ComputeFleetProtocolType(HttpsValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetProtocolType left, ComputeFleetProtocolType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetProtocolType left, ComputeFleetProtocolType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetProtocolType(string value) => new ComputeFleetProtocolType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetProtocolType other && Equals(other); + /// + public bool Equals(ComputeFleetProtocolType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProvisioningState.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProvisioningState.cs new file mode 100644 index 0000000000000..5c54461dfcd93 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProvisioningState.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 Azure.ResourceManager.ComputeFleet.Models +{ + /// The status of the current operation. + public readonly partial struct ComputeFleetProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string MigratingValue = "Migrating"; + + /// Resource has been created. + public static ComputeFleetProvisioningState Succeeded { get; } = new ComputeFleetProvisioningState(SucceededValue); + /// Resource creation failed. + public static ComputeFleetProvisioningState Failed { get; } = new ComputeFleetProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ComputeFleetProvisioningState Canceled { get; } = new ComputeFleetProvisioningState(CanceledValue); + /// Initial creation in progress. + public static ComputeFleetProvisioningState Creating { get; } = new ComputeFleetProvisioningState(CreatingValue); + /// Update in progress. + public static ComputeFleetProvisioningState Updating { get; } = new ComputeFleetProvisioningState(UpdatingValue); + /// Deletion in progress. + public static ComputeFleetProvisioningState Deleting { get; } = new ComputeFleetProvisioningState(DeletingValue); + /// Resource is being migrated from one subscription or resource group to another. + public static ComputeFleetProvisioningState Migrating { get; } = new ComputeFleetProvisioningState(MigratingValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetProvisioningState left, ComputeFleetProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetProvisioningState left, ComputeFleetProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetProvisioningState(string value) => new ComputeFleetProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetProvisioningState other && Equals(other); + /// + public bool Equals(ComputeFleetProvisioningState 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.Serialization.cs new file mode 100644 index 0000000000000..17a0ed47ddc2e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetProxyAgentSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetProxyAgentSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(IsEnabled.Value); + } + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsDefined(KeyIncarnationId)) + { + writer.WritePropertyName("keyIncarnationId"u8); + writer.WriteNumberValue(KeyIncarnationId.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetProxyAgentSettings 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(ComputeFleetProxyAgentSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetProxyAgentSettings(document.RootElement, options); + } + + internal static ComputeFleetProxyAgentSettings DeserializeComputeFleetProxyAgentSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + ProxyAgentExecuteMode? mode = default; + int? keyIncarnationId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new ProxyAgentExecuteMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("keyIncarnationId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyIncarnationId = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetProxyAgentSettings(enabled, mode, keyIncarnationId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetProxyAgentSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetProxyAgentSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetProxyAgentSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetProxyAgentSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.cs new file mode 100644 index 0000000000000..68a4f5abcdb8e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum + /// api-version: 2023-09-01. + /// + public partial class ComputeFleetProxyAgentSettings + { + /// + /// 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 . + public ComputeFleetProxyAgentSettings() + { + } + + /// Initializes a new instance of . + /// + /// Specifies whether ProxyAgent feature should be enabled on the virtual machine + /// or virtual machine scale set. + /// + /// + /// Specifies the mode that ProxyAgent will execute on if the feature is enabled. + /// ProxyAgent will start to audit or monitor but not enforce access control over + /// requests to host endpoints in Audit mode, while in Enforce mode it will enforce + /// access control. The default value is Enforce mode. + /// + /// + /// Increase the value of this property allows user to reset the key used for + /// securing communication channel between guest and host. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetProxyAgentSettings(bool? isEnabled, ProxyAgentExecuteMode? mode, int? keyIncarnationId, IDictionary serializedAdditionalRawData) + { + IsEnabled = isEnabled; + Mode = mode; + KeyIncarnationId = keyIncarnationId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies whether ProxyAgent feature should be enabled on the virtual machine + /// or virtual machine scale set. + /// + public bool? IsEnabled { get; set; } + /// + /// Specifies the mode that ProxyAgent will execute on if the feature is enabled. + /// ProxyAgent will start to audit or monitor but not enforce access control over + /// requests to host endpoints in Audit mode, while in Enforce mode it will enforce + /// access control. The default value is Enforce mode. + /// + public ProxyAgentExecuteMode? Mode { get; set; } + /// + /// Increase the value of this property allows user to reset the key used for + /// securing communication channel between guest and host. + /// + public int? KeyIncarnationId { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.Serialization.cs new file mode 100644 index 0000000000000..bc2f6b2907b02 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetPublicIPAddressSku : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetPublicIPAddressSku)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (Optional.IsDefined(Tier)) + { + writer.WritePropertyName("tier"u8); + writer.WriteStringValue(Tier.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetPublicIPAddressSku 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(ComputeFleetPublicIPAddressSku)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetPublicIPAddressSku(document.RootElement, options); + } + + internal static ComputeFleetPublicIPAddressSku DeserializeComputeFleetPublicIPAddressSku(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetPublicIPAddressSkuName? name = default; + ComputeFleetPublicIPAddressSkuTier? tier = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new ComputeFleetPublicIPAddressSkuName(property.Value.GetString()); + continue; + } + if (property.NameEquals("tier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tier = new ComputeFleetPublicIPAddressSkuTier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetPublicIPAddressSku(name, tier, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetPublicIPAddressSku)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetPublicIPAddressSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetPublicIPAddressSku(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetPublicIPAddressSku)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.cs new file mode 100644 index 0000000000000..78ad954460cff --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Describes the public IP Sku. It can only be set with OrchestrationMode as + /// Flexible. + /// + public partial class ComputeFleetPublicIPAddressSku + { + /// + /// 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 . + public ComputeFleetPublicIPAddressSku() + { + } + + /// Initializes a new instance of . + /// Specify public IP sku name. + /// Specify public IP sku tier. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetPublicIPAddressSku(ComputeFleetPublicIPAddressSkuName? name, ComputeFleetPublicIPAddressSkuTier? tier, IDictionary serializedAdditionalRawData) + { + Name = name; + Tier = tier; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specify public IP sku name. + public ComputeFleetPublicIPAddressSkuName? Name { get; set; } + /// Specify public IP sku tier. + public ComputeFleetPublicIPAddressSkuTier? Tier { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuName.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuName.cs new file mode 100644 index 0000000000000..2174980dc24b0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuName.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specify public IP sku name. + public readonly partial struct ComputeFleetPublicIPAddressSkuName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetPublicIPAddressSkuName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BasicValue = "Basic"; + private const string StandardValue = "Standard"; + + /// Basic sku name. + public static ComputeFleetPublicIPAddressSkuName Basic { get; } = new ComputeFleetPublicIPAddressSkuName(BasicValue); + /// Standard sku name. + public static ComputeFleetPublicIPAddressSkuName Standard { get; } = new ComputeFleetPublicIPAddressSkuName(StandardValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetPublicIPAddressSkuName left, ComputeFleetPublicIPAddressSkuName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetPublicIPAddressSkuName left, ComputeFleetPublicIPAddressSkuName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetPublicIPAddressSkuName(string value) => new ComputeFleetPublicIPAddressSkuName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetPublicIPAddressSkuName other && Equals(other); + /// + public bool Equals(ComputeFleetPublicIPAddressSkuName 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuTier.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuTier.cs new file mode 100644 index 0000000000000..2d2eb6062fae3 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuTier.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specify public IP sku tier. + public readonly partial struct ComputeFleetPublicIPAddressSkuTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetPublicIPAddressSkuTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegionalValue = "Regional"; + private const string GlobalValue = "Global"; + + /// Regional sku tier. + public static ComputeFleetPublicIPAddressSkuTier Regional { get; } = new ComputeFleetPublicIPAddressSkuTier(RegionalValue); + /// Global sku tier. + public static ComputeFleetPublicIPAddressSkuTier Global { get; } = new ComputeFleetPublicIPAddressSkuTier(GlobalValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetPublicIPAddressSkuTier left, ComputeFleetPublicIPAddressSkuTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetPublicIPAddressSkuTier left, ComputeFleetPublicIPAddressSkuTier right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetPublicIPAddressSkuTier(string value) => new ComputeFleetPublicIPAddressSkuTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetPublicIPAddressSkuTier other && Equals(other); + /// + public bool Equals(ComputeFleetPublicIPAddressSkuTier 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.Serialization.cs new file mode 100644 index 0000000000000..dcdb4b81dea65 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetScheduledEventsProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetScheduledEventsProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(TerminateNotificationProfile)) + { + writer.WritePropertyName("terminateNotificationProfile"u8); + writer.WriteObjectValue(TerminateNotificationProfile, options); + } + if (Optional.IsDefined(OSImageNotificationProfile)) + { + writer.WritePropertyName("osImageNotificationProfile"u8); + writer.WriteObjectValue(OSImageNotificationProfile, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetScheduledEventsProfile 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(ComputeFleetScheduledEventsProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetScheduledEventsProfile(document.RootElement, options); + } + + internal static ComputeFleetScheduledEventsProfile DeserializeComputeFleetScheduledEventsProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetTerminateNotificationProfile terminateNotificationProfile = default; + ComputeFleetOSImageNotificationProfile osImageNotificationProfile = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("terminateNotificationProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + terminateNotificationProfile = ComputeFleetTerminateNotificationProfile.DeserializeComputeFleetTerminateNotificationProfile(property.Value, options); + continue; + } + if (property.NameEquals("osImageNotificationProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osImageNotificationProfile = ComputeFleetOSImageNotificationProfile.DeserializeComputeFleetOSImageNotificationProfile(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetScheduledEventsProfile(terminateNotificationProfile, osImageNotificationProfile, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetScheduledEventsProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetScheduledEventsProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetScheduledEventsProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetScheduledEventsProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.cs new file mode 100644 index 0000000000000..0d79b652734a7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies Scheduled Event related configurations. + public partial class ComputeFleetScheduledEventsProfile + { + /// + /// 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 . + public ComputeFleetScheduledEventsProfile() + { + } + + /// Initializes a new instance of . + /// Specifies Terminate Scheduled Event related configurations. + /// Specifies OS Image Scheduled Event related configurations. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetScheduledEventsProfile(ComputeFleetTerminateNotificationProfile terminateNotificationProfile, ComputeFleetOSImageNotificationProfile osImageNotificationProfile, IDictionary serializedAdditionalRawData) + { + TerminateNotificationProfile = terminateNotificationProfile; + OSImageNotificationProfile = osImageNotificationProfile; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies Terminate Scheduled Event related configurations. + public ComputeFleetTerminateNotificationProfile TerminateNotificationProfile { get; set; } + /// Specifies OS Image Scheduled Event related configurations. + public ComputeFleetOSImageNotificationProfile OSImageNotificationProfile { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityEncryptionType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityEncryptionType.cs new file mode 100644 index 0000000000000..d1ec7d568b5d7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityEncryptionType.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 Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the EncryptionType of the managed disk. + /// **Note:** It can be set for only Confidential VMs. + /// + public readonly partial struct ComputeFleetSecurityEncryptionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetSecurityEncryptionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string VmGuestStateOnlyValue = "VMGuestStateOnly"; + private const string DiskWithVmGuestStateValue = "DiskWithVMGuestState"; + private const string NonPersistedTpmValue = "NonPersistedTPM"; + + /// + /// EncryptionType of the managed disk is set to VMGuestStateOnly for encryption + /// of just the VMGuestState blob. + /// + public static ComputeFleetSecurityEncryptionType VmGuestStateOnly { get; } = new ComputeFleetSecurityEncryptionType(VmGuestStateOnlyValue); + /// + /// EncryptionType of the managed disk is set to DiskWithVMGuestState for encryption + /// of the managed disk along with VMGuestState blob. + /// + public static ComputeFleetSecurityEncryptionType DiskWithVmGuestState { get; } = new ComputeFleetSecurityEncryptionType(DiskWithVmGuestStateValue); + /// + /// EncryptionType of the managed disk is set to NonPersistedTPM for not persisting + /// firmware state in the VMGuestState blob. + /// + public static ComputeFleetSecurityEncryptionType NonPersistedTpm { get; } = new ComputeFleetSecurityEncryptionType(NonPersistedTpmValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetSecurityEncryptionType left, ComputeFleetSecurityEncryptionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetSecurityEncryptionType left, ComputeFleetSecurityEncryptionType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetSecurityEncryptionType(string value) => new ComputeFleetSecurityEncryptionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetSecurityEncryptionType other && Equals(other); + /// + public bool Equals(ComputeFleetSecurityEncryptionType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.Serialization.cs new file mode 100644 index 0000000000000..9166503e4d306 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetSecurityPostureReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetSecurityPostureReference)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(ExcludeExtensions)) + { + writer.WritePropertyName("excludeExtensions"u8); + writer.WriteStartArray(); + foreach (var item in ExcludeExtensions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IsOverridable)) + { + writer.WritePropertyName("isOverridable"u8); + writer.WriteBooleanValue(IsOverridable.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetSecurityPostureReference 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(ComputeFleetSecurityPostureReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetSecurityPostureReference(document.RootElement, options); + } + + internal static ComputeFleetSecurityPostureReference DeserializeComputeFleetSecurityPostureReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + IList excludeExtensions = default; + bool? isOverridable = 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("excludeExtensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + excludeExtensions = array; + continue; + } + if (property.NameEquals("isOverridable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOverridable = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetSecurityPostureReference(id, excludeExtensions ?? new ChangeTrackingList(), isOverridable, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetSecurityPostureReference)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetSecurityPostureReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetSecurityPostureReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetSecurityPostureReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.cs new file mode 100644 index 0000000000000..b0595191513ce --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the security posture to be used for all virtual machines in the scale + /// set. Minimum api-version: 2023-03-01 + /// + public partial class ComputeFleetSecurityPostureReference + { + /// + /// 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 . + public ComputeFleetSecurityPostureReference() + { + ExcludeExtensions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The security posture reference id in the form of + /// /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest + /// + /// + /// List of virtual machine extension names to exclude when applying the security + /// posture. + /// + /// Whether the security posture can be overridden by the user. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetSecurityPostureReference(string id, IList excludeExtensions, bool? isOverridable, IDictionary serializedAdditionalRawData) + { + Id = id; + ExcludeExtensions = excludeExtensions; + IsOverridable = isOverridable; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The security posture reference id in the form of + /// /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest + /// + public string Id { get; set; } + /// + /// List of virtual machine extension names to exclude when applying the security + /// posture. + /// + public IList ExcludeExtensions { get; } + /// Whether the security posture can be overridden by the user. + public bool? IsOverridable { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.Serialization.cs new file mode 100644 index 0000000000000..87d89420da588 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetSecurityProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetSecurityProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(UefiSettings)) + { + writer.WritePropertyName("uefiSettings"u8); + writer.WriteObjectValue(UefiSettings, options); + } + if (Optional.IsDefined(IsEncryptionAtHostEnabled)) + { + writer.WritePropertyName("encryptionAtHost"u8); + writer.WriteBooleanValue(IsEncryptionAtHostEnabled.Value); + } + if (Optional.IsDefined(SecurityType)) + { + writer.WritePropertyName("securityType"u8); + writer.WriteStringValue(SecurityType.Value.ToString()); + } + if (Optional.IsDefined(EncryptionIdentity)) + { + writer.WritePropertyName("encryptionIdentity"u8); + writer.WriteObjectValue(EncryptionIdentity, options); + } + if (Optional.IsDefined(ProxyAgentSettings)) + { + writer.WritePropertyName("proxyAgentSettings"u8); + writer.WriteObjectValue(ProxyAgentSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetSecurityProfile 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(ComputeFleetSecurityProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetSecurityProfile(document.RootElement, options); + } + + internal static ComputeFleetSecurityProfile DeserializeComputeFleetSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetUefiSettings uefiSettings = default; + bool? encryptionAtHost = default; + ComputeFleetSecurityType? securityType = default; + ComputeFleetEncryptionIdentity encryptionIdentity = default; + ComputeFleetProxyAgentSettings proxyAgentSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uefiSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uefiSettings = ComputeFleetUefiSettings.DeserializeComputeFleetUefiSettings(property.Value, options); + continue; + } + if (property.NameEquals("encryptionAtHost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionAtHost = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("securityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityType = new ComputeFleetSecurityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("encryptionIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionIdentity = ComputeFleetEncryptionIdentity.DeserializeComputeFleetEncryptionIdentity(property.Value, options); + continue; + } + if (property.NameEquals("proxyAgentSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + proxyAgentSettings = ComputeFleetProxyAgentSettings.DeserializeComputeFleetProxyAgentSettings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetSecurityProfile( + uefiSettings, + encryptionAtHost, + securityType, + encryptionIdentity, + proxyAgentSettings, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetSecurityProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetSecurityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetSecurityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetSecurityProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.cs new file mode 100644 index 0000000000000..655a0ebe14634 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the Security profile settings for the virtual machine or virtual + /// machine scale set. + /// + public partial class ComputeFleetSecurityProfile + { + /// + /// 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 . + public ComputeFleetSecurityProfile() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the security settings like secure boot and vTPM used while creating + /// the virtual machine. Minimum api-version: 2020-12-01. + /// + /// + /// This property can be used by user in the request to enable or disable the Host + /// Encryption for the virtual machine or virtual machine scale set. This will + /// enable the encryption for all the disks including Resource/Temp disk at host + /// itself. The default behavior is: The Encryption at host will be disabled unless + /// this property is set to true for the resource. + /// + /// + /// Specifies the SecurityType of the virtual machine. It has to be set to any + /// specified value to enable UefiSettings. The default behavior is: UefiSettings + /// will not be enabled unless this property is set. + /// + /// + /// Specifies the Managed Identity used by ADE to get access token for keyvault + /// operations. + /// + /// + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum + /// api-version: 2023-09-01. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetSecurityProfile(ComputeFleetUefiSettings uefiSettings, bool? isEncryptionAtHostEnabled, ComputeFleetSecurityType? securityType, ComputeFleetEncryptionIdentity encryptionIdentity, ComputeFleetProxyAgentSettings proxyAgentSettings, IDictionary serializedAdditionalRawData) + { + UefiSettings = uefiSettings; + IsEncryptionAtHostEnabled = isEncryptionAtHostEnabled; + SecurityType = securityType; + EncryptionIdentity = encryptionIdentity; + ProxyAgentSettings = proxyAgentSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the security settings like secure boot and vTPM used while creating + /// the virtual machine. Minimum api-version: 2020-12-01. + /// + public ComputeFleetUefiSettings UefiSettings { get; set; } + /// + /// This property can be used by user in the request to enable or disable the Host + /// Encryption for the virtual machine or virtual machine scale set. This will + /// enable the encryption for all the disks including Resource/Temp disk at host + /// itself. The default behavior is: The Encryption at host will be disabled unless + /// this property is set to true for the resource. + /// + public bool? IsEncryptionAtHostEnabled { get; set; } + /// + /// Specifies the SecurityType of the virtual machine. It has to be set to any + /// specified value to enable UefiSettings. The default behavior is: UefiSettings + /// will not be enabled unless this property is set. + /// + public ComputeFleetSecurityType? SecurityType { get; set; } + /// + /// Specifies the Managed Identity used by ADE to get access token for keyvault + /// operations. + /// + internal ComputeFleetEncryptionIdentity EncryptionIdentity { get; set; } + /// Specifies ARM Resource ID of one of the user identities associated with the VM. + public ResourceIdentifier UserAssignedIdentityResourceId + { + get => EncryptionIdentity is null ? default : EncryptionIdentity.UserAssignedIdentityResourceId; + set + { + if (EncryptionIdentity is null) + EncryptionIdentity = new ComputeFleetEncryptionIdentity(); + EncryptionIdentity.UserAssignedIdentityResourceId = value; + } + } + + /// + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum + /// api-version: 2023-09-01. + /// + public ComputeFleetProxyAgentSettings ProxyAgentSettings { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityType.cs new file mode 100644 index 0000000000000..7b97d0bc1ff02 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityType.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the SecurityType of the virtual machine. It has to be set to any + /// specified value to enable UefiSettings. The default behavior is: UefiSettings + /// will not be enabled unless this property is set. + /// + public readonly partial struct ComputeFleetSecurityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetSecurityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TrustedLaunchValue = "TrustedLaunch"; + private const string ConfidentialVmValue = "ConfidentialVM"; + + /// TrustedLaunch security type. + public static ComputeFleetSecurityType TrustedLaunch { get; } = new ComputeFleetSecurityType(TrustedLaunchValue); + /// ConfidentialVM security type. + public static ComputeFleetSecurityType ConfidentialVm { get; } = new ComputeFleetSecurityType(ConfidentialVmValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetSecurityType left, ComputeFleetSecurityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetSecurityType left, ComputeFleetSecurityType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetSecurityType(string value) => new ComputeFleetSecurityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetSecurityType other && Equals(other); + /// + public bool Equals(ComputeFleetSecurityType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.Serialization.cs new file mode 100644 index 0000000000000..791b7b0424a7b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetSshConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetSshConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(PublicKeys)) + { + writer.WritePropertyName("publicKeys"u8); + writer.WriteStartArray(); + foreach (var item in PublicKeys) + { + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetSshConfiguration 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(ComputeFleetSshConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetSshConfiguration(document.RootElement, options); + } + + internal static ComputeFleetSshConfiguration DeserializeComputeFleetSshConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList publicKeys = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("publicKeys"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetSshPublicKey.DeserializeComputeFleetSshPublicKey(item, options)); + } + publicKeys = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetSshConfiguration(publicKeys ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetSshConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetSshConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetSshConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetSshConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.cs new file mode 100644 index 0000000000000..941f8a22adb4c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// SSH configuration for Linux based VMs running on Azure. + internal partial class ComputeFleetSshConfiguration + { + /// + /// 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 . + public ComputeFleetSshConfiguration() + { + PublicKeys = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of SSH public keys used to authenticate with linux based VMs. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetSshConfiguration(IList publicKeys, IDictionary serializedAdditionalRawData) + { + PublicKeys = publicKeys; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of SSH public keys used to authenticate with linux based VMs. + public IList PublicKeys { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.Serialization.cs new file mode 100644 index 0000000000000..99d8fe18f895b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetSshPublicKey : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetSshPublicKey)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + if (Optional.IsDefined(KeyData)) + { + writer.WritePropertyName("keyData"u8); + writer.WriteStringValue(KeyData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetSshPublicKey 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(ComputeFleetSshPublicKey)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetSshPublicKey(document.RootElement, options); + } + + internal static ComputeFleetSshPublicKey DeserializeComputeFleetSshPublicKey(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string path = default; + string keyData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("keyData"u8)) + { + keyData = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetSshPublicKey(path, keyData, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetSshPublicKey)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetSshPublicKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetSshPublicKey(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetSshPublicKey)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.cs new file mode 100644 index 0000000000000..292cdb5c4231b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Contains information about SSH certificate public key and the path on the Linux + /// VM where the public key is placed. + /// + public partial class ComputeFleetSshPublicKey + { + /// + /// 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 . + public ComputeFleetSshPublicKey() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the full path on the created VM where ssh public key is stored. If + /// the file already exists, the specified key is appended to the file. Example: + /// /home/user/.ssh/authorized_keys + /// + /// + /// SSH public key certificate used to authenticate with the VM through ssh. The + /// key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, + /// see [Create SSH keys on Linux and Mac for Linux VMs in + /// Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetSshPublicKey(string path, string keyData, IDictionary serializedAdditionalRawData) + { + Path = path; + KeyData = keyData; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the full path on the created VM where ssh public key is stored. If + /// the file already exists, the specified key is appended to the file. Example: + /// /home/user/.ssh/authorized_keys + /// + public string Path { get; set; } + /// + /// SSH public key certificate used to authenticate with the VM through ssh. The + /// key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, + /// see [Create SSH keys on Linux and Mac for Linux VMs in + /// Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + /// + public string KeyData { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetStorageAccountType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetStorageAccountType.cs new file mode 100644 index 0000000000000..0a9e350b147b1 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetStorageAccountType.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the storage account type for the managed disk. Managed OS disk + /// storage account type can only be set when you create the scale set. NOTE: + /// UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. + /// Standard_LRS uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS + /// uses Premium SSD. UltraSSD_LRS uses Ultra disk. Premium_ZRS uses Premium SSD + /// zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant + /// storage. For more information regarding disks supported for Windows Virtual + /// Machines, refer to + /// https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for + /// Linux Virtual Machines, refer to + /// https://docs.microsoft.com/azure/virtual-machines/linux/disks-types + /// + public readonly partial struct ComputeFleetStorageAccountType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetStorageAccountType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardLrsValue = "Standard_LRS"; + private const string PremiumLrsValue = "Premium_LRS"; + private const string StandardSsdLrdValue = "StandardSSD_LRS"; + private const string UltraSsdLrsValue = "UltraSSD_LRS"; + private const string PremiumZrsValue = "Premium_ZRS"; + private const string StandardSsdZrsValue = "StandardSSD_ZRS"; + private const string PremiumV2LRSValue = "PremiumV2_LRS"; + + /// Standard_LRS option. + public static ComputeFleetStorageAccountType StandardLrs { get; } = new ComputeFleetStorageAccountType(StandardLrsValue); + /// Premium_LRS option. + public static ComputeFleetStorageAccountType PremiumLrs { get; } = new ComputeFleetStorageAccountType(PremiumLrsValue); + /// StandardSSD_LRS option. + public static ComputeFleetStorageAccountType StandardSsdLrd { get; } = new ComputeFleetStorageAccountType(StandardSsdLrdValue); + /// UltraSSD_LRS option. + public static ComputeFleetStorageAccountType UltraSsdLrs { get; } = new ComputeFleetStorageAccountType(UltraSsdLrsValue); + /// Premium_ZRS option. + public static ComputeFleetStorageAccountType PremiumZrs { get; } = new ComputeFleetStorageAccountType(PremiumZrsValue); + /// StandardSSD_ZRS option. + public static ComputeFleetStorageAccountType StandardSsdZrs { get; } = new ComputeFleetStorageAccountType(StandardSsdZrsValue); + /// PremiumV2_LRS option. + public static ComputeFleetStorageAccountType PremiumV2LRS { get; } = new ComputeFleetStorageAccountType(PremiumV2LRSValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetStorageAccountType left, ComputeFleetStorageAccountType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetStorageAccountType left, ComputeFleetStorageAccountType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetStorageAccountType(string value) => new ComputeFleetStorageAccountType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetStorageAccountType other && Equals(other); + /// + public bool Equals(ComputeFleetStorageAccountType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.Serialization.cs new file mode 100644 index 0000000000000..9eede006c6623 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetTerminateNotificationProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetTerminateNotificationProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NotBeforeTimeout)) + { + writer.WritePropertyName("notBeforeTimeout"u8); + writer.WriteStringValue(NotBeforeTimeout); + } + if (Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("enable"u8); + writer.WriteBooleanValue(IsEnabled.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetTerminateNotificationProfile 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(ComputeFleetTerminateNotificationProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetTerminateNotificationProfile(document.RootElement, options); + } + + internal static ComputeFleetTerminateNotificationProfile DeserializeComputeFleetTerminateNotificationProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string notBeforeTimeout = default; + bool? enable = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("notBeforeTimeout"u8)) + { + notBeforeTimeout = property.Value.GetString(); + continue; + } + if (property.NameEquals("enable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enable = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetTerminateNotificationProfile(notBeforeTimeout, enable, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetTerminateNotificationProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetTerminateNotificationProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetTerminateNotificationProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetTerminateNotificationProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.cs new file mode 100644 index 0000000000000..3dc3f37b18121 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies Terminate Scheduled Event related configurations. + public partial class ComputeFleetTerminateNotificationProfile + { + /// + /// 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 . + public ComputeFleetTerminateNotificationProfile() + { + } + + /// Initializes a new instance of . + /// + /// Configurable length of time a Virtual Machine being deleted will have to + /// potentially approve the Terminate Scheduled Event before the event is auto + /// approved (timed out). The configuration must be specified in ISO 8601 format, + /// the default value is 5 minutes (PT5M) + /// + /// Specifies whether the Terminate Scheduled event is enabled or disabled. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetTerminateNotificationProfile(string notBeforeTimeout, bool? isEnabled, IDictionary serializedAdditionalRawData) + { + NotBeforeTimeout = notBeforeTimeout; + IsEnabled = isEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Configurable length of time a Virtual Machine being deleted will have to + /// potentially approve the Terminate Scheduled Event before the event is auto + /// approved (timed out). The configuration must be specified in ISO 8601 format, + /// the default value is 5 minutes (PT5M) + /// + public string NotBeforeTimeout { get; set; } + /// Specifies whether the Terminate Scheduled event is enabled or disabled. + public bool? IsEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.Serialization.cs new file mode 100644 index 0000000000000..c70fae5c42af1 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetUefiSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetUefiSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IsSecureBootEnabled)) + { + writer.WritePropertyName("secureBootEnabled"u8); + writer.WriteBooleanValue(IsSecureBootEnabled.Value); + } + if (Optional.IsDefined(IsVTpmEnabled)) + { + writer.WritePropertyName("vTpmEnabled"u8); + writer.WriteBooleanValue(IsVTpmEnabled.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetUefiSettings 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(ComputeFleetUefiSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetUefiSettings(document.RootElement, options); + } + + internal static ComputeFleetUefiSettings DeserializeComputeFleetUefiSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? secureBootEnabled = default; + bool? vTpmEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secureBootEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + secureBootEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("vTpmEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vTpmEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetUefiSettings(secureBootEnabled, vTpmEnabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetUefiSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetUefiSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetUefiSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetUefiSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.cs new file mode 100644 index 0000000000000..040ea58ef3b07 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the security settings like secure boot and vTPM used while creating + /// the virtual machine. Minimum api-version: 2020-12-01. + /// + public partial class ComputeFleetUefiSettings + { + /// + /// 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 . + public ComputeFleetUefiSettings() + { + } + + /// Initializes a new instance of . + /// + /// Specifies whether secure boot should be enabled on the virtual machine. Minimum + /// api-version: 2020-12-01. + /// + /// + /// Specifies whether vTPM should be enabled on the virtual machine. Minimum + /// api-version: 2020-12-01. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetUefiSettings(bool? isSecureBootEnabled, bool? isVTpmEnabled, IDictionary serializedAdditionalRawData) + { + IsSecureBootEnabled = isSecureBootEnabled; + IsVTpmEnabled = isVTpmEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies whether secure boot should be enabled on the virtual machine. Minimum + /// api-version: 2020-12-01. + /// + public bool? IsSecureBootEnabled { get; set; } + /// + /// Specifies whether vTPM should be enabled on the virtual machine. Minimum + /// api-version: 2020-12-01. + /// + public bool? IsVTpmEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.Serialization.cs new file mode 100644 index 0000000000000..2c17ffcb8e9a4 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVaultCertificate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVaultCertificate)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(CertificateUri)) + { + writer.WritePropertyName("certificateUrl"u8); + writer.WriteStringValue(CertificateUri.AbsoluteUri); + } + if (Optional.IsDefined(CertificateStore)) + { + writer.WritePropertyName("certificateStore"u8); + writer.WriteStringValue(CertificateStore); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVaultCertificate 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(ComputeFleetVaultCertificate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVaultCertificate(document.RootElement, options); + } + + internal static ComputeFleetVaultCertificate DeserializeComputeFleetVaultCertificate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri certificateUrl = default; + string certificateStore = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("certificateUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + certificateUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("certificateStore"u8)) + { + certificateStore = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVaultCertificate(certificateUrl, certificateStore, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVaultCertificate)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVaultCertificate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVaultCertificate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVaultCertificate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.cs new file mode 100644 index 0000000000000..74c15f225abdd --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Describes a single certificate reference in a Key Vault, and where the + /// certificate should reside on the VM. + /// + public partial class ComputeFleetVaultCertificate + { + /// + /// 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 . + public ComputeFleetVaultCertificate() + { + } + + /// Initializes a new instance of . + /// + /// This is the URL of a certificate that has been uploaded to Key Vault as a + /// secret. For adding a secret to the Key Vault, see [Add a key or secret to the + /// key + /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + /// In this case, your certificate needs to be It is the Base64 encoding of the + /// following JSON Object which is encoded in UTF-8: <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} <br> To install certificates on a virtual + /// machine it is recommended to use the [Azure Key Vault virtual machine extension + /// for + /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + /// or the [Azure Key Vault virtual machine extension for + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + /// + /// For Windows VMs, specifies the certificate store on the Virtual Machine to + /// which the certificate should be added. The specified certificate store is + /// implicitly in the LocalMachine account. For Linux VMs, the certificate file is + /// placed under the /var/lib/waagent directory, with the file name + /// <UppercaseThumbprint>.crt for the X509 certificate file and + /// <UppercaseThumbprint>.prv for private key. Both of these files are .pem + /// formatted. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVaultCertificate(Uri certificateUri, string certificateStore, IDictionary serializedAdditionalRawData) + { + CertificateUri = certificateUri; + CertificateStore = certificateStore; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// This is the URL of a certificate that has been uploaded to Key Vault as a + /// secret. For adding a secret to the Key Vault, see [Add a key or secret to the + /// key + /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + /// In this case, your certificate needs to be It is the Base64 encoding of the + /// following JSON Object which is encoded in UTF-8: <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} <br> To install certificates on a virtual + /// machine it is recommended to use the [Azure Key Vault virtual machine extension + /// for + /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + /// or the [Azure Key Vault virtual machine extension for + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + public Uri CertificateUri { get; set; } + /// + /// For Windows VMs, specifies the certificate store on the Virtual Machine to + /// which the certificate should be added. The specified certificate store is + /// implicitly in the LocalMachine account. For Linux VMs, the certificate file is + /// placed under the /var/lib/waagent directory, with the file name + /// <UppercaseThumbprint>.crt for the X509 certificate file and + /// <UppercaseThumbprint>.prv for private key. Both of these files are .pem + /// formatted. + /// + public string CertificateStore { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.Serialization.cs new file mode 100644 index 0000000000000..2aece832749bb --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVaultSecretGroup : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVaultSecretGroup)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(SourceVault)) + { + writer.WritePropertyName("sourceVault"u8); + JsonSerializer.Serialize(writer, SourceVault); + } + if (Optional.IsCollectionDefined(VaultCertificates)) + { + writer.WritePropertyName("vaultCertificates"u8); + writer.WriteStartArray(); + foreach (var item in VaultCertificates) + { + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVaultSecretGroup 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(ComputeFleetVaultSecretGroup)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVaultSecretGroup(document.RootElement, options); + } + + internal static ComputeFleetVaultSecretGroup DeserializeComputeFleetVaultSecretGroup(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WritableSubResource sourceVault = default; + IList vaultCertificates = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceVault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceVault = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("vaultCertificates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVaultCertificate.DeserializeComputeFleetVaultCertificate(item, options)); + } + vaultCertificates = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVaultSecretGroup(sourceVault, vaultCertificates ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVaultSecretGroup)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVaultSecretGroup IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVaultSecretGroup(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVaultSecretGroup)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.cs new file mode 100644 index 0000000000000..888991b6f1ede --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a set of certificates which are all in the same Key Vault. + public partial class ComputeFleetVaultSecretGroup + { + /// + /// 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 . + public ComputeFleetVaultSecretGroup() + { + VaultCertificates = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The relative URL of the Key Vault containing all of the certificates in + /// VaultCertificates. + /// + /// The list of key vault references in SourceVault which contain certificates. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVaultSecretGroup(WritableSubResource sourceVault, IList vaultCertificates, IDictionary serializedAdditionalRawData) + { + SourceVault = sourceVault; + VaultCertificates = vaultCertificates; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The relative URL of the Key Vault containing all of the certificates in + /// VaultCertificates. + /// + internal WritableSubResource SourceVault { get; set; } + /// Gets or sets Id. + public ResourceIdentifier SourceVaultId + { + get => SourceVault is null ? default : SourceVault.Id; + set + { + if (SourceVault is null) + SourceVault = new WritableSubResource(); + SourceVault.Id = value; + } + } + + /// The list of key vault references in SourceVault which contain certificates. + public IList VaultCertificates { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.Serialization.cs new file mode 100644 index 0000000000000..268137c084a87 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetVirtualHardDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVirtualHardDisk)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Uri)) + { + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVirtualHardDisk 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(ComputeFleetVirtualHardDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVirtualHardDisk(document.RootElement, options); + } + + internal static ComputeFleetVirtualHardDisk DeserializeComputeFleetVirtualHardDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri uri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVirtualHardDisk(uri, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVirtualHardDisk)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVirtualHardDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVirtualHardDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVirtualHardDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.cs new file mode 100644 index 0000000000000..47a077a8e972c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes the uri of a disk. + internal partial class ComputeFleetVirtualHardDisk + { + /// + /// 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 . + public ComputeFleetVirtualHardDisk() + { + } + + /// Initializes a new instance of . + /// Specifies the virtual hard disk's uri. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVirtualHardDisk(Uri uri, IDictionary serializedAdditionalRawData) + { + Uri = uri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the virtual hard disk's uri. + public Uri Uri { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDeleteOption.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDeleteOption.cs new file mode 100644 index 0000000000000..b0e841c66875e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDeleteOption.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specify what happens to the network interface when the VM is deleted. + public readonly partial struct ComputeFleetVmDeleteOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetVmDeleteOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "Delete"; + private const string DetachValue = "Detach"; + + /// Delete Option. + public static ComputeFleetVmDeleteOption Delete { get; } = new ComputeFleetVmDeleteOption(DeleteValue); + /// Detach Option. + public static ComputeFleetVmDeleteOption Detach { get; } = new ComputeFleetVmDeleteOption(DetachValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetVmDeleteOption left, ComputeFleetVmDeleteOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetVmDeleteOption left, ComputeFleetVmDeleteOption right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetVmDeleteOption(string value) => new ComputeFleetVmDeleteOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetVmDeleteOption other && Equals(other); + /// + public bool Equals(ComputeFleetVmDeleteOption 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.Serialization.cs new file mode 100644 index 0000000000000..ce40c4d781f36 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmDiskSecurityProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmDiskSecurityProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(SecurityEncryptionType)) + { + writer.WritePropertyName("securityEncryptionType"u8); + writer.WriteStringValue(SecurityEncryptionType.Value.ToString()); + } + if (Optional.IsDefined(DiskEncryptionSet)) + { + writer.WritePropertyName("diskEncryptionSet"u8); + JsonSerializer.Serialize(writer, DiskEncryptionSet); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmDiskSecurityProfile 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(ComputeFleetVmDiskSecurityProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmDiskSecurityProfile(document.RootElement, options); + } + + internal static ComputeFleetVmDiskSecurityProfile DeserializeComputeFleetVmDiskSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetSecurityEncryptionType? securityEncryptionType = default; + WritableSubResource diskEncryptionSet = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("securityEncryptionType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityEncryptionType = new ComputeFleetSecurityEncryptionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("diskEncryptionSet"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskEncryptionSet = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmDiskSecurityProfile(securityEncryptionType, diskEncryptionSet, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmDiskSecurityProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmDiskSecurityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmDiskSecurityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmDiskSecurityProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.cs new file mode 100644 index 0000000000000..c011da5fdaf03 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the security profile settings for the managed disk. **Note:** It can + /// only be set for Confidential VMs. + /// + public partial class ComputeFleetVmDiskSecurityProfile + { + /// + /// 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 . + public ComputeFleetVmDiskSecurityProfile() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the EncryptionType of the managed disk. It is set to + /// DiskWithVMGuestState for encryption of the managed disk along with VMGuestState + /// blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and + /// NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. + /// **Note:** It can be set for only Confidential VMs. + /// + /// + /// Specifies the customer managed disk encryption set resource id for the managed + /// disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and + /// VMGuest blob. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmDiskSecurityProfile(ComputeFleetSecurityEncryptionType? securityEncryptionType, WritableSubResource diskEncryptionSet, IDictionary serializedAdditionalRawData) + { + SecurityEncryptionType = securityEncryptionType; + DiskEncryptionSet = diskEncryptionSet; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the EncryptionType of the managed disk. It is set to + /// DiskWithVMGuestState for encryption of the managed disk along with VMGuestState + /// blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and + /// NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. + /// **Note:** It can be set for only Confidential VMs. + /// + public ComputeFleetSecurityEncryptionType? SecurityEncryptionType { get; set; } + /// + /// Specifies the customer managed disk encryption set resource id for the managed + /// disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and + /// VMGuest blob. + /// + internal WritableSubResource DiskEncryptionSet { get; set; } + /// Gets or sets Id. + public ResourceIdentifier DiskEncryptionSetId + { + get => DiskEncryptionSet is null ? default : DiskEncryptionSet.Id; + set + { + if (DiskEncryptionSet is null) + DiskEncryptionSet = new WritableSubResource(); + DiskEncryptionSet.Id = value; + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.Serialization.cs new file mode 100644 index 0000000000000..f040c5a8b34e0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmGalleryApplication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmGalleryApplication)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStringValue(Tags); + } + if (Optional.IsDefined(Order)) + { + writer.WritePropertyName("order"u8); + writer.WriteNumberValue(Order.Value); + } + writer.WritePropertyName("packageReferenceId"u8); + writer.WriteStringValue(PackageReferenceId); + if (Optional.IsDefined(ConfigurationReference)) + { + writer.WritePropertyName("configurationReference"u8); + writer.WriteStringValue(ConfigurationReference); + } + if (Optional.IsDefined(IsTreatFailureAsDeploymentFailureEnabled)) + { + writer.WritePropertyName("treatFailureAsDeploymentFailure"u8); + writer.WriteBooleanValue(IsTreatFailureAsDeploymentFailureEnabled.Value); + } + if (Optional.IsDefined(IsAutomaticUpgradeEnabled)) + { + writer.WritePropertyName("enableAutomaticUpgrade"u8); + writer.WriteBooleanValue(IsAutomaticUpgradeEnabled.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmGalleryApplication 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(ComputeFleetVmGalleryApplication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmGalleryApplication(document.RootElement, options); + } + + internal static ComputeFleetVmGalleryApplication DeserializeComputeFleetVmGalleryApplication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string tags = default; + int? order = default; + ResourceIdentifier packageReferenceId = default; + string configurationReference = default; + bool? treatFailureAsDeploymentFailure = default; + bool? enableAutomaticUpgrade = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + tags = property.Value.GetString(); + continue; + } + if (property.NameEquals("order"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + order = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("packageReferenceId"u8)) + { + packageReferenceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("configurationReference"u8)) + { + configurationReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("treatFailureAsDeploymentFailure"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + treatFailureAsDeploymentFailure = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableAutomaticUpgrade"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutomaticUpgrade = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmGalleryApplication( + tags, + order, + packageReferenceId, + configurationReference, + treatFailureAsDeploymentFailure, + enableAutomaticUpgrade, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmGalleryApplication)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmGalleryApplication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmGalleryApplication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmGalleryApplication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.cs new file mode 100644 index 0000000000000..2b449b09a3a14 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the required information to reference a compute gallery application + /// version + /// + public partial class ComputeFleetVmGalleryApplication + { + /// + /// 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 . + /// + /// Specifies the GalleryApplicationVersion resource id on the form of + /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} + /// + /// is null. + public ComputeFleetVmGalleryApplication(ResourceIdentifier packageReferenceId) + { + Argument.AssertNotNull(packageReferenceId, nameof(packageReferenceId)); + + PackageReferenceId = packageReferenceId; + } + + /// Initializes a new instance of . + /// Optional, Specifies a passthrough value for more generic context. + /// Optional, Specifies the order in which the packages have to be installed. + /// + /// Specifies the GalleryApplicationVersion resource id on the form of + /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} + /// + /// + /// Optional, Specifies the uri to an azure blob that will replace the default + /// configuration for the package if provided + /// + /// + /// Optional, If true, any failure for any operation in the VmApplication will fail + /// the deployment + /// + /// + /// If set to true, when a new Gallery Application version is available in PIR/SIG, + /// it will be automatically updated for the VM/VMSS + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmGalleryApplication(string tags, int? order, ResourceIdentifier packageReferenceId, string configurationReference, bool? isTreatFailureAsDeploymentFailureEnabled, bool? isAutomaticUpgradeEnabled, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Order = order; + PackageReferenceId = packageReferenceId; + ConfigurationReference = configurationReference; + IsTreatFailureAsDeploymentFailureEnabled = isTreatFailureAsDeploymentFailureEnabled; + IsAutomaticUpgradeEnabled = isAutomaticUpgradeEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmGalleryApplication() + { + } + + /// Optional, Specifies a passthrough value for more generic context. + public string Tags { get; set; } + /// Optional, Specifies the order in which the packages have to be installed. + public int? Order { get; set; } + /// + /// Specifies the GalleryApplicationVersion resource id on the form of + /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} + /// + public ResourceIdentifier PackageReferenceId { get; set; } + /// + /// Optional, Specifies the uri to an azure blob that will replace the default + /// configuration for the package if provided + /// + public string ConfigurationReference { get; set; } + /// + /// Optional, If true, any failure for any operation in the VmApplication will fail + /// the deployment + /// + public bool? IsTreatFailureAsDeploymentFailureEnabled { get; set; } + /// + /// If set to true, when a new Gallery Application version is available in PIR/SIG, + /// it will be automatically updated for the VM/VMSS + /// + public bool? IsAutomaticUpgradeEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.Serialization.cs new file mode 100644 index 0000000000000..66632f12580c0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmGuestPatchSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmGuestPatchSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PatchMode)) + { + writer.WritePropertyName("patchMode"u8); + writer.WriteStringValue(PatchMode.Value.ToString()); + } + if (Optional.IsDefined(IsHotPatchingEnabled)) + { + writer.WritePropertyName("enableHotpatching"u8); + writer.WriteBooleanValue(IsHotPatchingEnabled.Value); + } + if (Optional.IsDefined(AssessmentMode)) + { + writer.WritePropertyName("assessmentMode"u8); + writer.WriteStringValue(AssessmentMode.Value.ToString()); + } + if (Optional.IsDefined(AutomaticByPlatformSettings)) + { + writer.WritePropertyName("automaticByPlatformSettings"u8); + writer.WriteObjectValue(AutomaticByPlatformSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmGuestPatchSettings 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(ComputeFleetVmGuestPatchSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmGuestPatchSettings(document.RootElement, options); + } + + internal static ComputeFleetVmGuestPatchSettings DeserializeComputeFleetVmGuestPatchSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetWindowsVmGuestPatchMode? patchMode = default; + bool? enableHotpatching = default; + ComputeFleetWindowsPatchAssessmentMode? assessmentMode = default; + ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patchMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchMode = new ComputeFleetWindowsVmGuestPatchMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("enableHotpatching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableHotpatching = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("assessmentMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assessmentMode = new ComputeFleetWindowsPatchAssessmentMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("automaticByPlatformSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + automaticByPlatformSettings = ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.DeserializeComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmGuestPatchSettings(patchMode, enableHotpatching, assessmentMode, automaticByPlatformSettings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmGuestPatchSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmGuestPatchSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmGuestPatchSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmGuestPatchSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.cs new file mode 100644 index 0000000000000..1f8da7ab1d0ff --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies settings related to VM Guest Patching on Windows. + public partial class ComputeFleetVmGuestPatchSettings + { + /// + /// 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 . + public ComputeFleetVmGuestPatchSettings() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible.<br /><br /> Possible values are:<br /><br /> **Manual** - You + /// control the application of patches to a virtual machine. You do this by + /// applying patches manually inside the VM. In this mode, automatic updates are + /// disabled; the property WindowsConfiguration.enableAutomaticUpdates must be + /// false<br /><br /> **AutomaticByOS** - The virtual machine will automatically be + /// updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates + /// must be true. <br /><br /> **AutomaticByPlatform** - the virtual machine will + /// automatically updated by the platform. The properties provisionVMAgent and + /// WindowsConfiguration.enableAutomaticUpdates must be true + /// + /// + /// Enables customers to patch their Azure VMs without requiring a reboot. For + /// enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' + /// must be set to 'AutomaticByPlatform'. + /// + /// + /// Specifies the mode of VM Guest patch assessment for the IaaS virtual + /// machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You + /// control the timing of patch assessments on a virtual machine.<br /><br /> + /// **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + /// The property provisionVMAgent must be true. + /// + /// + /// Specifies additional settings for patch mode AutomaticByPlatform in VM Guest + /// Patching on Windows. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmGuestPatchSettings(ComputeFleetWindowsVmGuestPatchMode? patchMode, bool? isHotPatchingEnabled, ComputeFleetWindowsPatchAssessmentMode? assessmentMode, ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings, IDictionary serializedAdditionalRawData) + { + PatchMode = patchMode; + IsHotPatchingEnabled = isHotPatchingEnabled; + AssessmentMode = assessmentMode; + AutomaticByPlatformSettings = automaticByPlatformSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible.<br /><br /> Possible values are:<br /><br /> **Manual** - You + /// control the application of patches to a virtual machine. You do this by + /// applying patches manually inside the VM. In this mode, automatic updates are + /// disabled; the property WindowsConfiguration.enableAutomaticUpdates must be + /// false<br /><br /> **AutomaticByOS** - The virtual machine will automatically be + /// updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates + /// must be true. <br /><br /> **AutomaticByPlatform** - the virtual machine will + /// automatically updated by the platform. The properties provisionVMAgent and + /// WindowsConfiguration.enableAutomaticUpdates must be true + /// + public ComputeFleetWindowsVmGuestPatchMode? PatchMode { get; set; } + /// + /// Enables customers to patch their Azure VMs without requiring a reboot. For + /// enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' + /// must be set to 'AutomaticByPlatform'. + /// + public bool? IsHotPatchingEnabled { get; set; } + /// + /// Specifies the mode of VM Guest patch assessment for the IaaS virtual + /// machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You + /// control the timing of patch assessments on a virtual machine.<br /><br /> + /// **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + /// The property provisionVMAgent must be true. + /// + public ComputeFleetWindowsPatchAssessmentMode? AssessmentMode { get; set; } + /// + /// Specifies additional settings for patch mode AutomaticByPlatform in VM Guest + /// Patching on Windows. + /// + public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.Serialization.cs new file mode 100644 index 0000000000000..71dbc4f837484 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.Serialization.cs @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(OSProfile)) + { + writer.WritePropertyName("osProfile"u8); + writer.WriteObjectValue(OSProfile, options); + } + if (Optional.IsDefined(StorageProfile)) + { + writer.WritePropertyName("storageProfile"u8); + writer.WriteObjectValue(StorageProfile, options); + } + if (Optional.IsDefined(NetworkProfile)) + { + writer.WritePropertyName("networkProfile"u8); + writer.WriteObjectValue(NetworkProfile, options); + } + if (Optional.IsDefined(SecurityProfile)) + { + writer.WritePropertyName("securityProfile"u8); + writer.WriteObjectValue(SecurityProfile, options); + } + if (Optional.IsDefined(DiagnosticsProfile)) + { + writer.WritePropertyName("diagnosticsProfile"u8); + writer.WriteObjectValue(DiagnosticsProfile, options); + } + if (Optional.IsDefined(ExtensionProfile)) + { + writer.WritePropertyName("extensionProfile"u8); + writer.WriteObjectValue(ExtensionProfile, options); + } + if (Optional.IsDefined(LicenseType)) + { + writer.WritePropertyName("licenseType"u8); + writer.WriteStringValue(LicenseType); + } + if (Optional.IsDefined(ScheduledEventsProfile)) + { + writer.WritePropertyName("scheduledEventsProfile"u8); + writer.WriteObjectValue(ScheduledEventsProfile, options); + } + if (Optional.IsDefined(UserData)) + { + writer.WritePropertyName("userData"u8); + writer.WriteStringValue(UserData); + } + if (Optional.IsDefined(CapacityReservation)) + { + writer.WritePropertyName("capacityReservation"u8); + writer.WriteObjectValue(CapacityReservation, options); + } + if (Optional.IsDefined(ApplicationProfile)) + { + writer.WritePropertyName("applicationProfile"u8); + writer.WriteObjectValue(ApplicationProfile, options); + } + if (Optional.IsDefined(HardwareProfile)) + { + writer.WritePropertyName("hardwareProfile"u8); + writer.WriteObjectValue(HardwareProfile, options); + } + if (Optional.IsDefined(ServiceArtifactReference)) + { + writer.WritePropertyName("serviceArtifactReference"u8); + JsonSerializer.Serialize(writer, ServiceArtifactReference); + } + if (Optional.IsDefined(SecurityPostureReference)) + { + writer.WritePropertyName("securityPostureReference"u8); + writer.WriteObjectValue(SecurityPostureReference, options); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(CreatedOn.Value, "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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmProfile 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(ComputeFleetVmProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmProfile(document.RootElement, options); + } + + internal static ComputeFleetVmProfile DeserializeComputeFleetVmProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetVmssOSProfile osProfile = default; + ComputeFleetVmssStorageProfile storageProfile = default; + ComputeFleetVmssNetworkProfile networkProfile = default; + ComputeFleetSecurityProfile securityProfile = default; + ComputeFleetDiagnosticsProfile diagnosticsProfile = default; + ComputeFleetVmssExtensionProfile extensionProfile = default; + string licenseType = default; + ComputeFleetScheduledEventsProfile scheduledEventsProfile = default; + string userData = default; + CapacityReservationProfile capacityReservation = default; + ComputeFleetApplicationProfile applicationProfile = default; + ComputeFleetVmssHardwareProfile hardwareProfile = default; + WritableSubResource serviceArtifactReference = default; + ComputeFleetSecurityPostureReference securityPostureReference = default; + DateTimeOffset? timeCreated = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("osProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osProfile = ComputeFleetVmssOSProfile.DeserializeComputeFleetVmssOSProfile(property.Value, options); + continue; + } + if (property.NameEquals("storageProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageProfile = ComputeFleetVmssStorageProfile.DeserializeComputeFleetVmssStorageProfile(property.Value, options); + continue; + } + if (property.NameEquals("networkProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkProfile = ComputeFleetVmssNetworkProfile.DeserializeComputeFleetVmssNetworkProfile(property.Value, options); + continue; + } + if (property.NameEquals("securityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityProfile = ComputeFleetSecurityProfile.DeserializeComputeFleetSecurityProfile(property.Value, options); + continue; + } + if (property.NameEquals("diagnosticsProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diagnosticsProfile = ComputeFleetDiagnosticsProfile.DeserializeComputeFleetDiagnosticsProfile(property.Value, options); + continue; + } + if (property.NameEquals("extensionProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extensionProfile = ComputeFleetVmssExtensionProfile.DeserializeComputeFleetVmssExtensionProfile(property.Value, options); + continue; + } + if (property.NameEquals("licenseType"u8)) + { + licenseType = property.Value.GetString(); + continue; + } + if (property.NameEquals("scheduledEventsProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledEventsProfile = ComputeFleetScheduledEventsProfile.DeserializeComputeFleetScheduledEventsProfile(property.Value, options); + continue; + } + if (property.NameEquals("userData"u8)) + { + userData = property.Value.GetString(); + continue; + } + if (property.NameEquals("capacityReservation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityReservation = CapacityReservationProfile.DeserializeCapacityReservationProfile(property.Value, options); + continue; + } + if (property.NameEquals("applicationProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applicationProfile = ComputeFleetApplicationProfile.DeserializeComputeFleetApplicationProfile(property.Value, options); + continue; + } + if (property.NameEquals("hardwareProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hardwareProfile = ComputeFleetVmssHardwareProfile.DeserializeComputeFleetVmssHardwareProfile(property.Value, options); + continue; + } + if (property.NameEquals("serviceArtifactReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceArtifactReference = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("securityPostureReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityPostureReference = ComputeFleetSecurityPostureReference.DeserializeComputeFleetSecurityPostureReference(property.Value, options); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmProfile( + osProfile, + storageProfile, + networkProfile, + securityProfile, + diagnosticsProfile, + extensionProfile, + licenseType, + scheduledEventsProfile, + userData, + capacityReservation, + applicationProfile, + hardwareProfile, + serviceArtifactReference, + securityPostureReference, + timeCreated, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.cs new file mode 100644 index 0000000000000..af10579b88ab7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.cs @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes the base virtual machine profile for fleet. + public partial class ComputeFleetVmProfile + { + /// + /// 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 . + public ComputeFleetVmProfile() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the operating system settings for the virtual machines in the scale + /// set. + /// + /// Specifies the storage settings for the virtual machine disks. + /// + /// Specifies properties of the network interfaces of the virtual machines in the + /// scale set. + /// + /// + /// Specifies the Security related profile settings for the virtual machines in the + /// scale set. + /// + /// Specifies the boot diagnostic settings state. + /// + /// Specifies a collection of settings for extensions installed on virtual machines + /// in the scale set. + /// + /// + /// Specifies that the image or disk that is being used was licensed on-premises. + /// <br><br> Possible values for Windows Server operating system are: <br><br> + /// Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS + /// (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for + /// Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// + /// Specifies Scheduled Event related configurations. + /// + /// UserData for the virtual machines in the scale set, which must be base-64 + /// encoded. Customer should not pass any secrets in here. Minimum api-version: + /// 2021-03-01. + /// + /// + /// Specifies the capacity reservation related details of a scale set. Minimum + /// api-version: 2021-04-01. + /// + /// Specifies the gallery applications that should be made available to the VM/VMSS. + /// + /// Specifies the hardware profile related details of a scale set. Minimum + /// api-version: 2021-11-01. + /// + /// + /// Specifies the service artifact reference id used to set same image version for + /// all virtual machines in the scale set when using 'latest' image version. + /// Minimum api-version: 2022-11-01 + /// + /// + /// Specifies the security posture to be used for all virtual machines in the scale + /// set. Minimum api-version: 2023-03-01 + /// + /// + /// Specifies the time in which this VM profile for the Virtual Machine Scale Set + /// was created. Minimum API version for this property is 2023-09-01. This value + /// will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile + /// with minimum api-version 2023-09-01. Examples: "2024-07-01T00:00:01.1234567+00:00" + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmProfile(ComputeFleetVmssOSProfile osProfile, ComputeFleetVmssStorageProfile storageProfile, ComputeFleetVmssNetworkProfile networkProfile, ComputeFleetSecurityProfile securityProfile, ComputeFleetDiagnosticsProfile diagnosticsProfile, ComputeFleetVmssExtensionProfile extensionProfile, string licenseType, ComputeFleetScheduledEventsProfile scheduledEventsProfile, string userData, CapacityReservationProfile capacityReservation, ComputeFleetApplicationProfile applicationProfile, ComputeFleetVmssHardwareProfile hardwareProfile, WritableSubResource serviceArtifactReference, ComputeFleetSecurityPostureReference securityPostureReference, DateTimeOffset? createdOn, IDictionary serializedAdditionalRawData) + { + OSProfile = osProfile; + StorageProfile = storageProfile; + NetworkProfile = networkProfile; + SecurityProfile = securityProfile; + DiagnosticsProfile = diagnosticsProfile; + ExtensionProfile = extensionProfile; + LicenseType = licenseType; + ScheduledEventsProfile = scheduledEventsProfile; + UserData = userData; + CapacityReservation = capacityReservation; + ApplicationProfile = applicationProfile; + HardwareProfile = hardwareProfile; + ServiceArtifactReference = serviceArtifactReference; + SecurityPostureReference = securityPostureReference; + CreatedOn = createdOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the operating system settings for the virtual machines in the scale + /// set. + /// + public ComputeFleetVmssOSProfile OSProfile { get; set; } + /// Specifies the storage settings for the virtual machine disks. + public ComputeFleetVmssStorageProfile StorageProfile { get; set; } + /// + /// Specifies properties of the network interfaces of the virtual machines in the + /// scale set. + /// + public ComputeFleetVmssNetworkProfile NetworkProfile { get; set; } + /// + /// Specifies the Security related profile settings for the virtual machines in the + /// scale set. + /// + public ComputeFleetSecurityProfile SecurityProfile { get; set; } + /// Specifies the boot diagnostic settings state. + internal ComputeFleetDiagnosticsProfile DiagnosticsProfile { get; set; } + /// + /// Boot Diagnostics is a debugging feature which allows you to view Console Output + /// and Screenshot to diagnose VM status. **NOTE**: If storageUri is being + /// specified then ensure that the storage account is in the same region and + /// subscription as the VM. You can easily view the output of your console log. + /// Azure also enables you to see a screenshot of the VM from the hypervisor. + /// + public ComputeFleetBootDiagnostics BootDiagnostics + { + get => DiagnosticsProfile is null ? default : DiagnosticsProfile.BootDiagnostics; + set + { + if (DiagnosticsProfile is null) + DiagnosticsProfile = new ComputeFleetDiagnosticsProfile(); + DiagnosticsProfile.BootDiagnostics = value; + } + } + + /// + /// Specifies a collection of settings for extensions installed on virtual machines + /// in the scale set. + /// + public ComputeFleetVmssExtensionProfile ExtensionProfile { get; set; } + /// + /// Specifies that the image or disk that is being used was licensed on-premises. + /// <br><br> Possible values for Windows Server operating system are: <br><br> + /// Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS + /// (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for + /// Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// + public string LicenseType { get; set; } + /// Specifies Scheduled Event related configurations. + public ComputeFleetScheduledEventsProfile ScheduledEventsProfile { get; set; } + /// + /// UserData for the virtual machines in the scale set, which must be base-64 + /// encoded. Customer should not pass any secrets in here. Minimum api-version: + /// 2021-03-01. + /// + public string UserData { get; set; } + /// + /// Specifies the capacity reservation related details of a scale set. Minimum + /// api-version: 2021-04-01. + /// + internal CapacityReservationProfile CapacityReservation { get; set; } + /// Gets or sets Id. + public ResourceIdentifier CapacityReservationGroupId + { + get => CapacityReservation is null ? default : CapacityReservation.CapacityReservationGroupId; + set + { + if (CapacityReservation is null) + CapacityReservation = new CapacityReservationProfile(); + CapacityReservation.CapacityReservationGroupId = value; + } + } + + /// Specifies the gallery applications that should be made available to the VM/VMSS. + internal ComputeFleetApplicationProfile ApplicationProfile { get; set; } + /// Specifies the gallery applications that should be made available to the VM/VMSS. + public IList GalleryApplications + { + get + { + if (ApplicationProfile is null) + ApplicationProfile = new ComputeFleetApplicationProfile(); + return ApplicationProfile.GalleryApplications; + } + } + + /// + /// Specifies the hardware profile related details of a scale set. Minimum + /// api-version: 2021-11-01. + /// + internal ComputeFleetVmssHardwareProfile HardwareProfile { get; set; } + /// + /// Specifies the properties for customizing the size of the virtual machine. + /// Minimum api-version: 2021-11-01. Please follow the instructions in [VM + /// Customization](https://aka.ms/vmcustomization) for more details. + /// + public ComputeFleetVmSizeProperties HardwareVmSizeProperties + { + get => HardwareProfile is null ? default : HardwareProfile.VmSizeProperties; + set + { + if (HardwareProfile is null) + HardwareProfile = new ComputeFleetVmssHardwareProfile(); + HardwareProfile.VmSizeProperties = value; + } + } + + /// + /// Specifies the service artifact reference id used to set same image version for + /// all virtual machines in the scale set when using 'latest' image version. + /// Minimum api-version: 2022-11-01 + /// + internal WritableSubResource ServiceArtifactReference { get; set; } + /// Gets or sets Id. + public ResourceIdentifier ServiceArtifactReferenceId + { + get => ServiceArtifactReference is null ? default : ServiceArtifactReference.Id; + set + { + if (ServiceArtifactReference is null) + ServiceArtifactReference = new WritableSubResource(); + ServiceArtifactReference.Id = value; + } + } + + /// + /// Specifies the security posture to be used for all virtual machines in the scale + /// set. Minimum api-version: 2023-03-01 + /// + public ComputeFleetSecurityPostureReference SecurityPostureReference { get; set; } + /// + /// Specifies the time in which this VM profile for the Virtual Machine Scale Set + /// was created. Minimum API version for this property is 2023-09-01. This value + /// will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile + /// with minimum api-version 2023-09-01. Examples: "2024-07-01T00:00:01.1234567+00:00" + /// + public DateTimeOffset? CreatedOn { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs new file mode 100644 index 0000000000000..cdfa44806c741 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmSizeProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Rank)) + { + writer.WritePropertyName("rank"u8); + writer.WriteNumberValue(Rank.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmSizeProfile 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(ComputeFleetVmSizeProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmSizeProfile(document.RootElement, options); + } + + internal static ComputeFleetVmSizeProfile DeserializeComputeFleetVmSizeProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + int? rank = 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("rank"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rank = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmSizeProfile(name, rank, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmSizeProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmSizeProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.cs new file mode 100644 index 0000000000000..64068a8203a1f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifications about a VM Size. This will also contain the corresponding rank and weight in future. + public partial class ComputeFleetVmSizeProfile + { + /// + /// 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 Sku name (e.g. 'Standard_DS1_v2'). + /// is null. + public ComputeFleetVmSizeProfile(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The Sku name (e.g. 'Standard_DS1_v2'). + /// + /// The rank of the VM size. This is used with 'RegularPriorityAllocationStrategy.Prioritized' + /// The lower the number, the higher the priority. Starting with 0. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmSizeProfile(string name, int? rank, IDictionary serializedAdditionalRawData) + { + Name = name; + Rank = rank; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmSizeProfile() + { + } + + /// The Sku name (e.g. 'Standard_DS1_v2'). + public string Name { get; set; } + /// + /// The rank of the VM size. This is used with 'RegularPriorityAllocationStrategy.Prioritized' + /// The lower the number, the higher the priority. Starting with 0. + /// + public int? Rank { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.Serialization.cs new file mode 100644 index 0000000000000..643ede08cf192 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmSizeProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(VCPUsAvailable)) + { + writer.WritePropertyName("vCPUsAvailable"u8); + writer.WriteNumberValue(VCPUsAvailable.Value); + } + if (Optional.IsDefined(VCPUsPerCore)) + { + writer.WritePropertyName("vCPUsPerCore"u8); + writer.WriteNumberValue(VCPUsPerCore.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmSizeProperties 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(ComputeFleetVmSizeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmSizeProperties(document.RootElement, options); + } + + internal static ComputeFleetVmSizeProperties DeserializeComputeFleetVmSizeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? vcpUsAvailable = default; + int? vcpUsPerCore = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vCPUsAvailable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vcpUsAvailable = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("vCPUsPerCore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vcpUsPerCore = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmSizeProperties(vcpUsAvailable, vcpUsPerCore, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProperties)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmSizeProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmSizeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.cs new file mode 100644 index 0000000000000..cfa5b1c6b3713 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies VM Size Property settings on the virtual machine. + public partial class ComputeFleetVmSizeProperties + { + /// + /// 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 . + public ComputeFleetVmSizeProperties() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the number of vCPUs available for the VM. When this property is not + /// specified in the request body the default behavior is to set it to the value of + /// vCPUs available for that VM size exposed in api response of [List all available + /// virtual machine sizes in a + /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + /// + /// + /// Specifies the vCPU to physical core ratio. When this property is not specified + /// in the request body the default behavior is set to the value of vCPUsPerCore + /// for the VM Size exposed in api response of [List all available virtual machine + /// sizes in a + /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + /// **Setting this property to 1 also means that hyper-threading is disabled.** + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmSizeProperties(int? vcpUsAvailable, int? vcpUsPerCore, IDictionary serializedAdditionalRawData) + { + VCPUsAvailable = vcpUsAvailable; + VCPUsPerCore = vcpUsPerCore; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the number of vCPUs available for the VM. When this property is not + /// specified in the request body the default behavior is to set it to the value of + /// vCPUs available for that VM size exposed in api response of [List all available + /// virtual machine sizes in a + /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + /// + public int? VCPUsAvailable { get; set; } + /// + /// Specifies the vCPU to physical core ratio. When this property is not specified + /// in the request body the default behavior is set to the value of vCPUsPerCore + /// for the VM Size exposed in api response of [List all available virtual machine + /// sizes in a + /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + /// **Setting this property to 1 also means that hyper-threading is disabled.** + /// + public int? VCPUsPerCore { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.Serialization.cs new file mode 100644 index 0000000000000..031e5236b3c64 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.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.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmss : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmss)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (options.Format != "W") + { + writer.WritePropertyName("operationStatus"u8); + writer.WriteStringValue(OperationStatus.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteObjectValue(Error, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmss 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(ComputeFleetVmss)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmss(document.RootElement, options); + } + + internal static ComputeFleetVmss DeserializeComputeFleetVmss(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string type = default; + ComputeFleetProvisioningState operationStatus = default; + ComputeFleetApiError error = 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("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("operationStatus"u8)) + { + operationStatus = new ComputeFleetProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ComputeFleetApiError.DeserializeComputeFleetApiError(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmss(id, type, operationStatus, 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); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmss)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmss IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmss(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmss)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.cs new file mode 100644 index 0000000000000..37a95a7c24794 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// An AzureFleet's virtualMachineScaleSet. + public partial class ComputeFleetVmss + { + /// + /// 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 compute RP resource id of the virtualMachineScaleSet + /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}" + /// + /// This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. + internal ComputeFleetVmss(string id, ComputeFleetProvisioningState operationStatus) + { + Id = id; + OperationStatus = operationStatus; + } + + /// Initializes a new instance of . + /// + /// The compute RP resource id of the virtualMachineScaleSet + /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}" + /// + /// Type of the virtualMachineScaleSet. + /// This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. + /// Error Information when `operationStatus` is `Failed`. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmss(string id, string type, ComputeFleetProvisioningState operationStatus, ComputeFleetApiError error, IDictionary serializedAdditionalRawData) + { + Id = id; + Type = type; + OperationStatus = operationStatus; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmss() + { + } + + /// + /// The compute RP resource id of the virtualMachineScaleSet + /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}" + /// + public string Id { get; } + /// Type of the virtualMachineScaleSet. + public string Type { get; } + /// This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. + public ComputeFleetProvisioningState OperationStatus { get; } + /// Error Information when `operationStatus` is `Failed`. + public ComputeFleetApiError Error { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.Serialization.cs new file mode 100644 index 0000000000000..56ce2107147ea --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.Serialization.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssDataDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssDataDisk)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + writer.WritePropertyName("lun"u8); + writer.WriteNumberValue(Lun); + if (Optional.IsDefined(Caching)) + { + writer.WritePropertyName("caching"u8); + writer.WriteStringValue(Caching.Value.ToString()); + } + if (Optional.IsDefined(IsWriteAcceleratorEnabled)) + { + writer.WritePropertyName("writeAcceleratorEnabled"u8); + writer.WriteBooleanValue(IsWriteAcceleratorEnabled.Value); + } + writer.WritePropertyName("createOption"u8); + writer.WriteStringValue(CreateOption.ToString()); + if (Optional.IsDefined(DiskSizeGB)) + { + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeGB.Value); + } + if (Optional.IsDefined(ManagedDisk)) + { + writer.WritePropertyName("managedDisk"u8); + writer.WriteObjectValue(ManagedDisk, options); + } + if (Optional.IsDefined(DiskIopsReadWrite)) + { + writer.WritePropertyName("diskIOPSReadWrite"u8); + writer.WriteNumberValue(DiskIopsReadWrite.Value); + } + if (Optional.IsDefined(DiskMbpsReadWrite)) + { + writer.WritePropertyName("diskMBpsReadWrite"u8); + writer.WriteNumberValue(DiskMbpsReadWrite.Value); + } + if (Optional.IsDefined(DeleteOption)) + { + writer.WritePropertyName("deleteOption"u8); + writer.WriteStringValue(DeleteOption.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssDataDisk 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(ComputeFleetVmssDataDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssDataDisk(document.RootElement, options); + } + + internal static ComputeFleetVmssDataDisk DeserializeComputeFleetVmssDataDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + int lun = default; + ComputeFleetCachingType? caching = default; + bool? writeAcceleratorEnabled = default; + ComputeFleetDiskCreateOptionType createOption = default; + int? diskSizeGB = default; + ComputeFleetVmssManagedDisk managedDisk = default; + long? diskIOPSReadWrite = default; + long? diskMBpsReadWrite = default; + ComputeFleetDiskDeleteOptionType? deleteOption = 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("lun"u8)) + { + lun = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("caching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + caching = new ComputeFleetCachingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("writeAcceleratorEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + writeAcceleratorEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("createOption"u8)) + { + createOption = new ComputeFleetDiskCreateOptionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeGB = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("managedDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedDisk = ComputeFleetVmssManagedDisk.DeserializeComputeFleetVmssManagedDisk(property.Value, options); + continue; + } + if (property.NameEquals("diskIOPSReadWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskIOPSReadWrite = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskMBpsReadWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskMBpsReadWrite = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("deleteOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOption = new ComputeFleetDiskDeleteOptionType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssDataDisk( + name, + lun, + caching, + writeAcceleratorEnabled, + createOption, + diskSizeGB, + managedDisk, + diskIOPSReadWrite, + diskMBpsReadWrite, + deleteOption, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssDataDisk)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssDataDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssDataDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssDataDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.cs new file mode 100644 index 0000000000000..fab909717cdac --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set data disk. + public partial class ComputeFleetVmssDataDisk + { + /// + /// 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 . + /// + /// Specifies the logical unit number of the data disk. This value is used to + /// identify data disks within the VM and therefore must be unique for each data + /// disk attached to a VM. + /// + /// The create option. + public ComputeFleetVmssDataDisk(int lun, ComputeFleetDiskCreateOptionType createOption) + { + Lun = lun; + CreateOption = createOption; + } + + /// Initializes a new instance of . + /// The disk name. + /// + /// Specifies the logical unit number of the data disk. This value is used to + /// identify data disks within the VM and therefore must be unique for each data + /// disk attached to a VM. + /// + /// + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// + /// Specifies whether writeAccelerator should be enabled or disabled on the disk. + /// The create option. + /// + /// Specifies the size of an empty data disk in gigabytes. This element can be used + /// to overwrite the size of the disk in a virtual machine image. The property + /// diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be + /// larger than 1023. + /// + /// The managed disk parameters. + /// + /// Specifies the Read-Write IOPS for the managed disk. Should be used only when + /// StorageAccountType is UltraSSD_LRS. If not specified, a default value would be + /// assigned based on diskSizeGB. + /// + /// + /// Specifies the bandwidth in MB per second for the managed disk. Should be used + /// only when StorageAccountType is UltraSSD_LRS. If not specified, a default value + /// would be assigned based on diskSizeGB. + /// + /// + /// Specifies whether data disk should be deleted or detached upon VMSS Flex + /// deletion (This feature is available for VMSS with Flexible OrchestrationMode + /// only).<br><br> Possible values: <br><br> **Delete** If this value is used, the + /// data disk is deleted when the VMSS Flex VM is deleted.<br><br> **Detach** If + /// this value is used, the data disk is retained after VMSS Flex VM is + /// deleted.<br><br> The default value is set to **Delete**. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssDataDisk(string name, int lun, ComputeFleetCachingType? caching, bool? isWriteAcceleratorEnabled, ComputeFleetDiskCreateOptionType createOption, int? diskSizeGB, ComputeFleetVmssManagedDisk managedDisk, long? diskIopsReadWrite, long? diskMbpsReadWrite, ComputeFleetDiskDeleteOptionType? deleteOption, IDictionary serializedAdditionalRawData) + { + Name = name; + Lun = lun; + Caching = caching; + IsWriteAcceleratorEnabled = isWriteAcceleratorEnabled; + CreateOption = createOption; + DiskSizeGB = diskSizeGB; + ManagedDisk = managedDisk; + DiskIopsReadWrite = diskIopsReadWrite; + DiskMbpsReadWrite = diskMbpsReadWrite; + DeleteOption = deleteOption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssDataDisk() + { + } + + /// The disk name. + public string Name { get; set; } + /// + /// Specifies the logical unit number of the data disk. This value is used to + /// identify data disks within the VM and therefore must be unique for each data + /// disk attached to a VM. + /// + public int Lun { get; set; } + /// + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// + public ComputeFleetCachingType? Caching { get; set; } + /// Specifies whether writeAccelerator should be enabled or disabled on the disk. + public bool? IsWriteAcceleratorEnabled { get; set; } + /// The create option. + public ComputeFleetDiskCreateOptionType CreateOption { get; set; } + /// + /// Specifies the size of an empty data disk in gigabytes. This element can be used + /// to overwrite the size of the disk in a virtual machine image. The property + /// diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be + /// larger than 1023. + /// + public int? DiskSizeGB { get; set; } + /// The managed disk parameters. + public ComputeFleetVmssManagedDisk ManagedDisk { get; set; } + /// + /// Specifies the Read-Write IOPS for the managed disk. Should be used only when + /// StorageAccountType is UltraSSD_LRS. If not specified, a default value would be + /// assigned based on diskSizeGB. + /// + public long? DiskIopsReadWrite { get; set; } + /// + /// Specifies the bandwidth in MB per second for the managed disk. Should be used + /// only when StorageAccountType is UltraSSD_LRS. If not specified, a default value + /// would be assigned based on diskSizeGB. + /// + public long? DiskMbpsReadWrite { get; set; } + /// + /// Specifies whether data disk should be deleted or detached upon VMSS Flex + /// deletion (This feature is available for VMSS with Flexible OrchestrationMode + /// only).<br><br> Possible values: <br><br> **Delete** If this value is used, the + /// data disk is deleted when the VMSS Flex VM is deleted.<br><br> **Detach** If + /// this value is used, the data disk is retained after VMSS Flex VM is + /// deleted.<br><br> The default value is set to **Delete**. + /// + public ComputeFleetDiskDeleteOptionType? DeleteOption { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.Serialization.cs new file mode 100644 index 0000000000000..362baba232106 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssExtension : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssExtension)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ExtensionType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ExtensionType); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssExtension 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(ComputeFleetVmssExtension)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssExtension(document.RootElement, options); + } + + internal static ComputeFleetVmssExtension DeserializeComputeFleetVmssExtension(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + string type = default; + ComputeFleetVmssExtensionProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ComputeFleetVmssExtensionProperties.DeserializeComputeFleetVmssExtensionProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssExtension(id, name, type, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssExtension)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssExtension IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssExtension(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssExtension)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.cs new file mode 100644 index 0000000000000..7a3b11a398591 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a Virtual Machine Scale Set Extension. + public partial class ComputeFleetVmssExtension + { + /// + /// 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 . + public ComputeFleetVmssExtension() + { + } + + /// Initializes a new instance of . + /// Resource Id. + /// The name of the extension. + /// Resource type. + /// Describes the properties of a Virtual Machine Scale Set Extension. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssExtension(ResourceIdentifier id, string name, string extensionType, ComputeFleetVmssExtensionProperties properties, IDictionary serializedAdditionalRawData) + { + Id = id; + Name = name; + ExtensionType = extensionType; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource Id. + public ResourceIdentifier Id { get; } + /// The name of the extension. + public string Name { get; set; } + /// Resource type. + public string ExtensionType { get; } + /// Describes the properties of a Virtual Machine Scale Set Extension. + public ComputeFleetVmssExtensionProperties Properties { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.Serialization.cs new file mode 100644 index 0000000000000..cb116c5385223 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssExtensionProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Extensions)) + { + writer.WritePropertyName("extensions"u8); + writer.WriteStartArray(); + foreach (var item in Extensions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ExtensionsTimeBudget)) + { + writer.WritePropertyName("extensionsTimeBudget"u8); + writer.WriteStringValue(ExtensionsTimeBudget); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssExtensionProfile 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(ComputeFleetVmssExtensionProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssExtensionProfile(document.RootElement, options); + } + + internal static ComputeFleetVmssExtensionProfile DeserializeComputeFleetVmssExtensionProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList extensions = default; + string extensionsTimeBudget = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("extensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmssExtension.DeserializeComputeFleetVmssExtension(item, options)); + } + extensions = array; + continue; + } + if (property.NameEquals("extensionsTimeBudget"u8)) + { + extensionsTimeBudget = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssExtensionProfile(extensions ?? new ChangeTrackingList(), extensionsTimeBudget, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssExtensionProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssExtensionProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.cs new file mode 100644 index 0000000000000..27d4e0d3e4108 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set extension profile. + public partial class ComputeFleetVmssExtensionProfile + { + /// + /// 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 . + public ComputeFleetVmssExtensionProfile() + { + Extensions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The virtual machine scale set child extension resources. + /// + /// Specifies the time alloted for all extensions to start. The time duration + /// should be between 15 minutes and 120 minutes (inclusive) and should be + /// specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). + /// Minimum api-version: 2020-06-01. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssExtensionProfile(IList extensions, string extensionsTimeBudget, IDictionary serializedAdditionalRawData) + { + Extensions = extensions; + ExtensionsTimeBudget = extensionsTimeBudget; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The virtual machine scale set child extension resources. + public IList Extensions { get; } + /// + /// Specifies the time alloted for all extensions to start. The time duration + /// should be between 15 minutes and 120 minutes (inclusive) and should be + /// specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). + /// Minimum api-version: 2020-06-01. + /// + public string ExtensionsTimeBudget { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.Serialization.cs new file mode 100644 index 0000000000000..932366bdb2358 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.Serialization.cs @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssExtensionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ForceUpdateTag)) + { + writer.WritePropertyName("forceUpdateTag"u8); + writer.WriteStringValue(ForceUpdateTag); + } + if (Optional.IsDefined(Publisher)) + { + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + } + if (Optional.IsDefined(ExtensionType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ExtensionType); + } + if (Optional.IsDefined(TypeHandlerVersion)) + { + writer.WritePropertyName("typeHandlerVersion"u8); + writer.WriteStringValue(TypeHandlerVersion); + } + if (Optional.IsDefined(ShouldAutoUpgradeMinorVersion)) + { + writer.WritePropertyName("autoUpgradeMinorVersion"u8); + writer.WriteBooleanValue(ShouldAutoUpgradeMinorVersion.Value); + } + if (Optional.IsDefined(IsAutomaticUpgradeEnabled)) + { + writer.WritePropertyName("enableAutomaticUpgrade"u8); + writer.WriteBooleanValue(IsAutomaticUpgradeEnabled.Value); + } + if (Optional.IsCollectionDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteStartObject(); + foreach (var item in Settings) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(ProtectedSettings)) + { + writer.WritePropertyName("protectedSettings"u8); + writer.WriteStartObject(); + foreach (var item in ProtectedSettings) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState); + } + if (Optional.IsCollectionDefined(ProvisionAfterExtensions)) + { + writer.WritePropertyName("provisionAfterExtensions"u8); + writer.WriteStartArray(); + foreach (var item in ProvisionAfterExtensions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IsSuppressFailuresEnabled)) + { + writer.WritePropertyName("suppressFailures"u8); + writer.WriteBooleanValue(IsSuppressFailuresEnabled.Value); + } + if (Optional.IsDefined(ProtectedSettingsFromKeyVault)) + { + writer.WritePropertyName("protectedSettingsFromKeyVault"u8); + writer.WriteObjectValue(ProtectedSettingsFromKeyVault, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssExtensionProperties 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(ComputeFleetVmssExtensionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssExtensionProperties(document.RootElement, options); + } + + internal static ComputeFleetVmssExtensionProperties DeserializeComputeFleetVmssExtensionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string forceUpdateTag = default; + string publisher = default; + string type = default; + string typeHandlerVersion = default; + bool? autoUpgradeMinorVersion = default; + bool? enableAutomaticUpgrade = default; + IDictionary settings = default; + IDictionary protectedSettings = default; + string provisioningState = default; + IList provisionAfterExtensions = default; + bool? suppressFailures = default; + ComputeFleetKeyVaultSecretReference protectedSettingsFromKeyVault = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("forceUpdateTag"u8)) + { + forceUpdateTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisher"u8)) + { + publisher = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("typeHandlerVersion"u8)) + { + typeHandlerVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUpgradeMinorVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpgradeMinorVersion = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableAutomaticUpgrade"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutomaticUpgrade = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + settings = dictionary; + continue; + } + if (property.NameEquals("protectedSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + protectedSettings = dictionary; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + provisioningState = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisionAfterExtensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + provisionAfterExtensions = array; + continue; + } + if (property.NameEquals("suppressFailures"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suppressFailures = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("protectedSettingsFromKeyVault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protectedSettingsFromKeyVault = ComputeFleetKeyVaultSecretReference.DeserializeComputeFleetKeyVaultSecretReference(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssExtensionProperties( + forceUpdateTag, + publisher, + type, + typeHandlerVersion, + autoUpgradeMinorVersion, + enableAutomaticUpgrade, + settings ?? new ChangeTrackingDictionary(), + protectedSettings ?? new ChangeTrackingDictionary(), + provisioningState, + provisionAfterExtensions ?? new ChangeTrackingList(), + suppressFailures, + protectedSettingsFromKeyVault, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProperties)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssExtensionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssExtensionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.cs new file mode 100644 index 0000000000000..3c01f85a9b289 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes the properties of a Virtual Machine Scale Set Extension. + public partial class ComputeFleetVmssExtensionProperties + { + /// + /// 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 . + public ComputeFleetVmssExtensionProperties() + { + Settings = new ChangeTrackingDictionary(); + ProtectedSettings = new ChangeTrackingDictionary(); + ProvisionAfterExtensions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// If a value is provided and is different from the previous value, the extension + /// handler will be forced to update even if the extension configuration has not + /// changed. + /// + /// The name of the extension handler publisher. + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// Specifies the version of the script handler. + /// + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will not + /// upgrade minor versions unless redeployed, even with this property set to true. + /// + /// + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + /// Json formatted public settings for the extension. + /// + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + /// The provisioning state, which only appears in the response. + /// + /// Collection of extension names after which this extension needs to be + /// provisioned. + /// + /// + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be suppressed + /// regardless of this value). The default is false. + /// + /// + /// The extensions protected settings that are passed by reference, and consumed + /// from key vault + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssExtensionProperties(string forceUpdateTag, string publisher, string extensionType, string typeHandlerVersion, bool? shouldAutoUpgradeMinorVersion, bool? isAutomaticUpgradeEnabled, IDictionary settings, IDictionary protectedSettings, string provisioningState, IList provisionAfterExtensions, bool? isSuppressFailuresEnabled, ComputeFleetKeyVaultSecretReference protectedSettingsFromKeyVault, IDictionary serializedAdditionalRawData) + { + ForceUpdateTag = forceUpdateTag; + Publisher = publisher; + ExtensionType = extensionType; + TypeHandlerVersion = typeHandlerVersion; + ShouldAutoUpgradeMinorVersion = shouldAutoUpgradeMinorVersion; + IsAutomaticUpgradeEnabled = isAutomaticUpgradeEnabled; + Settings = settings; + ProtectedSettings = protectedSettings; + ProvisioningState = provisioningState; + ProvisionAfterExtensions = provisionAfterExtensions; + IsSuppressFailuresEnabled = isSuppressFailuresEnabled; + ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// If a value is provided and is different from the previous value, the extension + /// handler will be forced to update even if the extension configuration has not + /// changed. + /// + public string ForceUpdateTag { get; set; } + /// The name of the extension handler publisher. + public string Publisher { get; set; } + /// Specifies the type of the extension; an example is "CustomScriptExtension". + public string ExtensionType { get; set; } + /// Specifies the version of the script handler. + public string TypeHandlerVersion { get; set; } + /// + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will not + /// upgrade minor versions unless redeployed, even with this property set to true. + /// + public bool? ShouldAutoUpgradeMinorVersion { get; set; } + /// + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + public bool? IsAutomaticUpgradeEnabled { get; set; } + /// + /// Json formatted public settings for the extension. + /// + /// 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" }. + /// + /// + /// + /// + public IDictionary Settings { get; } + /// + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + /// 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" }. + /// + /// + /// + /// + public IDictionary ProtectedSettings { get; } + /// The provisioning state, which only appears in the response. + public string ProvisioningState { get; } + /// + /// Collection of extension names after which this extension needs to be + /// provisioned. + /// + public IList ProvisionAfterExtensions { get; } + /// + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be suppressed + /// regardless of this value). The default is false. + /// + public bool? IsSuppressFailuresEnabled { get; set; } + /// + /// The extensions protected settings that are passed by reference, and consumed + /// from key vault + /// + public ComputeFleetKeyVaultSecretReference ProtectedSettingsFromKeyVault { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.Serialization.cs new file mode 100644 index 0000000000000..b423855e93aac --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetVmssHardwareProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssHardwareProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(VmSizeProperties)) + { + writer.WritePropertyName("vmSizeProperties"u8); + writer.WriteObjectValue(VmSizeProperties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssHardwareProfile 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(ComputeFleetVmssHardwareProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssHardwareProfile(document.RootElement, options); + } + + internal static ComputeFleetVmssHardwareProfile DeserializeComputeFleetVmssHardwareProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetVmSizeProperties vmSizeProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmSizeProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vmSizeProperties = ComputeFleetVmSizeProperties.DeserializeComputeFleetVmSizeProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssHardwareProfile(vmSizeProperties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssHardwareProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssHardwareProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssHardwareProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssHardwareProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.cs new file mode 100644 index 0000000000000..e785f95b4fc0f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies the hardware settings for the virtual machine scale set. + internal partial class ComputeFleetVmssHardwareProfile + { + /// + /// 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 . + public ComputeFleetVmssHardwareProfile() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the properties for customizing the size of the virtual machine. + /// Minimum api-version: 2021-11-01. Please follow the instructions in [VM + /// Customization](https://aka.ms/vmcustomization) for more details. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssHardwareProfile(ComputeFleetVmSizeProperties vmSizeProperties, IDictionary serializedAdditionalRawData) + { + VmSizeProperties = vmSizeProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the properties for customizing the size of the virtual machine. + /// Minimum api-version: 2021-11-01. Please follow the instructions in [VM + /// Customization](https://aka.ms/vmcustomization) for more details. + /// + public ComputeFleetVmSizeProperties VmSizeProperties { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.Serialization.cs new file mode 100644 index 0000000000000..226c64d6585c6 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssIPConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssIPConfiguration 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(ComputeFleetVmssIPConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssIPConfiguration(document.RootElement, options); + } + + internal static ComputeFleetVmssIPConfiguration DeserializeComputeFleetVmssIPConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ComputeFleetVmssIPConfigurationProperties 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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ComputeFleetVmssIPConfigurationProperties.DeserializeComputeFleetVmssIPConfigurationProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssIPConfiguration(name, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssIPConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssIPConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.cs new file mode 100644 index 0000000000000..f7e3e700acb8c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set network profile's IP configuration. + public partial class ComputeFleetVmssIPConfiguration + { + /// + /// 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 IP configuration name. + /// is null. + public ComputeFleetVmssIPConfiguration(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The IP configuration name. + /// + /// Describes a virtual machine scale set network profile's IP configuration + /// properties. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssIPConfiguration(string name, ComputeFleetVmssIPConfigurationProperties properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssIPConfiguration() + { + } + + /// The IP configuration name. + public string Name { get; set; } + /// + /// Describes a virtual machine scale set network profile's IP configuration + /// properties. + /// + public ComputeFleetVmssIPConfigurationProperties Properties { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.Serialization.cs new file mode 100644 index 0000000000000..9156cf8a3db69 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.Serialization.cs @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssIPConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfigurationProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Subnet)) + { + writer.WritePropertyName("subnet"u8); + JsonSerializer.Serialize(writer, Subnet); + } + if (Optional.IsDefined(IsPrimary)) + { + writer.WritePropertyName("primary"u8); + writer.WriteBooleanValue(IsPrimary.Value); + } + if (Optional.IsDefined(PublicIPAddressConfiguration)) + { + writer.WritePropertyName("publicIPAddressConfiguration"u8); + writer.WriteObjectValue(PublicIPAddressConfiguration, options); + } + if (Optional.IsDefined(PrivateIPAddressVersion)) + { + writer.WritePropertyName("privateIPAddressVersion"u8); + writer.WriteStringValue(PrivateIPAddressVersion.Value.ToString()); + } + if (Optional.IsCollectionDefined(ApplicationGatewayBackendAddressPools)) + { + writer.WritePropertyName("applicationGatewayBackendAddressPools"u8); + writer.WriteStartArray(); + foreach (var item in ApplicationGatewayBackendAddressPools) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ApplicationSecurityGroups)) + { + writer.WritePropertyName("applicationSecurityGroups"u8); + writer.WriteStartArray(); + foreach (var item in ApplicationSecurityGroups) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(LoadBalancerBackendAddressPools)) + { + writer.WritePropertyName("loadBalancerBackendAddressPools"u8); + writer.WriteStartArray(); + foreach (var item in LoadBalancerBackendAddressPools) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(LoadBalancerInboundNatPools)) + { + writer.WritePropertyName("loadBalancerInboundNatPools"u8); + writer.WriteStartArray(); + foreach (var item in LoadBalancerInboundNatPools) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssIPConfigurationProperties 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(ComputeFleetVmssIPConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssIPConfigurationProperties(document.RootElement, options); + } + + internal static ComputeFleetVmssIPConfigurationProperties DeserializeComputeFleetVmssIPConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WritableSubResource subnet = default; + bool? primary = default; + ComputeFleetVmssPublicIPAddressConfiguration publicIPAddressConfiguration = default; + ComputeFleetIPVersion? privateIPAddressVersion = default; + IList applicationGatewayBackendAddressPools = default; + IList applicationSecurityGroups = default; + IList loadBalancerBackendAddressPools = default; + IList loadBalancerInboundNatPools = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnet"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnet = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("primary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + primary = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("publicIPAddressConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicIPAddressConfiguration = ComputeFleetVmssPublicIPAddressConfiguration.DeserializeComputeFleetVmssPublicIPAddressConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("privateIPAddressVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateIPAddressVersion = new ComputeFleetIPVersion(property.Value.GetString()); + continue; + } + if (property.NameEquals("applicationGatewayBackendAddressPools"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + applicationGatewayBackendAddressPools = array; + continue; + } + if (property.NameEquals("applicationSecurityGroups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + applicationSecurityGroups = array; + continue; + } + if (property.NameEquals("loadBalancerBackendAddressPools"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + loadBalancerBackendAddressPools = array; + continue; + } + if (property.NameEquals("loadBalancerInboundNatPools"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + loadBalancerInboundNatPools = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssIPConfigurationProperties( + subnet, + primary, + publicIPAddressConfiguration, + privateIPAddressVersion, + applicationGatewayBackendAddressPools ?? new ChangeTrackingList(), + applicationSecurityGroups ?? new ChangeTrackingList(), + loadBalancerBackendAddressPools ?? new ChangeTrackingList(), + loadBalancerInboundNatPools ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssIPConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssIPConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.cs new file mode 100644 index 0000000000000..bbbb8e11a4ae7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Describes a virtual machine scale set network profile's IP configuration + /// properties. + /// + public partial class ComputeFleetVmssIPConfigurationProperties + { + /// + /// 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 . + public ComputeFleetVmssIPConfigurationProperties() + { + ApplicationGatewayBackendAddressPools = new ChangeTrackingList(); + ApplicationSecurityGroups = new ChangeTrackingList(); + LoadBalancerBackendAddressPools = new ChangeTrackingList(); + LoadBalancerInboundNatPools = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Specifies the identifier of the subnet. + /// + /// Specifies the primary network interface in case the virtual machine has more + /// than 1 network interface. + /// + /// The publicIPAddressConfiguration. + /// + /// Available from Api-Version 2017-03-30 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + /// values are: 'IPv4' and 'IPv6'. + /// + /// + /// Specifies an array of references to backend address pools of application + /// gateways. A scale set can reference backend address pools of multiple + /// application gateways. Multiple scale sets cannot use the same application + /// gateway. + /// + /// Specifies an array of references to application security group. + /// + /// Specifies an array of references to backend address pools of load balancers. A + /// scale set can reference backend address pools of one public and one internal + /// load balancer. Multiple scale sets cannot use the same basic sku load balancer. + /// + /// + /// Specifies an array of references to inbound Nat pools of the load balancers. A + /// scale set can reference inbound nat pools of one public and one internal load + /// balancer. Multiple scale sets cannot use the same basic sku load balancer. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssIPConfigurationProperties(WritableSubResource subnet, bool? isPrimary, ComputeFleetVmssPublicIPAddressConfiguration publicIPAddressConfiguration, ComputeFleetIPVersion? privateIPAddressVersion, IList applicationGatewayBackendAddressPools, IList applicationSecurityGroups, IList loadBalancerBackendAddressPools, IList loadBalancerInboundNatPools, IDictionary serializedAdditionalRawData) + { + Subnet = subnet; + IsPrimary = isPrimary; + PublicIPAddressConfiguration = publicIPAddressConfiguration; + PrivateIPAddressVersion = privateIPAddressVersion; + ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + ApplicationSecurityGroups = applicationSecurityGroups; + LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + LoadBalancerInboundNatPools = loadBalancerInboundNatPools; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the identifier of the subnet. + internal WritableSubResource Subnet { get; set; } + /// Gets or sets Id. + public ResourceIdentifier SubnetId + { + get => Subnet is null ? default : Subnet.Id; + set + { + if (Subnet is null) + Subnet = new WritableSubResource(); + Subnet.Id = value; + } + } + + /// + /// Specifies the primary network interface in case the virtual machine has more + /// than 1 network interface. + /// + public bool? IsPrimary { get; set; } + /// The publicIPAddressConfiguration. + public ComputeFleetVmssPublicIPAddressConfiguration PublicIPAddressConfiguration { get; set; } + /// + /// Available from Api-Version 2017-03-30 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + /// values are: 'IPv4' and 'IPv6'. + /// + public ComputeFleetIPVersion? PrivateIPAddressVersion { get; set; } + /// + /// Specifies an array of references to backend address pools of application + /// gateways. A scale set can reference backend address pools of multiple + /// application gateways. Multiple scale sets cannot use the same application + /// gateway. + /// + public IList ApplicationGatewayBackendAddressPools { get; } + /// Specifies an array of references to application security group. + public IList ApplicationSecurityGroups { get; } + /// + /// Specifies an array of references to backend address pools of load balancers. A + /// scale set can reference backend address pools of one public and one internal + /// load balancer. Multiple scale sets cannot use the same basic sku load balancer. + /// + public IList LoadBalancerBackendAddressPools { get; } + /// + /// Specifies an array of references to inbound Nat pools of the load balancers. A + /// scale set can reference inbound nat pools of one public and one internal load + /// balancer. Multiple scale sets cannot use the same basic sku load balancer. + /// + public IList LoadBalancerInboundNatPools { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.Serialization.cs new file mode 100644 index 0000000000000..507e408a603a3 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssIPTag : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssIPTag)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IPTagType)) + { + writer.WritePropertyName("ipTagType"u8); + writer.WriteStringValue(IPTagType); + } + if (Optional.IsDefined(Tag)) + { + writer.WritePropertyName("tag"u8); + writer.WriteStringValue(Tag); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssIPTag 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(ComputeFleetVmssIPTag)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssIPTag(document.RootElement, options); + } + + internal static ComputeFleetVmssIPTag DeserializeComputeFleetVmssIPTag(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string ipTagType = default; + string tag = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipTagType"u8)) + { + ipTagType = property.Value.GetString(); + continue; + } + if (property.NameEquals("tag"u8)) + { + tag = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssIPTag(ipTagType, tag, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssIPTag)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssIPTag IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssIPTag(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssIPTag)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.cs new file mode 100644 index 0000000000000..a7ea57f6da100 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Contains the IP tag associated with the public IP address. + public partial class ComputeFleetVmssIPTag + { + /// + /// 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 . + public ComputeFleetVmssIPTag() + { + } + + /// Initializes a new instance of . + /// IP tag type. Example: FirstPartyUsage. + /// IP tag associated with the public IP. Example: SQL, Storage etc. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssIPTag(string ipTagType, string tag, IDictionary serializedAdditionalRawData) + { + IPTagType = ipTagType; + Tag = tag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// IP tag type. Example: FirstPartyUsage. + public string IPTagType { get; set; } + /// IP tag associated with the public IP. Example: SQL, Storage etc. + public string Tag { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.Serialization.cs new file mode 100644 index 0000000000000..30355dc68eb15 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.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.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssManagedDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssManagedDisk)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(StorageAccountType)) + { + writer.WritePropertyName("storageAccountType"u8); + writer.WriteStringValue(StorageAccountType.Value.ToString()); + } + if (Optional.IsDefined(DiskEncryptionSet)) + { + writer.WritePropertyName("diskEncryptionSet"u8); + JsonSerializer.Serialize(writer, DiskEncryptionSet); + } + if (Optional.IsDefined(SecurityProfile)) + { + writer.WritePropertyName("securityProfile"u8); + writer.WriteObjectValue(SecurityProfile, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssManagedDisk 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(ComputeFleetVmssManagedDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssManagedDisk(document.RootElement, options); + } + + internal static ComputeFleetVmssManagedDisk DeserializeComputeFleetVmssManagedDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetStorageAccountType? storageAccountType = default; + WritableSubResource diskEncryptionSet = default; + ComputeFleetVmDiskSecurityProfile securityProfile = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageAccountType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageAccountType = new ComputeFleetStorageAccountType(property.Value.GetString()); + continue; + } + if (property.NameEquals("diskEncryptionSet"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskEncryptionSet = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("securityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityProfile = ComputeFleetVmDiskSecurityProfile.DeserializeComputeFleetVmDiskSecurityProfile(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssManagedDisk(storageAccountType, diskEncryptionSet, securityProfile, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssManagedDisk)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssManagedDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssManagedDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssManagedDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.cs new file mode 100644 index 0000000000000..8136c5f08856b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.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; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes the parameters of a ScaleSet managed disk. + public partial class ComputeFleetVmssManagedDisk + { + /// + /// 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 . + public ComputeFleetVmssManagedDisk() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can + /// only be used with data disks, it cannot be used with OS Disk. + /// + /// + /// Specifies the customer managed disk encryption set resource id for the managed + /// disk. + /// + /// Specifies the security profile for the managed disk. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssManagedDisk(ComputeFleetStorageAccountType? storageAccountType, WritableSubResource diskEncryptionSet, ComputeFleetVmDiskSecurityProfile securityProfile, IDictionary serializedAdditionalRawData) + { + StorageAccountType = storageAccountType; + DiskEncryptionSet = diskEncryptionSet; + SecurityProfile = securityProfile; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can + /// only be used with data disks, it cannot be used with OS Disk. + /// + public ComputeFleetStorageAccountType? StorageAccountType { get; set; } + /// + /// Specifies the customer managed disk encryption set resource id for the managed + /// disk. + /// + internal WritableSubResource DiskEncryptionSet { get; set; } + /// Gets or sets Id. + public ResourceIdentifier DiskEncryptionSetId + { + get => DiskEncryptionSet is null ? default : DiskEncryptionSet.Id; + set + { + if (DiskEncryptionSet is null) + DiskEncryptionSet = new WritableSubResource(); + DiskEncryptionSet.Id = value; + } + } + + /// Specifies the security profile for the managed disk. + public ComputeFleetVmDiskSecurityProfile SecurityProfile { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.Serialization.cs new file mode 100644 index 0000000000000..68b09bc5b9473 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssNetworkConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssNetworkConfiguration 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(ComputeFleetVmssNetworkConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssNetworkConfiguration(document.RootElement, options); + } + + internal static ComputeFleetVmssNetworkConfiguration DeserializeComputeFleetVmssNetworkConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ComputeFleetVmssNetworkConfigurationProperties 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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ComputeFleetVmssNetworkConfigurationProperties.DeserializeComputeFleetVmssNetworkConfigurationProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssNetworkConfiguration(name, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssNetworkConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssNetworkConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.cs new file mode 100644 index 0000000000000..c850099199d4b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set network profile's network configurations. + public partial class ComputeFleetVmssNetworkConfiguration + { + /// + /// 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 network configuration name. + /// is null. + public ComputeFleetVmssNetworkConfiguration(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The network configuration name. + /// Describes a virtual machine scale set network profile's IP configuration. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssNetworkConfiguration(string name, ComputeFleetVmssNetworkConfigurationProperties properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssNetworkConfiguration() + { + } + + /// The network configuration name. + public string Name { get; set; } + /// Describes a virtual machine scale set network profile's IP configuration. + public ComputeFleetVmssNetworkConfigurationProperties Properties { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.Serialization.cs new file mode 100644 index 0000000000000..a57d4babc99b7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.Serialization.cs @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssNetworkConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfigurationProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IsPrimary)) + { + writer.WritePropertyName("primary"u8); + writer.WriteBooleanValue(IsPrimary.Value); + } + if (Optional.IsDefined(IsAcceleratedNetworkingEnabled)) + { + writer.WritePropertyName("enableAcceleratedNetworking"u8); + writer.WriteBooleanValue(IsAcceleratedNetworkingEnabled.Value); + } + if (Optional.IsDefined(IsTcpStateTrackingDisabled)) + { + writer.WritePropertyName("disableTcpStateTracking"u8); + writer.WriteBooleanValue(IsTcpStateTrackingDisabled.Value); + } + if (Optional.IsDefined(IsFpgaEnabled)) + { + writer.WritePropertyName("enableFpga"u8); + writer.WriteBooleanValue(IsFpgaEnabled.Value); + } + if (Optional.IsDefined(NetworkSecurityGroup)) + { + writer.WritePropertyName("networkSecurityGroup"u8); + JsonSerializer.Serialize(writer, NetworkSecurityGroup); + } + if (Optional.IsDefined(DnsSettings)) + { + writer.WritePropertyName("dnsSettings"u8); + writer.WriteObjectValue(DnsSettings, options); + } + writer.WritePropertyName("ipConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in IPConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(IsIPForwardingEnabled)) + { + writer.WritePropertyName("enableIPForwarding"u8); + writer.WriteBooleanValue(IsIPForwardingEnabled.Value); + } + if (Optional.IsDefined(DeleteOption)) + { + writer.WritePropertyName("deleteOption"u8); + writer.WriteStringValue(DeleteOption.Value.ToString()); + } + if (Optional.IsDefined(AuxiliaryMode)) + { + writer.WritePropertyName("auxiliaryMode"u8); + writer.WriteStringValue(AuxiliaryMode.Value.ToString()); + } + if (Optional.IsDefined(AuxiliarySku)) + { + writer.WritePropertyName("auxiliarySku"u8); + writer.WriteStringValue(AuxiliarySku.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssNetworkConfigurationProperties 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(ComputeFleetVmssNetworkConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssNetworkConfigurationProperties(document.RootElement, options); + } + + internal static ComputeFleetVmssNetworkConfigurationProperties DeserializeComputeFleetVmssNetworkConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? primary = default; + bool? enableAcceleratedNetworking = default; + bool? disableTcpStateTracking = default; + bool? enableFpga = default; + WritableSubResource networkSecurityGroup = default; + ComputeFleetVmssNetworkDnsSettings dnsSettings = default; + IList ipConfigurations = default; + bool? enableIPForwarding = default; + ComputeFleetVmDeleteOption? deleteOption = default; + ComputeFleetNetworkInterfaceAuxiliaryMode? auxiliaryMode = default; + ComputeFleetNetworkInterfaceAuxiliarySku? auxiliarySku = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("primary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + primary = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableAcceleratedNetworking"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAcceleratedNetworking = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("disableTcpStateTracking"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disableTcpStateTracking = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableFpga"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableFpga = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("networkSecurityGroup"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkSecurityGroup = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("dnsSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dnsSettings = ComputeFleetVmssNetworkDnsSettings.DeserializeComputeFleetVmssNetworkDnsSettings(property.Value, options); + continue; + } + if (property.NameEquals("ipConfigurations"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmssIPConfiguration.DeserializeComputeFleetVmssIPConfiguration(item, options)); + } + ipConfigurations = array; + continue; + } + if (property.NameEquals("enableIPForwarding"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableIPForwarding = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("deleteOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOption = new ComputeFleetVmDeleteOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("auxiliaryMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + auxiliaryMode = new ComputeFleetNetworkInterfaceAuxiliaryMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("auxiliarySku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + auxiliarySku = new ComputeFleetNetworkInterfaceAuxiliarySku(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssNetworkConfigurationProperties( + primary, + enableAcceleratedNetworking, + disableTcpStateTracking, + enableFpga, + networkSecurityGroup, + dnsSettings, + ipConfigurations, + enableIPForwarding, + deleteOption, + auxiliaryMode, + auxiliarySku, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssNetworkConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssNetworkConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.cs new file mode 100644 index 0000000000000..d1d5b885c2f49 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.cs @@ -0,0 +1,159 @@ +// 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.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set network profile's IP configuration. + public partial class ComputeFleetVmssNetworkConfigurationProperties + { + /// + /// 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 . + /// Specifies the IP configurations of the network interface. + /// is null. + public ComputeFleetVmssNetworkConfigurationProperties(IEnumerable ipConfigurations) + { + Argument.AssertNotNull(ipConfigurations, nameof(ipConfigurations)); + + IPConfigurations = ipConfigurations.ToList(); + } + + /// Initializes a new instance of . + /// + /// Specifies the primary network interface in case the virtual machine has more + /// than 1 network interface. + /// + /// Specifies whether the network interface is accelerated networking-enabled. + /// Specifies whether the network interface is disabled for tcp state tracking. + /// Specifies whether the network interface is FPGA networking-enabled. + /// The network security group. + /// The dns settings to be applied on the network interfaces. + /// Specifies the IP configurations of the network interface. + /// Whether IP forwarding enabled on this NIC. + /// Specify what happens to the network interface when the VM is deleted. + /// + /// Specifies whether the Auxiliary mode is enabled for the Network Interface + /// resource. + /// + /// + /// Specifies whether the Auxiliary sku is enabled for the Network Interface + /// resource. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssNetworkConfigurationProperties(bool? isPrimary, bool? isAcceleratedNetworkingEnabled, bool? isTcpStateTrackingDisabled, bool? isFpgaEnabled, WritableSubResource networkSecurityGroup, ComputeFleetVmssNetworkDnsSettings dnsSettings, IList ipConfigurations, bool? isIPForwardingEnabled, ComputeFleetVmDeleteOption? deleteOption, ComputeFleetNetworkInterfaceAuxiliaryMode? auxiliaryMode, ComputeFleetNetworkInterfaceAuxiliarySku? auxiliarySku, IDictionary serializedAdditionalRawData) + { + IsPrimary = isPrimary; + IsAcceleratedNetworkingEnabled = isAcceleratedNetworkingEnabled; + IsTcpStateTrackingDisabled = isTcpStateTrackingDisabled; + IsFpgaEnabled = isFpgaEnabled; + NetworkSecurityGroup = networkSecurityGroup; + DnsSettings = dnsSettings; + IPConfigurations = ipConfigurations; + IsIPForwardingEnabled = isIPForwardingEnabled; + DeleteOption = deleteOption; + AuxiliaryMode = auxiliaryMode; + AuxiliarySku = auxiliarySku; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssNetworkConfigurationProperties() + { + } + + /// + /// Specifies the primary network interface in case the virtual machine has more + /// than 1 network interface. + /// + public bool? IsPrimary { get; set; } + /// Specifies whether the network interface is accelerated networking-enabled. + public bool? IsAcceleratedNetworkingEnabled { get; set; } + /// Specifies whether the network interface is disabled for tcp state tracking. + public bool? IsTcpStateTrackingDisabled { get; set; } + /// Specifies whether the network interface is FPGA networking-enabled. + public bool? IsFpgaEnabled { get; set; } + /// The network security group. + internal WritableSubResource NetworkSecurityGroup { get; set; } + /// Gets or sets Id. + public ResourceIdentifier NetworkSecurityGroupId + { + get => NetworkSecurityGroup is null ? default : NetworkSecurityGroup.Id; + set + { + if (NetworkSecurityGroup is null) + NetworkSecurityGroup = new WritableSubResource(); + NetworkSecurityGroup.Id = value; + } + } + + /// The dns settings to be applied on the network interfaces. + internal ComputeFleetVmssNetworkDnsSettings DnsSettings { get; set; } + /// List of DNS servers IP addresses. + public IList DnsServers + { + get + { + if (DnsSettings is null) + DnsSettings = new ComputeFleetVmssNetworkDnsSettings(); + return DnsSettings.DnsServers; + } + } + + /// Specifies the IP configurations of the network interface. + public IList IPConfigurations { get; } + /// Whether IP forwarding enabled on this NIC. + public bool? IsIPForwardingEnabled { get; set; } + /// Specify what happens to the network interface when the VM is deleted. + public ComputeFleetVmDeleteOption? DeleteOption { get; set; } + /// + /// Specifies whether the Auxiliary mode is enabled for the Network Interface + /// resource. + /// + public ComputeFleetNetworkInterfaceAuxiliaryMode? AuxiliaryMode { get; set; } + /// + /// Specifies whether the Auxiliary sku is enabled for the Network Interface + /// resource. + /// + public ComputeFleetNetworkInterfaceAuxiliarySku? AuxiliarySku { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.Serialization.cs new file mode 100644 index 0000000000000..5282bc5a80df2 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetVmssNetworkDnsSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkDnsSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(DnsServers)) + { + writer.WritePropertyName("dnsServers"u8); + writer.WriteStartArray(); + foreach (var item in DnsServers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssNetworkDnsSettings 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(ComputeFleetVmssNetworkDnsSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssNetworkDnsSettings(document.RootElement, options); + } + + internal static ComputeFleetVmssNetworkDnsSettings DeserializeComputeFleetVmssNetworkDnsSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList dnsServers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dnsServers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dnsServers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssNetworkDnsSettings(dnsServers ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkDnsSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssNetworkDnsSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssNetworkDnsSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkDnsSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.cs new file mode 100644 index 0000000000000..2072d5073cbaa --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machines scale sets network configuration's DNS settings. + internal partial class ComputeFleetVmssNetworkDnsSettings + { + /// + /// 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 . + public ComputeFleetVmssNetworkDnsSettings() + { + DnsServers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of DNS servers IP addresses. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssNetworkDnsSettings(IList dnsServers, IDictionary serializedAdditionalRawData) + { + DnsServers = dnsServers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of DNS servers IP addresses. + public IList DnsServers { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.Serialization.cs new file mode 100644 index 0000000000000..87f624243d6a5 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.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.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssNetworkProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(HealthProbe)) + { + writer.WritePropertyName("healthProbe"u8); + JsonSerializer.Serialize(writer, HealthProbe); + } + if (Optional.IsCollectionDefined(NetworkInterfaceConfigurations)) + { + writer.WritePropertyName("networkInterfaceConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in NetworkInterfaceConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NetworkApiVersion)) + { + writer.WritePropertyName("networkApiVersion"u8); + writer.WriteStringValue(NetworkApiVersion.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssNetworkProfile 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(ComputeFleetVmssNetworkProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssNetworkProfile(document.RootElement, options); + } + + internal static ComputeFleetVmssNetworkProfile DeserializeComputeFleetVmssNetworkProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WritableSubResource healthProbe = default; + IList networkInterfaceConfigurations = default; + ComputeFleetNetworkApiVersion? networkApiVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("healthProbe"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + healthProbe = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("networkInterfaceConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmssNetworkConfiguration.DeserializeComputeFleetVmssNetworkConfiguration(item, options)); + } + networkInterfaceConfigurations = array; + continue; + } + if (property.NameEquals("networkApiVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkApiVersion = new ComputeFleetNetworkApiVersion(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssNetworkProfile(healthProbe, networkInterfaceConfigurations ?? new ChangeTrackingList(), networkApiVersion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssNetworkProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssNetworkProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.cs new file mode 100644 index 0000000000000..be081abe9446e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set network profile. + public partial class ComputeFleetVmssNetworkProfile + { + /// + /// 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 . + public ComputeFleetVmssNetworkProfile() + { + NetworkInterfaceConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// A reference to a load balancer probe used to determine the health of an + /// instance in the virtual machine scale set. The reference will be in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + /// + /// The list of network configurations. + /// + /// specifies the Microsoft.Network API version used when creating networking + /// resources in the Network Interface Configurations for Virtual Machine Scale Set + /// with orchestration mode 'Flexible' + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssNetworkProfile(WritableSubResource healthProbe, IList networkInterfaceConfigurations, ComputeFleetNetworkApiVersion? networkApiVersion, IDictionary serializedAdditionalRawData) + { + HealthProbe = healthProbe; + NetworkInterfaceConfigurations = networkInterfaceConfigurations; + NetworkApiVersion = networkApiVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// A reference to a load balancer probe used to determine the health of an + /// instance in the virtual machine scale set. The reference will be in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + /// + internal WritableSubResource HealthProbe { get; set; } + /// Gets or sets Id. + public ResourceIdentifier HealthProbeId + { + get => HealthProbe is null ? default : HealthProbe.Id; + set + { + if (HealthProbe is null) + HealthProbe = new WritableSubResource(); + HealthProbe.Id = value; + } + } + + /// The list of network configurations. + public IList NetworkInterfaceConfigurations { get; } + /// + /// specifies the Microsoft.Network API version used when creating networking + /// resources in the Network Interface Configurations for Virtual Machine Scale Set + /// with orchestration mode 'Flexible' + /// + public ComputeFleetNetworkApiVersion? NetworkApiVersion { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.Serialization.cs new file mode 100644 index 0000000000000..4f726e12f9294 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.Serialization.cs @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssOSDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssOSDisk)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Caching)) + { + writer.WritePropertyName("caching"u8); + writer.WriteStringValue(Caching.Value.ToString()); + } + if (Optional.IsDefined(IsWriteAcceleratorEnabled)) + { + writer.WritePropertyName("writeAcceleratorEnabled"u8); + writer.WriteBooleanValue(IsWriteAcceleratorEnabled.Value); + } + writer.WritePropertyName("createOption"u8); + writer.WriteStringValue(CreateOption.ToString()); + if (Optional.IsDefined(DiffDiskSettings)) + { + writer.WritePropertyName("diffDiskSettings"u8); + writer.WriteObjectValue(DiffDiskSettings, options); + } + if (Optional.IsDefined(DiskSizeGB)) + { + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeGB.Value); + } + if (Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType.Value.ToString()); + } + if (Optional.IsDefined(Image)) + { + writer.WritePropertyName("image"u8); + writer.WriteObjectValue(Image, options); + } + if (Optional.IsCollectionDefined(VhdContainers)) + { + writer.WritePropertyName("vhdContainers"u8); + writer.WriteStartArray(); + foreach (var item in VhdContainers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ManagedDisk)) + { + writer.WritePropertyName("managedDisk"u8); + writer.WriteObjectValue(ManagedDisk, options); + } + if (Optional.IsDefined(DeleteOption)) + { + writer.WritePropertyName("deleteOption"u8); + writer.WriteStringValue(DeleteOption.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssOSDisk 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(ComputeFleetVmssOSDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssOSDisk(document.RootElement, options); + } + + internal static ComputeFleetVmssOSDisk DeserializeComputeFleetVmssOSDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ComputeFleetCachingType? caching = default; + bool? writeAcceleratorEnabled = default; + ComputeFleetDiskCreateOptionType createOption = default; + ComputeFleetDiffDiskSettings diffDiskSettings = default; + int? diskSizeGB = default; + ComputeFleetOperatingSystemType? osType = default; + ComputeFleetVirtualHardDisk image = default; + IList vhdContainers = default; + ComputeFleetVmssManagedDisk managedDisk = default; + ComputeFleetDiskDeleteOptionType? deleteOption = 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("caching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + caching = new ComputeFleetCachingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("writeAcceleratorEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + writeAcceleratorEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("createOption"u8)) + { + createOption = new ComputeFleetDiskCreateOptionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("diffDiskSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diffDiskSettings = ComputeFleetDiffDiskSettings.DeserializeComputeFleetDiffDiskSettings(property.Value, options); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeGB = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("osType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osType = new ComputeFleetOperatingSystemType(property.Value.GetString()); + continue; + } + if (property.NameEquals("image"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + image = ComputeFleetVirtualHardDisk.DeserializeComputeFleetVirtualHardDisk(property.Value, options); + continue; + } + if (property.NameEquals("vhdContainers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vhdContainers = array; + continue; + } + if (property.NameEquals("managedDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedDisk = ComputeFleetVmssManagedDisk.DeserializeComputeFleetVmssManagedDisk(property.Value, options); + continue; + } + if (property.NameEquals("deleteOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOption = new ComputeFleetDiskDeleteOptionType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssOSDisk( + name, + caching, + writeAcceleratorEnabled, + createOption, + diffDiskSettings, + diskSizeGB, + osType, + image, + vhdContainers ?? new ChangeTrackingList(), + managedDisk, + deleteOption, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssOSDisk)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssOSDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssOSDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssOSDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.cs new file mode 100644 index 0000000000000..4509a4404fcfa --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set operating system disk. + public partial class ComputeFleetVmssOSDisk + { + /// + /// 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 . + /// + /// Specifies how the virtual machines in the scale set should be created. The only + /// allowed value is: **FromImage.** This value is used when you are using an image + /// to create the virtual machine. If you are using a platform image, you also use + /// the imageReference element described above. If you are using a marketplace + /// image, you also use the plan element previously described. + /// + public ComputeFleetVmssOSDisk(ComputeFleetDiskCreateOptionType createOption) + { + CreateOption = createOption; + VhdContainers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The disk name. + /// + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// + /// Specifies whether writeAccelerator should be enabled or disabled on the disk. + /// + /// Specifies how the virtual machines in the scale set should be created. The only + /// allowed value is: **FromImage.** This value is used when you are using an image + /// to create the virtual machine. If you are using a platform image, you also use + /// the imageReference element described above. If you are using a marketplace + /// image, you also use the plan element previously described. + /// + /// + /// Specifies the ephemeral disk Settings for the operating system disk used by the + /// virtual machine scale set. + /// + /// + /// Specifies the size of an empty data disk in gigabytes. This element can be used + /// to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' + /// is the number of bytes x 1024^3 for the disk and the value cannot + /// be larger than 1023. + /// + /// + /// This property allows you to specify the type of the OS that is included in the + /// disk if creating a VM from user-image or a specialized VHD. Possible values + /// are: **Windows,** **Linux.** + /// + /// Specifies information about the unmanaged user image to base the scale set on. + /// + /// Specifies the container urls that are used to store operating system disks for + /// the scale set. + /// + /// The managed disk parameters. + /// + /// Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion + /// (This feature is available for VMSS with Flexible OrchestrationMode only). + /// <br><br> Possible values: <br><br> **Delete** If this value is used, the OS + /// disk is deleted when VMSS Flex VM is deleted.<br><br> **Detach** If this value + /// is used, the OS disk is retained after VMSS Flex VM is deleted. <br><br> The + /// default value is set to **Delete**. For an Ephemeral OS Disk, the default value + /// is set to **Delete**. User cannot change the delete option for Ephemeral OS + /// Disk. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssOSDisk(string name, ComputeFleetCachingType? caching, bool? isWriteAcceleratorEnabled, ComputeFleetDiskCreateOptionType createOption, ComputeFleetDiffDiskSettings diffDiskSettings, int? diskSizeGB, ComputeFleetOperatingSystemType? osType, ComputeFleetVirtualHardDisk image, IList vhdContainers, ComputeFleetVmssManagedDisk managedDisk, ComputeFleetDiskDeleteOptionType? deleteOption, IDictionary serializedAdditionalRawData) + { + Name = name; + Caching = caching; + IsWriteAcceleratorEnabled = isWriteAcceleratorEnabled; + CreateOption = createOption; + DiffDiskSettings = diffDiskSettings; + DiskSizeGB = diskSizeGB; + OSType = osType; + Image = image; + VhdContainers = vhdContainers; + ManagedDisk = managedDisk; + DeleteOption = deleteOption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssOSDisk() + { + } + + /// The disk name. + public string Name { get; set; } + /// + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// + public ComputeFleetCachingType? Caching { get; set; } + /// Specifies whether writeAccelerator should be enabled or disabled on the disk. + public bool? IsWriteAcceleratorEnabled { get; set; } + /// + /// Specifies how the virtual machines in the scale set should be created. The only + /// allowed value is: **FromImage.** This value is used when you are using an image + /// to create the virtual machine. If you are using a platform image, you also use + /// the imageReference element described above. If you are using a marketplace + /// image, you also use the plan element previously described. + /// + public ComputeFleetDiskCreateOptionType CreateOption { get; set; } + /// + /// Specifies the ephemeral disk Settings for the operating system disk used by the + /// virtual machine scale set. + /// + public ComputeFleetDiffDiskSettings DiffDiskSettings { get; set; } + /// + /// Specifies the size of an empty data disk in gigabytes. This element can be used + /// to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' + /// is the number of bytes x 1024^3 for the disk and the value cannot + /// be larger than 1023. + /// + public int? DiskSizeGB { get; set; } + /// + /// This property allows you to specify the type of the OS that is included in the + /// disk if creating a VM from user-image or a specialized VHD. Possible values + /// are: **Windows,** **Linux.** + /// + public ComputeFleetOperatingSystemType? OSType { get; set; } + /// Specifies information about the unmanaged user image to base the scale set on. + internal ComputeFleetVirtualHardDisk Image { get; set; } + /// Specifies the virtual hard disk's uri. + public Uri ImageUri + { + get => Image is null ? default : Image.Uri; + set + { + if (Image is null) + Image = new ComputeFleetVirtualHardDisk(); + Image.Uri = value; + } + } + + /// + /// Specifies the container urls that are used to store operating system disks for + /// the scale set. + /// + public IList VhdContainers { get; } + /// The managed disk parameters. + public ComputeFleetVmssManagedDisk ManagedDisk { get; set; } + /// + /// Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion + /// (This feature is available for VMSS with Flexible OrchestrationMode only). + /// <br><br> Possible values: <br><br> **Delete** If this value is used, the OS + /// disk is deleted when VMSS Flex VM is deleted.<br><br> **Detach** If this value + /// is used, the OS disk is retained after VMSS Flex VM is deleted. <br><br> The + /// default value is set to **Delete**. For an Ephemeral OS Disk, the default value + /// is set to **Delete**. User cannot change the delete option for Ephemeral OS + /// Disk. + /// + public ComputeFleetDiskDeleteOptionType? DeleteOption { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.Serialization.cs new file mode 100644 index 0000000000000..f698a839b3c89 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.Serialization.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssOSProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssOSProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ComputerNamePrefix)) + { + writer.WritePropertyName("computerNamePrefix"u8); + writer.WriteStringValue(ComputerNamePrefix); + } + if (Optional.IsDefined(AdminUsername)) + { + writer.WritePropertyName("adminUsername"u8); + writer.WriteStringValue(AdminUsername); + } + if (Optional.IsDefined(AdminPassword)) + { + writer.WritePropertyName("adminPassword"u8); + writer.WriteStringValue(AdminPassword); + } + if (Optional.IsDefined(CustomData)) + { + writer.WritePropertyName("customData"u8); + writer.WriteStringValue(CustomData); + } + if (Optional.IsDefined(WindowsConfiguration)) + { + writer.WritePropertyName("windowsConfiguration"u8); + writer.WriteObjectValue(WindowsConfiguration, options); + } + if (Optional.IsDefined(LinuxConfiguration)) + { + writer.WritePropertyName("linuxConfiguration"u8); + writer.WriteObjectValue(LinuxConfiguration, options); + } + if (Optional.IsCollectionDefined(Secrets)) + { + writer.WritePropertyName("secrets"u8); + writer.WriteStartArray(); + foreach (var item in Secrets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AreExtensionOperationsAllowed)) + { + writer.WritePropertyName("allowExtensionOperations"u8); + writer.WriteBooleanValue(AreExtensionOperationsAllowed.Value); + } + if (Optional.IsDefined(IsGuestProvisionSignalRequired)) + { + writer.WritePropertyName("requireGuestProvisionSignal"u8); + writer.WriteBooleanValue(IsGuestProvisionSignalRequired.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssOSProfile 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(ComputeFleetVmssOSProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssOSProfile(document.RootElement, options); + } + + internal static ComputeFleetVmssOSProfile DeserializeComputeFleetVmssOSProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string computerNamePrefix = default; + string adminUsername = default; + string adminPassword = default; + string customData = default; + ComputeFleetWindowsConfiguration windowsConfiguration = default; + ComputeFleetLinuxConfiguration linuxConfiguration = default; + IList secrets = default; + bool? allowExtensionOperations = default; + bool? requireGuestProvisionSignal = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("computerNamePrefix"u8)) + { + computerNamePrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("adminUsername"u8)) + { + adminUsername = property.Value.GetString(); + continue; + } + if (property.NameEquals("adminPassword"u8)) + { + adminPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("customData"u8)) + { + customData = property.Value.GetString(); + continue; + } + if (property.NameEquals("windowsConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + windowsConfiguration = ComputeFleetWindowsConfiguration.DeserializeComputeFleetWindowsConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("linuxConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxConfiguration = ComputeFleetLinuxConfiguration.DeserializeComputeFleetLinuxConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("secrets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVaultSecretGroup.DeserializeComputeFleetVaultSecretGroup(item, options)); + } + secrets = array; + continue; + } + if (property.NameEquals("allowExtensionOperations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowExtensionOperations = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("requireGuestProvisionSignal"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + requireGuestProvisionSignal = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssOSProfile( + computerNamePrefix, + adminUsername, + adminPassword, + customData, + windowsConfiguration, + linuxConfiguration, + secrets ?? new ChangeTrackingList(), + allowExtensionOperations, + requireGuestProvisionSignal, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssOSProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssOSProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssOSProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssOSProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.cs new file mode 100644 index 0000000000000..5f6f9870f1fc5 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set OS profile. + public partial class ComputeFleetVmssOSProfile + { + /// + /// 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 . + public ComputeFleetVmssOSProfile() + { + Secrets = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Specifies the computer name prefix for all of the virtual machines in the scale + /// set. Computer name prefixes must be 1 to 15 characters long. + /// + /// + /// Specifies the name of the administrator account. <br><br> **Windows-only + /// restriction:** Cannot end in "." <br><br> **Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", + /// "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", + /// "console", "david", "guest", "john", "owner", "root", "server", "sql", + /// "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + /// <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length + /// (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters + /// + /// + /// Specifies the password of the administrator account. <br><br> **Minimum-length + /// (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + /// <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length + /// (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 + /// conditions below need to be fulfilled <br> Has lower characters <br>Has upper + /// characters <br> Has a digit <br> Has a special character (Regex match [\W_]) + /// <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + /// "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", + /// "Password22", "iloveyou!" <br><br> For resetting the password, see [How to + /// reset the Remote Desktop service or its login password in a Windows + /// VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) + /// <br><br> For resetting root password, see [Manage users, SSH, and check or + /// repair disks on Azure Linux VMs using the VMAccess + /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + /// + /// + /// Specifies a base-64 encoded string of custom data. The base-64 encoded string + /// is decoded to a binary array that is saved as a file on the Virtual Machine. + /// The maximum length of the binary array is 65535 bytes. For using cloud-init for + /// your VM, see [Using cloud-init to customize a Linux VM during + /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) + /// + /// Specifies Windows operating system settings on the virtual machine. + /// + /// Specifies the Linux operating system settings on the virtual machine. For a + /// list of supported Linux distributions, see [Linux on Azure-Endorsed + /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + /// + /// + /// Specifies set of certificates that should be installed onto the virtual + /// machines in the scale set. To install certificates on a virtual machine it is + /// recommended to use the [Azure Key Vault virtual machine extension for + /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + /// or the [Azure Key Vault virtual machine extension for + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + /// + /// Specifies whether extension operations should be allowed on the virtual machine + /// scale set. This may only be set to False when no extensions are present on the + /// virtual machine scale set. + /// + /// Optional property which must either be set to True or omitted. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssOSProfile(string computerNamePrefix, string adminUsername, string adminPassword, string customData, ComputeFleetWindowsConfiguration windowsConfiguration, ComputeFleetLinuxConfiguration linuxConfiguration, IList secrets, bool? areExtensionOperationsAllowed, bool? isGuestProvisionSignalRequired, IDictionary serializedAdditionalRawData) + { + ComputerNamePrefix = computerNamePrefix; + AdminUsername = adminUsername; + AdminPassword = adminPassword; + CustomData = customData; + WindowsConfiguration = windowsConfiguration; + LinuxConfiguration = linuxConfiguration; + Secrets = secrets; + AreExtensionOperationsAllowed = areExtensionOperationsAllowed; + IsGuestProvisionSignalRequired = isGuestProvisionSignalRequired; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the computer name prefix for all of the virtual machines in the scale + /// set. Computer name prefixes must be 1 to 15 characters long. + /// + public string ComputerNamePrefix { get; set; } + /// + /// Specifies the name of the administrator account. <br><br> **Windows-only + /// restriction:** Cannot end in "." <br><br> **Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", + /// "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", + /// "console", "david", "guest", "john", "owner", "root", "server", "sql", + /// "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + /// <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length + /// (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters + /// + public string AdminUsername { get; set; } + /// + /// Specifies the password of the administrator account. <br><br> **Minimum-length + /// (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + /// <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length + /// (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 + /// conditions below need to be fulfilled <br> Has lower characters <br>Has upper + /// characters <br> Has a digit <br> Has a special character (Regex match [\W_]) + /// <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + /// "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", + /// "Password22", "iloveyou!" <br><br> For resetting the password, see [How to + /// reset the Remote Desktop service or its login password in a Windows + /// VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) + /// <br><br> For resetting root password, see [Manage users, SSH, and check or + /// repair disks on Azure Linux VMs using the VMAccess + /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + /// + public string AdminPassword { get; set; } + /// + /// Specifies a base-64 encoded string of custom data. The base-64 encoded string + /// is decoded to a binary array that is saved as a file on the Virtual Machine. + /// The maximum length of the binary array is 65535 bytes. For using cloud-init for + /// your VM, see [Using cloud-init to customize a Linux VM during + /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) + /// + public string CustomData { get; set; } + /// Specifies Windows operating system settings on the virtual machine. + public ComputeFleetWindowsConfiguration WindowsConfiguration { get; set; } + /// + /// Specifies the Linux operating system settings on the virtual machine. For a + /// list of supported Linux distributions, see [Linux on Azure-Endorsed + /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + /// + public ComputeFleetLinuxConfiguration LinuxConfiguration { get; set; } + /// + /// Specifies set of certificates that should be installed onto the virtual + /// machines in the scale set. To install certificates on a virtual machine it is + /// recommended to use the [Azure Key Vault virtual machine extension for + /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + /// or the [Azure Key Vault virtual machine extension for + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + public IList Secrets { get; } + /// + /// Specifies whether extension operations should be allowed on the virtual machine + /// scale set. This may only be set to False when no extensions are present on the + /// virtual machine scale set. + /// + public bool? AreExtensionOperationsAllowed { get; set; } + /// Optional property which must either be set to True or omitted. + public bool? IsGuestProvisionSignalRequired { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.Serialization.cs new file mode 100644 index 0000000000000..984746b71cf26 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssPublicIPAddressConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssPublicIPAddressConfiguration 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(ComputeFleetVmssPublicIPAddressConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssPublicIPAddressConfiguration(document.RootElement, options); + } + + internal static ComputeFleetVmssPublicIPAddressConfiguration DeserializeComputeFleetVmssPublicIPAddressConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ComputeFleetVmssPublicIPAddressConfigurationProperties properties = default; + ComputeFleetPublicIPAddressSku sku = 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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ComputeFleetVmssPublicIPAddressConfigurationProperties.DeserializeComputeFleetVmssPublicIPAddressConfigurationProperties(property.Value, options); + continue; + } + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = ComputeFleetPublicIPAddressSku.DeserializeComputeFleetPublicIPAddressSku(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssPublicIPAddressConfiguration(name, properties, sku, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssPublicIPAddressConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssPublicIPAddressConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.cs new file mode 100644 index 0000000000000..a3372c6f0736b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Describes a virtual machines scale set IP Configuration's PublicIPAddress + /// configuration + /// + public partial class ComputeFleetVmssPublicIPAddressConfiguration + { + /// + /// 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 publicIP address configuration name. + /// is null. + public ComputeFleetVmssPublicIPAddressConfiguration(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The publicIP address configuration name. + /// + /// Describes a virtual machines scale set IP Configuration's PublicIPAddress + /// configuration + /// + /// + /// Describes the public IP Sku. It can only be set with OrchestrationMode as + /// Flexible. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssPublicIPAddressConfiguration(string name, ComputeFleetVmssPublicIPAddressConfigurationProperties properties, ComputeFleetPublicIPAddressSku sku, IDictionary serializedAdditionalRawData) + { + Name = name; + Properties = properties; + Sku = sku; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssPublicIPAddressConfiguration() + { + } + + /// The publicIP address configuration name. + public string Name { get; set; } + /// + /// Describes a virtual machines scale set IP Configuration's PublicIPAddress + /// configuration + /// + public ComputeFleetVmssPublicIPAddressConfigurationProperties Properties { get; set; } + /// + /// Describes the public IP Sku. It can only be set with OrchestrationMode as + /// Flexible. + /// + public ComputeFleetPublicIPAddressSku Sku { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.Serialization.cs new file mode 100644 index 0000000000000..9c5197c3c40b0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssPublicIPAddressConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfigurationProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IdleTimeoutInMinutes)) + { + writer.WritePropertyName("idleTimeoutInMinutes"u8); + writer.WriteNumberValue(IdleTimeoutInMinutes.Value); + } + if (Optional.IsDefined(DnsSettings)) + { + writer.WritePropertyName("dnsSettings"u8); + writer.WriteObjectValue(DnsSettings, options); + } + if (Optional.IsCollectionDefined(IPTags)) + { + writer.WritePropertyName("ipTags"u8); + writer.WriteStartArray(); + foreach (var item in IPTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PublicIPPrefix)) + { + writer.WritePropertyName("publicIPPrefix"u8); + JsonSerializer.Serialize(writer, PublicIPPrefix); + } + if (Optional.IsDefined(PublicIPAddressVersion)) + { + writer.WritePropertyName("publicIPAddressVersion"u8); + writer.WriteStringValue(PublicIPAddressVersion.Value.ToString()); + } + if (Optional.IsDefined(DeleteOption)) + { + writer.WritePropertyName("deleteOption"u8); + writer.WriteStringValue(DeleteOption.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssPublicIPAddressConfigurationProperties 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(ComputeFleetVmssPublicIPAddressConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssPublicIPAddressConfigurationProperties(document.RootElement, options); + } + + internal static ComputeFleetVmssPublicIPAddressConfigurationProperties DeserializeComputeFleetVmssPublicIPAddressConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? idleTimeoutInMinutes = default; + ComputeFleetVmssPublicIPAddressDnsSettings dnsSettings = default; + IList ipTags = default; + WritableSubResource publicIPPrefix = default; + ComputeFleetIPVersion? publicIPAddressVersion = default; + ComputeFleetVmDeleteOption? deleteOption = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("idleTimeoutInMinutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + idleTimeoutInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dnsSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dnsSettings = ComputeFleetVmssPublicIPAddressDnsSettings.DeserializeComputeFleetVmssPublicIPAddressDnsSettings(property.Value, options); + continue; + } + if (property.NameEquals("ipTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmssIPTag.DeserializeComputeFleetVmssIPTag(item, options)); + } + ipTags = array; + continue; + } + if (property.NameEquals("publicIPPrefix"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicIPPrefix = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("publicIPAddressVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicIPAddressVersion = new ComputeFleetIPVersion(property.Value.GetString()); + continue; + } + if (property.NameEquals("deleteOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOption = new ComputeFleetVmDeleteOption(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssPublicIPAddressConfigurationProperties( + idleTimeoutInMinutes, + dnsSettings, + ipTags ?? new ChangeTrackingList(), + publicIPPrefix, + publicIPAddressVersion, + deleteOption, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssPublicIPAddressConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssPublicIPAddressConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.cs new file mode 100644 index 0000000000000..387582ab8d8e7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Describes a virtual machines scale set IP Configuration's PublicIPAddress + /// configuration + /// + public partial class ComputeFleetVmssPublicIPAddressConfigurationProperties + { + /// + /// 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 . + public ComputeFleetVmssPublicIPAddressConfigurationProperties() + { + IPTags = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The idle timeout of the public IP address. + /// The dns settings to be applied on the publicIP addresses . + /// The list of IP tags associated with the public IP address. + /// The PublicIPPrefix from which to allocate publicIP addresses. + /// + /// Available from Api-Version 2019-07-01 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + /// values are: 'IPv4' and 'IPv6'. + /// + /// Specify what happens to the public IP when the VM is deleted. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssPublicIPAddressConfigurationProperties(int? idleTimeoutInMinutes, ComputeFleetVmssPublicIPAddressDnsSettings dnsSettings, IList ipTags, WritableSubResource publicIPPrefix, ComputeFleetIPVersion? publicIPAddressVersion, ComputeFleetVmDeleteOption? deleteOption, IDictionary serializedAdditionalRawData) + { + IdleTimeoutInMinutes = idleTimeoutInMinutes; + DnsSettings = dnsSettings; + IPTags = ipTags; + PublicIPPrefix = publicIPPrefix; + PublicIPAddressVersion = publicIPAddressVersion; + DeleteOption = deleteOption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The idle timeout of the public IP address. + public int? IdleTimeoutInMinutes { get; set; } + /// The dns settings to be applied on the publicIP addresses . + public ComputeFleetVmssPublicIPAddressDnsSettings DnsSettings { get; set; } + /// The list of IP tags associated with the public IP address. + public IList IPTags { get; } + /// The PublicIPPrefix from which to allocate publicIP addresses. + internal WritableSubResource PublicIPPrefix { get; set; } + /// Gets or sets Id. + public ResourceIdentifier PublicIPPrefixId + { + get => PublicIPPrefix is null ? default : PublicIPPrefix.Id; + set + { + if (PublicIPPrefix is null) + PublicIPPrefix = new WritableSubResource(); + PublicIPPrefix.Id = value; + } + } + + /// + /// Available from Api-Version 2019-07-01 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + /// values are: 'IPv4' and 'IPv6'. + /// + public ComputeFleetIPVersion? PublicIPAddressVersion { get; set; } + /// Specify what happens to the public IP when the VM is deleted. + public ComputeFleetVmDeleteOption? DeleteOption { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.Serialization.cs new file mode 100644 index 0000000000000..549d22d6b6bc6 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssPublicIPAddressDnsSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressDnsSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("domainNameLabel"u8); + writer.WriteStringValue(DomainNameLabel); + if (Optional.IsDefined(DomainNameLabelScope)) + { + writer.WritePropertyName("domainNameLabelScope"u8); + writer.WriteStringValue(DomainNameLabelScope.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssPublicIPAddressDnsSettings 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(ComputeFleetVmssPublicIPAddressDnsSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssPublicIPAddressDnsSettings(document.RootElement, options); + } + + internal static ComputeFleetVmssPublicIPAddressDnsSettings DeserializeComputeFleetVmssPublicIPAddressDnsSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string domainNameLabel = default; + ComputeFleetDomainNameLabelScopeType? domainNameLabelScope = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("domainNameLabel"u8)) + { + domainNameLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("domainNameLabelScope"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + domainNameLabelScope = new ComputeFleetDomainNameLabelScopeType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssPublicIPAddressDnsSettings(domainNameLabel, domainNameLabelScope, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressDnsSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssPublicIPAddressDnsSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssPublicIPAddressDnsSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressDnsSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.cs new file mode 100644 index 0000000000000..77ec4a06980fd --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machines scale sets network configuration's DNS settings. + public partial class ComputeFleetVmssPublicIPAddressDnsSettings + { + /// + /// 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 Domain name label.The concatenation of the domain name label and vm index + /// will be the domain name labels of the PublicIPAddress resources that will be + /// created + /// + /// is null. + public ComputeFleetVmssPublicIPAddressDnsSettings(string domainNameLabel) + { + Argument.AssertNotNull(domainNameLabel, nameof(domainNameLabel)); + + DomainNameLabel = domainNameLabel; + } + + /// Initializes a new instance of . + /// + /// The Domain name label.The concatenation of the domain name label and vm index + /// will be the domain name labels of the PublicIPAddress resources that will be + /// created + /// + /// + /// The Domain name label scope.The concatenation of the hashed domain name label + /// that generated according to the policy from domain name label scope and vm + /// index will be the domain name labels of the PublicIPAddress resources that will + /// be created + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssPublicIPAddressDnsSettings(string domainNameLabel, ComputeFleetDomainNameLabelScopeType? domainNameLabelScope, IDictionary serializedAdditionalRawData) + { + DomainNameLabel = domainNameLabel; + DomainNameLabelScope = domainNameLabelScope; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssPublicIPAddressDnsSettings() + { + } + + /// + /// The Domain name label.The concatenation of the domain name label and vm index + /// will be the domain name labels of the PublicIPAddress resources that will be + /// created + /// + public string DomainNameLabel { get; set; } + /// + /// The Domain name label scope.The concatenation of the hashed domain name label + /// that generated according to the policy from domain name label scope and vm + /// index will be the domain name labels of the PublicIPAddress resources that will + /// be created + /// + public ComputeFleetDomainNameLabelScopeType? DomainNameLabelScope { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.Serialization.cs new file mode 100644 index 0000000000000..525485dfa9faf --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.Serialization.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssStorageProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssStorageProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ImageReference)) + { + writer.WritePropertyName("imageReference"u8); + writer.WriteObjectValue(ImageReference, options); + } + if (Optional.IsDefined(OSDisk)) + { + writer.WritePropertyName("osDisk"u8); + writer.WriteObjectValue(OSDisk, options); + } + if (Optional.IsCollectionDefined(DataDisks)) + { + writer.WritePropertyName("dataDisks"u8); + writer.WriteStartArray(); + foreach (var item in DataDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DiskControllerType)) + { + writer.WritePropertyName("diskControllerType"u8); + writer.WriteStringValue(DiskControllerType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssStorageProfile 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(ComputeFleetVmssStorageProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssStorageProfile(document.RootElement, options); + } + + internal static ComputeFleetVmssStorageProfile DeserializeComputeFleetVmssStorageProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetImageReference imageReference = default; + ComputeFleetVmssOSDisk osDisk = default; + IList dataDisks = default; + ComputeFleetDiskControllerType? diskControllerType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("imageReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + imageReference = ComputeFleetImageReference.DeserializeComputeFleetImageReference(property.Value, options); + continue; + } + if (property.NameEquals("osDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osDisk = ComputeFleetVmssOSDisk.DeserializeComputeFleetVmssOSDisk(property.Value, options); + continue; + } + if (property.NameEquals("dataDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmssDataDisk.DeserializeComputeFleetVmssDataDisk(item, options)); + } + dataDisks = array; + continue; + } + if (property.NameEquals("diskControllerType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskControllerType = new ComputeFleetDiskControllerType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssStorageProfile(imageReference, osDisk, dataDisks ?? new ChangeTrackingList(), diskControllerType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssStorageProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssStorageProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssStorageProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssStorageProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.cs new file mode 100644 index 0000000000000..b966f044c9576 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set storage profile. + public partial class ComputeFleetVmssStorageProfile + { + /// + /// 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 . + public ComputeFleetVmssStorageProfile() + { + DataDisks = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Specifies information about the image to use. You can specify information about + /// platform images, marketplace images, or virtual machine images. This element is + /// required when you want to use a platform image, marketplace image, or virtual + /// machine image, but is not used in other creation operations. + /// + /// + /// Specifies information about the operating system disk used by the virtual + /// machines in the scale set. For more information about disks, see [About disks + /// and VHDs for Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + /// + /// Specifies the parameters that are used to add data disks to the virtual + /// machines in the scale set. For more information about disks, see [About disks + /// and VHDs for Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + /// Specifies the disk controller type configured for the virtual machines in the scale set. Minimum api-version: 2022-08-01. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssStorageProfile(ComputeFleetImageReference imageReference, ComputeFleetVmssOSDisk osDisk, IList dataDisks, ComputeFleetDiskControllerType? diskControllerType, IDictionary serializedAdditionalRawData) + { + ImageReference = imageReference; + OSDisk = osDisk; + DataDisks = dataDisks; + DiskControllerType = diskControllerType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies information about the image to use. You can specify information about + /// platform images, marketplace images, or virtual machine images. This element is + /// required when you want to use a platform image, marketplace image, or virtual + /// machine image, but is not used in other creation operations. + /// + public ComputeFleetImageReference ImageReference { get; set; } + /// + /// Specifies information about the operating system disk used by the virtual + /// machines in the scale set. For more information about disks, see [About disks + /// and VHDs for Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + public ComputeFleetVmssOSDisk OSDisk { get; set; } + /// + /// Specifies the parameters that are used to add data disks to the virtual + /// machines in the scale set. For more information about disks, see [About disks + /// and VHDs for Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + public IList DataDisks { get; } + /// Specifies the disk controller type configured for the virtual machines in the scale set. Minimum api-version: 2022-08-01. + public ComputeFleetDiskControllerType? DiskControllerType { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.Serialization.cs new file mode 100644 index 0000000000000..b30770bb281f3 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetWinRMListener : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetWinRMListener)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Protocol)) + { + writer.WritePropertyName("protocol"u8); + writer.WriteStringValue(Protocol.Value.ToString()); + } + if (Optional.IsDefined(CertificateUri)) + { + writer.WritePropertyName("certificateUrl"u8); + writer.WriteStringValue(CertificateUri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetWinRMListener 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(ComputeFleetWinRMListener)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetWinRMListener(document.RootElement, options); + } + + internal static ComputeFleetWinRMListener DeserializeComputeFleetWinRMListener(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetProtocolType? protocol = default; + Uri certificateUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protocol"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protocol = new ComputeFleetProtocolType(property.Value.GetString()); + continue; + } + if (property.NameEquals("certificateUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + certificateUrl = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetWinRMListener(protocol, certificateUrl, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetWinRMListener)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetWinRMListener IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetWinRMListener(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetWinRMListener)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.cs new file mode 100644 index 0000000000000..33f9ceeec6b82 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes Protocol and thumbprint of Windows Remote Management listener. + public partial class ComputeFleetWinRMListener + { + /// + /// 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 . + public ComputeFleetWinRMListener() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the protocol of WinRM listener. Possible values are: **http,** + /// **https.** + /// + /// + /// This is the URL of a certificate that has been uploaded to Key Vault as a + /// secret. For adding a secret to the Key Vault, see [Add a key or secret to the + /// key + /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + /// In this case, your certificate needs to be the Base64 encoding of the following + /// JSON Object which is encoded in UTF-8: <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} <br> To install certificates on a virtual + /// machine it is recommended to use the [Azure Key Vault virtual machine extension + /// for + /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + /// or the [Azure Key Vault virtual machine extension for + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetWinRMListener(ComputeFleetProtocolType? protocol, Uri certificateUri, IDictionary serializedAdditionalRawData) + { + Protocol = protocol; + CertificateUri = certificateUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the protocol of WinRM listener. Possible values are: **http,** + /// **https.** + /// + public ComputeFleetProtocolType? Protocol { get; set; } + /// + /// This is the URL of a certificate that has been uploaded to Key Vault as a + /// secret. For adding a secret to the Key Vault, see [Add a key or secret to the + /// key + /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + /// In this case, your certificate needs to be the Base64 encoding of the following + /// JSON Object which is encoded in UTF-8: <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} <br> To install certificates on a virtual + /// machine it is recommended to use the [Azure Key Vault virtual machine extension + /// for + /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + /// or the [Azure Key Vault virtual machine extension for + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + public Uri CertificateUri { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.Serialization.cs new file mode 100644 index 0000000000000..bb7cfbca2055a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetWindowsConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetWindowsConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IsVmAgentProvisioned)) + { + writer.WritePropertyName("provisionVMAgent"u8); + writer.WriteBooleanValue(IsVmAgentProvisioned.Value); + } + if (Optional.IsDefined(IsAutomaticUpdatesEnabled)) + { + writer.WritePropertyName("enableAutomaticUpdates"u8); + writer.WriteBooleanValue(IsAutomaticUpdatesEnabled.Value); + } + if (Optional.IsDefined(TimeZone)) + { + writer.WritePropertyName("timeZone"u8); + writer.WriteStringValue(TimeZone); + } + if (Optional.IsCollectionDefined(AdditionalUnattendContent)) + { + writer.WritePropertyName("additionalUnattendContent"u8); + writer.WriteStartArray(); + foreach (var item in AdditionalUnattendContent) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PatchSettings)) + { + writer.WritePropertyName("patchSettings"u8); + writer.WriteObjectValue(PatchSettings, options); + } + if (Optional.IsDefined(WinRM)) + { + writer.WritePropertyName("winRM"u8); + writer.WriteObjectValue(WinRM, options); + } + if (Optional.IsDefined(IsVmAgentPlatformUpdatesEnabled)) + { + writer.WritePropertyName("enableVMAgentPlatformUpdates"u8); + writer.WriteBooleanValue(IsVmAgentPlatformUpdatesEnabled.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetWindowsConfiguration 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(ComputeFleetWindowsConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetWindowsConfiguration(document.RootElement, options); + } + + internal static ComputeFleetWindowsConfiguration DeserializeComputeFleetWindowsConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? provisionVmAgent = default; + bool? enableAutomaticUpdates = default; + string timeZone = default; + IList additionalUnattendContent = default; + ComputeFleetVmGuestPatchSettings patchSettings = default; + WinRMConfiguration winRM = default; + bool? enableVmAgentPlatformUpdates = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisionVMAgent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisionVmAgent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableAutomaticUpdates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutomaticUpdates = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("timeZone"u8)) + { + timeZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("additionalUnattendContent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WindowsSetupAdditionalInformation.DeserializeWindowsSetupAdditionalInformation(item, options)); + } + additionalUnattendContent = array; + continue; + } + if (property.NameEquals("patchSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchSettings = ComputeFleetVmGuestPatchSettings.DeserializeComputeFleetVmGuestPatchSettings(property.Value, options); + continue; + } + if (property.NameEquals("winRM"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + winRM = WinRMConfiguration.DeserializeWinRMConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("enableVMAgentPlatformUpdates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableVmAgentPlatformUpdates = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetWindowsConfiguration( + provisionVmAgent, + enableAutomaticUpdates, + timeZone, + additionalUnattendContent ?? new ChangeTrackingList(), + patchSettings, + winRM, + enableVmAgentPlatformUpdates, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetWindowsConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetWindowsConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetWindowsConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetWindowsConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.cs new file mode 100644 index 0000000000000..6bdc7de86ce9a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies Windows operating system settings on the virtual machine. + public partial class ComputeFleetWindowsConfiguration + { + /// + /// 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 . + public ComputeFleetWindowsConfiguration() + { + AdditionalUnattendContent = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Indicates whether virtual machine agent should be provisioned on the virtual + /// machine. When this property is not specified in the request body, it is set to + /// true by default. This will ensure that VM Agent is installed on the VM so that + /// extensions can be added to the VM later. + /// + /// + /// Indicates whether Automatic Updates is enabled for the Windows virtual machine. + /// Default value is true. For virtual machine scale sets, this property can be + /// updated and updates will take effect on OS reprovisioning. + /// + /// + /// Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". + /// Possible values can be + /// [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) + /// value from time zones returned by + /// [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + /// + /// + /// Specifies additional base-64 encoded XML formatted information that can be + /// included in the Unattend.xml file, which is used by Windows Setup. + /// + /// [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + /// + /// Specifies the Windows Remote Management listeners. This enables remote Windows + /// PowerShell. + /// + /// + /// Indicates whether VMAgent Platform Updates is enabled for the Windows virtual + /// machine. Default value is false. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetWindowsConfiguration(bool? isVmAgentProvisioned, bool? isAutomaticUpdatesEnabled, string timeZone, IList additionalUnattendContent, ComputeFleetVmGuestPatchSettings patchSettings, WinRMConfiguration winRM, bool? isVmAgentPlatformUpdatesEnabled, IDictionary serializedAdditionalRawData) + { + IsVmAgentProvisioned = isVmAgentProvisioned; + IsAutomaticUpdatesEnabled = isAutomaticUpdatesEnabled; + TimeZone = timeZone; + AdditionalUnattendContent = additionalUnattendContent; + PatchSettings = patchSettings; + WinRM = winRM; + IsVmAgentPlatformUpdatesEnabled = isVmAgentPlatformUpdatesEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Indicates whether virtual machine agent should be provisioned on the virtual + /// machine. When this property is not specified in the request body, it is set to + /// true by default. This will ensure that VM Agent is installed on the VM so that + /// extensions can be added to the VM later. + /// + public bool? IsVmAgentProvisioned { get; set; } + /// + /// Indicates whether Automatic Updates is enabled for the Windows virtual machine. + /// Default value is true. For virtual machine scale sets, this property can be + /// updated and updates will take effect on OS reprovisioning. + /// + public bool? IsAutomaticUpdatesEnabled { get; set; } + /// + /// Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". + /// Possible values can be + /// [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) + /// value from time zones returned by + /// [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + /// + public string TimeZone { get; set; } + /// + /// Specifies additional base-64 encoded XML formatted information that can be + /// included in the Unattend.xml file, which is used by Windows Setup. + /// + public IList AdditionalUnattendContent { get; } + /// [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + public ComputeFleetVmGuestPatchSettings PatchSettings { get; set; } + /// + /// Specifies the Windows Remote Management listeners. This enables remote Windows + /// PowerShell. + /// + internal WinRMConfiguration WinRM { get; set; } + /// The list of Windows Remote Management listeners. + public IList WinRMListeners + { + get + { + if (WinRM is null) + WinRM = new WinRMConfiguration(); + return WinRM.Listeners; + } + } + + /// + /// Indicates whether VMAgent Platform Updates is enabled for the Windows virtual + /// machine. Default value is false. + /// + public bool? IsVmAgentPlatformUpdatesEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsPatchAssessmentMode.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsPatchAssessmentMode.cs new file mode 100644 index 0000000000000..2210891e8e245 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsPatchAssessmentMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies the mode of VM Guest patch assessment for the IaaS virtual machine. + public readonly partial struct ComputeFleetWindowsPatchAssessmentMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetWindowsPatchAssessmentMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ImageDefaultValue = "ImageDefault"; + private const string AutomaticByPlatformValue = "AutomaticByPlatform"; + + /// You control the timing of patch assessments on a virtual machine. + public static ComputeFleetWindowsPatchAssessmentMode ImageDefault { get; } = new ComputeFleetWindowsPatchAssessmentMode(ImageDefaultValue); + /// The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. + public static ComputeFleetWindowsPatchAssessmentMode AutomaticByPlatform { get; } = new ComputeFleetWindowsPatchAssessmentMode(AutomaticByPlatformValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetWindowsPatchAssessmentMode left, ComputeFleetWindowsPatchAssessmentMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetWindowsPatchAssessmentMode left, ComputeFleetWindowsPatchAssessmentMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetWindowsPatchAssessmentMode(string value) => new ComputeFleetWindowsPatchAssessmentMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetWindowsPatchAssessmentMode other && Equals(other); + /// + public bool Equals(ComputeFleetWindowsPatchAssessmentMode 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting.cs new file mode 100644 index 0000000000000..aad0e344f814c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting.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 Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies the reboot setting for all AutomaticByPlatform patch installation operations. + public readonly partial struct ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string IfRequiredValue = "IfRequired"; + private const string NeverValue = "Never"; + private const string AlwaysValue = "Always"; + + /// Unknown Reboot setting. + public static ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting Unknown { get; } = new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(UnknownValue); + /// IfRequired Reboot setting. + public static ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting IfRequired { get; } = new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(IfRequiredValue); + /// Never Reboot setting. + public static ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting Never { get; } = new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(NeverValue); + /// Always Reboot setting. + public static ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting Always { get; } = new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(AlwaysValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting left, ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting left, ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(string value) => new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting other && Equals(other); + /// + public bool Equals(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.Serialization.cs new file mode 100644 index 0000000000000..6f3e5079e52e7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(RebootSetting)) + { + writer.WritePropertyName("rebootSetting"u8); + writer.WriteStringValue(RebootSetting.Value.ToString()); + } + if (Optional.IsDefined(IsBypassPlatformSafetyChecksOnUserScheduleEnabled)) + { + writer.WritePropertyName("bypassPlatformSafetyChecksOnUserSchedule"u8); + writer.WriteBooleanValue(IsBypassPlatformSafetyChecksOnUserScheduleEnabled.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings 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(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings(document.RootElement, options); + } + + internal static ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings DeserializeComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting? rebootSetting = default; + bool? bypassPlatformSafetyChecksOnUserSchedule = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rebootSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rebootSetting = new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(property.Value.GetString()); + continue; + } + if (property.NameEquals("bypassPlatformSafetyChecksOnUserSchedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bypassPlatformSafetyChecksOnUserSchedule = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings(rebootSetting, bypassPlatformSafetyChecksOnUserSchedule, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.cs new file mode 100644 index 0000000000000..4f801617b5eaf --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies additional settings to be applied when patch mode AutomaticByPlatform + /// is selected in Windows patch settings. + /// + public partial class ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings + { + /// + /// 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 . + public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the reboot setting for all AutomaticByPlatform patch installation + /// operations. + /// + /// Enables customer to schedule patching without accidental upgrades. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting? rebootSetting, bool? isBypassPlatformSafetyChecksOnUserScheduleEnabled, IDictionary serializedAdditionalRawData) + { + RebootSetting = rebootSetting; + IsBypassPlatformSafetyChecksOnUserScheduleEnabled = isBypassPlatformSafetyChecksOnUserScheduleEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the reboot setting for all AutomaticByPlatform patch installation + /// operations. + /// + public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting? RebootSetting { get; set; } + /// Enables customer to schedule patching without accidental upgrades. + public bool? IsBypassPlatformSafetyChecksOnUserScheduleEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchMode.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchMode.cs new file mode 100644 index 0000000000000..c83947c933abc --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchMode.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 Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible. + /// + public readonly partial struct ComputeFleetWindowsVmGuestPatchMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetWindowsVmGuestPatchMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ManualValue = "Manual"; + private const string AutomaticByOSValue = "AutomaticByOS"; + private const string AutomaticByPlatformValue = "AutomaticByPlatform"; + + /// + /// You control the application of patches to a virtual machine. + /// You do this by applying patches manually inside the VM. In this mode, + /// automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates + /// must be false + /// + public static ComputeFleetWindowsVmGuestPatchMode Manual { get; } = new ComputeFleetWindowsVmGuestPatchMode(ManualValue); + /// + /// The virtual machine will automatically be updated by the OS. + /// The property WindowsConfiguration.enableAutomaticUpdates must be true. + /// + public static ComputeFleetWindowsVmGuestPatchMode AutomaticByOS { get; } = new ComputeFleetWindowsVmGuestPatchMode(AutomaticByOSValue); + /// + /// The virtual machine will automatically updated by the platform. The properties + /// provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. + /// + public static ComputeFleetWindowsVmGuestPatchMode AutomaticByPlatform { get; } = new ComputeFleetWindowsVmGuestPatchMode(AutomaticByPlatformValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetWindowsVmGuestPatchMode left, ComputeFleetWindowsVmGuestPatchMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetWindowsVmGuestPatchMode left, ComputeFleetWindowsVmGuestPatchMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetWindowsVmGuestPatchMode(string value) => new ComputeFleetWindowsVmGuestPatchMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetWindowsVmGuestPatchMode other && Equals(other); + /// + public bool Equals(ComputeFleetWindowsVmGuestPatchMode 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs new file mode 100644 index 0000000000000..30afe9e74fd6c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class FleetListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FleetListResult 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(FleetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetListResult(document.RootElement, options); + } + + internal static FleetListResult DeserializeFleetListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetData.DeserializeComputeFleetData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.cs new file mode 100644 index 0000000000000..dde91baff145e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// The response of a Fleet list operation. + internal partial class FleetListResult + { + /// + /// 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 Fleet items on this page. + /// is null. + internal FleetListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Fleet items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetListResult() + { + } + + /// The Fleet items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ProxyAgentExecuteMode.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ProxyAgentExecuteMode.cs new file mode 100644 index 0000000000000..45e67750c10c6 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ProxyAgentExecuteMode.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the mode that ProxyAgent will execute on if the feature is enabled. + /// ProxyAgent will start to audit or monitor but not enforce access control over + /// requests to host endpoints in Audit mode, while in Enforce mode it will enforce + /// access control. The default value is Enforce mode. + /// + public readonly partial struct ProxyAgentExecuteMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProxyAgentExecuteMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AuditValue = "Audit"; + private const string EnforceValue = "Enforce"; + + /// Audit Mode. + public static ProxyAgentExecuteMode Audit { get; } = new ProxyAgentExecuteMode(AuditValue); + /// Enforce Mode. + public static ProxyAgentExecuteMode Enforce { get; } = new ProxyAgentExecuteMode(EnforceValue); + /// Determines if two values are the same. + public static bool operator ==(ProxyAgentExecuteMode left, ProxyAgentExecuteMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProxyAgentExecuteMode left, ProxyAgentExecuteMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ProxyAgentExecuteMode(string value) => new ProxyAgentExecuteMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProxyAgentExecuteMode other && Equals(other); + /// + public bool Equals(ProxyAgentExecuteMode 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityAllocationStrategy.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityAllocationStrategy.cs new file mode 100644 index 0000000000000..49694b9d5760f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityAllocationStrategy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Regular VM Allocation strategy types for Compute Fleet. + public readonly partial struct RegularPriorityAllocationStrategy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RegularPriorityAllocationStrategy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LowestPriceValue = "LowestPrice"; + private const string PrioritizedValue = "Prioritized"; + + /// Default. VM sizes distribution will be determined to optimize for price. + public static RegularPriorityAllocationStrategy LowestPrice { get; } = new RegularPriorityAllocationStrategy(LowestPriceValue); + /// VM sizes distribution will be determined to optimize for the 'priority' as specified for each vm size. + public static RegularPriorityAllocationStrategy Prioritized { get; } = new RegularPriorityAllocationStrategy(PrioritizedValue); + /// Determines if two values are the same. + public static bool operator ==(RegularPriorityAllocationStrategy left, RegularPriorityAllocationStrategy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RegularPriorityAllocationStrategy left, RegularPriorityAllocationStrategy right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RegularPriorityAllocationStrategy(string value) => new RegularPriorityAllocationStrategy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RegularPriorityAllocationStrategy other && Equals(other); + /// + public bool Equals(RegularPriorityAllocationStrategy 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.Serialization.cs new file mode 100644 index 0000000000000..2db980f8d3f75 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class RegularPriorityProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegularPriorityProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteNumberValue(Capacity.Value); + } + if (Optional.IsDefined(MinCapacity)) + { + writer.WritePropertyName("minCapacity"u8); + writer.WriteNumberValue(MinCapacity.Value); + } + if (Optional.IsDefined(AllocationStrategy)) + { + writer.WritePropertyName("allocationStrategy"u8); + writer.WriteStringValue(AllocationStrategy.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RegularPriorityProfile 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(RegularPriorityProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRegularPriorityProfile(document.RootElement, options); + } + + internal static RegularPriorityProfile DeserializeRegularPriorityProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? capacity = default; + int? minCapacity = default; + RegularPriorityAllocationStrategy? allocationStrategy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minCapacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("allocationStrategy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocationStrategy = new RegularPriorityAllocationStrategy(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RegularPriorityProfile(capacity, minCapacity, allocationStrategy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RegularPriorityProfile)} does not support writing '{options.Format}' format."); + } + } + + RegularPriorityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRegularPriorityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RegularPriorityProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.cs new file mode 100644 index 0000000000000..a910113c1fe13 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Configuration Options for Regular instances in Compute Fleet. + public partial class RegularPriorityProfile + { + /// + /// 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 . + public RegularPriorityProfile() + { + } + + /// Initializes a new instance of . + /// Total capacity to achieve. It is currently in terms of number of VMs. + /// Minimum capacity to achieve which cannot be updated. If we will not be able to "guarantee" minimum capacity, we will reject the request in the sync path itself. + /// Allocation strategy to follow when determining the VM sizes distribution for Regular VMs. + /// Keeps track of any properties unknown to the library. + internal RegularPriorityProfile(int? capacity, int? minCapacity, RegularPriorityAllocationStrategy? allocationStrategy, IDictionary serializedAdditionalRawData) + { + Capacity = capacity; + MinCapacity = minCapacity; + AllocationStrategy = allocationStrategy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Total capacity to achieve. It is currently in terms of number of VMs. + public int? Capacity { get; set; } + /// Minimum capacity to achieve which cannot be updated. If we will not be able to "guarantee" minimum capacity, we will reject the request in the sync path itself. + public int? MinCapacity { get; set; } + /// Allocation strategy to follow when determining the VM sizes distribution for Regular VMs. + public RegularPriorityAllocationStrategy? AllocationStrategy { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotAllocationStrategy.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotAllocationStrategy.cs new file mode 100644 index 0000000000000..2721fa92c10f7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotAllocationStrategy.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Spot allocation strategy types for Compute Fleet. + public readonly partial struct SpotAllocationStrategy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SpotAllocationStrategy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PriceCapacityOptimizedValue = "PriceCapacityOptimized"; + private const string LowestPriceValue = "LowestPrice"; + private const string CapacityOptimizedValue = "CapacityOptimized"; + + /// Default. VM sizes distribution will be determined to optimize for both price and capacity. + public static SpotAllocationStrategy PriceCapacityOptimized { get; } = new SpotAllocationStrategy(PriceCapacityOptimizedValue); + /// VM sizes distribution will be determined to optimize for price. Note: Capacity will still be considered here but will be given much less weight. + public static SpotAllocationStrategy LowestPrice { get; } = new SpotAllocationStrategy(LowestPriceValue); + /// VM sizes distribution will be determined to optimize for capacity. + public static SpotAllocationStrategy CapacityOptimized { get; } = new SpotAllocationStrategy(CapacityOptimizedValue); + /// Determines if two values are the same. + public static bool operator ==(SpotAllocationStrategy left, SpotAllocationStrategy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SpotAllocationStrategy left, SpotAllocationStrategy right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SpotAllocationStrategy(string value) => new SpotAllocationStrategy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SpotAllocationStrategy other && Equals(other); + /// + public bool Equals(SpotAllocationStrategy 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.Serialization.cs new file mode 100644 index 0000000000000..b9fa2a9b128a1 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class SpotPriorityProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpotPriorityProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteNumberValue(Capacity.Value); + } + if (Optional.IsDefined(MinCapacity)) + { + writer.WritePropertyName("minCapacity"u8); + writer.WriteNumberValue(MinCapacity.Value); + } + if (Optional.IsDefined(MaxPricePerVm)) + { + writer.WritePropertyName("maxPricePerVM"u8); + writer.WriteNumberValue(MaxPricePerVm.Value); + } + if (Optional.IsDefined(EvictionPolicy)) + { + writer.WritePropertyName("evictionPolicy"u8); + writer.WriteStringValue(EvictionPolicy.Value.ToString()); + } + if (Optional.IsDefined(AllocationStrategy)) + { + writer.WritePropertyName("allocationStrategy"u8); + writer.WriteStringValue(AllocationStrategy.Value.ToString()); + } + if (Optional.IsDefined(IsMaintainEnabled)) + { + writer.WritePropertyName("maintain"u8); + writer.WriteBooleanValue(IsMaintainEnabled.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SpotPriorityProfile 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(SpotPriorityProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpotPriorityProfile(document.RootElement, options); + } + + internal static SpotPriorityProfile DeserializeSpotPriorityProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? capacity = default; + int? minCapacity = default; + float? maxPricePerVm = default; + ComputeFleetEvictionPolicy? evictionPolicy = default; + SpotAllocationStrategy? allocationStrategy = default; + bool? maintain = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minCapacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxPricePerVM"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxPricePerVm = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("evictionPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + evictionPolicy = new ComputeFleetEvictionPolicy(property.Value.GetString()); + continue; + } + if (property.NameEquals("allocationStrategy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocationStrategy = new SpotAllocationStrategy(property.Value.GetString()); + continue; + } + if (property.NameEquals("maintain"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maintain = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SpotPriorityProfile( + capacity, + minCapacity, + maxPricePerVm, + evictionPolicy, + allocationStrategy, + maintain, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SpotPriorityProfile)} does not support writing '{options.Format}' format."); + } + } + + SpotPriorityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSpotPriorityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SpotPriorityProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.cs new file mode 100644 index 0000000000000..2689b8414b507 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Configuration Options for Spot instances in Compute Fleet. + public partial class SpotPriorityProfile + { + /// + /// 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 . + public SpotPriorityProfile() + { + } + + /// Initializes a new instance of . + /// Total capacity to achieve. It is currently in terms of number of VMs. + /// Minimum capacity to achieve which cannot be updated. If we will not be able to "guarantee" minimum capacity, we will reject the request in the sync path itself. + /// Price per hour of each Spot VM will never exceed this. + /// Eviction Policy to follow when evicting Spot VMs. + /// Allocation strategy to follow when determining the VM sizes distribution for Spot VMs. + /// + /// Flag to enable/disable continuous goal seeking for the desired capacity and restoration of evicted Spot VMs. + /// If maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs (if VMs are evicted deleted) + /// or update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate due to capacity constraint) in order to achieve the desired capacity. + /// Maintain is enabled by default. + /// + /// Keeps track of any properties unknown to the library. + internal SpotPriorityProfile(int? capacity, int? minCapacity, float? maxPricePerVm, ComputeFleetEvictionPolicy? evictionPolicy, SpotAllocationStrategy? allocationStrategy, bool? isMaintainEnabled, IDictionary serializedAdditionalRawData) + { + Capacity = capacity; + MinCapacity = minCapacity; + MaxPricePerVm = maxPricePerVm; + EvictionPolicy = evictionPolicy; + AllocationStrategy = allocationStrategy; + IsMaintainEnabled = isMaintainEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Total capacity to achieve. It is currently in terms of number of VMs. + public int? Capacity { get; set; } + /// Minimum capacity to achieve which cannot be updated. If we will not be able to "guarantee" minimum capacity, we will reject the request in the sync path itself. + public int? MinCapacity { get; set; } + /// Price per hour of each Spot VM will never exceed this. + public float? MaxPricePerVm { get; set; } + /// Eviction Policy to follow when evicting Spot VMs. + public ComputeFleetEvictionPolicy? EvictionPolicy { get; set; } + /// Allocation strategy to follow when determining the VM sizes distribution for Spot VMs. + public SpotAllocationStrategy? AllocationStrategy { get; set; } + /// + /// Flag to enable/disable continuous goal seeking for the desired capacity and restoration of evicted Spot VMs. + /// If maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs (if VMs are evicted deleted) + /// or update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate due to capacity constraint) in order to achieve the desired capacity. + /// Maintain is enabled by default. + /// + public bool? IsMaintainEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.Serialization.cs new file mode 100644 index 0000000000000..33c194673c99f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class VirtualMachineScaleSetListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VirtualMachineScaleSetListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + VirtualMachineScaleSetListResult 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(VirtualMachineScaleSetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVirtualMachineScaleSetListResult(document.RootElement, options); + } + + internal static VirtualMachineScaleSetListResult DeserializeVirtualMachineScaleSetListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmss.DeserializeComputeFleetVmss(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VirtualMachineScaleSetListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VirtualMachineScaleSetListResult)} does not support writing '{options.Format}' format."); + } + } + + VirtualMachineScaleSetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVirtualMachineScaleSetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VirtualMachineScaleSetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.cs new file mode 100644 index 0000000000000..4e967da60061a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// The response of a VirtualMachineScaleSet list operation. + internal partial class VirtualMachineScaleSetListResult + { + /// + /// 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 VirtualMachineScaleSet items on this page. + /// is null. + internal VirtualMachineScaleSetListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The VirtualMachineScaleSet items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal VirtualMachineScaleSetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VirtualMachineScaleSetListResult() + { + } + + /// The VirtualMachineScaleSet items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs new file mode 100644 index 0000000000000..669582afd846b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class WinRMConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WinRMConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Listeners)) + { + writer.WritePropertyName("listeners"u8); + writer.WriteStartArray(); + foreach (var item in Listeners) + { + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + WinRMConfiguration 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(WinRMConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWinRMConfiguration(document.RootElement, options); + } + + internal static WinRMConfiguration DeserializeWinRMConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList listeners = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("listeners"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetWinRMListener.DeserializeComputeFleetWinRMListener(item, options)); + } + listeners = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WinRMConfiguration(listeners ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WinRMConfiguration)} does not support writing '{options.Format}' format."); + } + } + + WinRMConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWinRMConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WinRMConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.cs new file mode 100644 index 0000000000000..1cc6c654610ab --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes Windows Remote Management configuration of the VM. + internal partial class WinRMConfiguration + { + /// + /// 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 . + public WinRMConfiguration() + { + Listeners = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of Windows Remote Management listeners. + /// Keeps track of any properties unknown to the library. + internal WinRMConfiguration(IList listeners, IDictionary serializedAdditionalRawData) + { + Listeners = listeners; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of Windows Remote Management listeners. + public IList Listeners { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.Serialization.cs new file mode 100644 index 0000000000000..b4b958c1bef36 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.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.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class WindowsSetupAdditionalInformation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WindowsSetupAdditionalInformation)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PassName)) + { + writer.WritePropertyName("passName"u8); + writer.WriteStringValue(PassName.Value.ToString()); + } + if (Optional.IsDefined(ComponentName)) + { + writer.WritePropertyName("componentName"u8); + writer.WriteStringValue(ComponentName.Value.ToString()); + } + if (Optional.IsDefined(SettingName)) + { + writer.WritePropertyName("settingName"u8); + writer.WriteStringValue(SettingName.Value.ToString()); + } + if (Optional.IsDefined(Content)) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + WindowsSetupAdditionalInformation 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(WindowsSetupAdditionalInformation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWindowsSetupAdditionalInformation(document.RootElement, options); + } + + internal static WindowsSetupAdditionalInformation DeserializeWindowsSetupAdditionalInformation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WindowsSetupAdditionalInformationPassName? passName = default; + WindowsSetupAdditionalInformationComponentName? componentName = default; + AdditionalInformationSettingName? settingName = default; + string content = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("passName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + passName = new WindowsSetupAdditionalInformationPassName(property.Value.GetString()); + continue; + } + if (property.NameEquals("componentName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + componentName = new WindowsSetupAdditionalInformationComponentName(property.Value.GetString()); + continue; + } + if (property.NameEquals("settingName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + settingName = new AdditionalInformationSettingName(property.Value.GetString()); + continue; + } + if (property.NameEquals("content"u8)) + { + content = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WindowsSetupAdditionalInformation(passName, componentName, settingName, content, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WindowsSetupAdditionalInformation)} does not support writing '{options.Format}' format."); + } + } + + WindowsSetupAdditionalInformation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWindowsSetupAdditionalInformation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WindowsSetupAdditionalInformation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.cs new file mode 100644 index 0000000000000..0d024a1b04cb5 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies additional XML formatted information that can be included in the + /// Unattend.xml file, which is used by Windows Setup. Contents are defined by + /// setting name, component name, and the pass in which the content is applied. + /// + public partial class WindowsSetupAdditionalInformation + { + /// + /// 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 . + public WindowsSetupAdditionalInformation() + { + } + + /// Initializes a new instance of . + /// The pass name. Currently, the only allowable value is OobeSystem. + /// + /// The component name. Currently, the only allowable value is + /// Microsoft-Windows-Shell-Setup. + /// + /// + /// Specifies the name of the setting to which the content applies. Possible values + /// are: FirstLogonCommands and AutoLogon. + /// + /// + /// Specifies the XML formatted content that is added to the unattend.xml file for + /// the specified path and component. The XML must be less than 4KB and must + /// include the root element for the setting or feature that is being inserted. + /// + /// Keeps track of any properties unknown to the library. + internal WindowsSetupAdditionalInformation(WindowsSetupAdditionalInformationPassName? passName, WindowsSetupAdditionalInformationComponentName? componentName, AdditionalInformationSettingName? settingName, string content, IDictionary serializedAdditionalRawData) + { + PassName = passName; + ComponentName = componentName; + SettingName = settingName; + Content = content; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The pass name. Currently, the only allowable value is OobeSystem. + public WindowsSetupAdditionalInformationPassName? PassName { get; set; } + /// + /// The component name. Currently, the only allowable value is + /// Microsoft-Windows-Shell-Setup. + /// + public WindowsSetupAdditionalInformationComponentName? ComponentName { get; set; } + /// + /// Specifies the name of the setting to which the content applies. Possible values + /// are: FirstLogonCommands and AutoLogon. + /// + public AdditionalInformationSettingName? SettingName { get; set; } + /// + /// Specifies the XML formatted content that is added to the unattend.xml file for + /// the specified path and component. The XML must be less than 4KB and must + /// include the root element for the setting or feature that is being inserted. + /// + public string Content { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationComponentName.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationComponentName.cs new file mode 100644 index 0000000000000..46c35370f73f2 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationComponentName.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// The WindowsSetupAdditionalInformation_componentName. + public readonly partial struct WindowsSetupAdditionalInformationComponentName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WindowsSetupAdditionalInformationComponentName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MicrosoftWindowsShellSetupValue = "Microsoft-Windows-Shell-Setup"; + + /// Microsoft-Windows-Shell-Setup. + public static WindowsSetupAdditionalInformationComponentName MicrosoftWindowsShellSetup { get; } = new WindowsSetupAdditionalInformationComponentName(MicrosoftWindowsShellSetupValue); + /// Determines if two values are the same. + public static bool operator ==(WindowsSetupAdditionalInformationComponentName left, WindowsSetupAdditionalInformationComponentName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WindowsSetupAdditionalInformationComponentName left, WindowsSetupAdditionalInformationComponentName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator WindowsSetupAdditionalInformationComponentName(string value) => new WindowsSetupAdditionalInformationComponentName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WindowsSetupAdditionalInformationComponentName other && Equals(other); + /// + public bool Equals(WindowsSetupAdditionalInformationComponentName 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationPassName.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationPassName.cs new file mode 100644 index 0000000000000..e7b5fa1d8fcad --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationPassName.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// The WindowsSetupAdditionalInformation_passName. + public readonly partial struct WindowsSetupAdditionalInformationPassName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WindowsSetupAdditionalInformationPassName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OobeSystemValue = "OobeSystem"; + + /// OobeSystem. + public static WindowsSetupAdditionalInformationPassName OobeSystem { get; } = new WindowsSetupAdditionalInformationPassName(OobeSystemValue); + /// Determines if two values are the same. + public static bool operator ==(WindowsSetupAdditionalInformationPassName left, WindowsSetupAdditionalInformationPassName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WindowsSetupAdditionalInformationPassName left, WindowsSetupAdditionalInformationPassName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator WindowsSetupAdditionalInformationPassName(string value) => new WindowsSetupAdditionalInformationPassName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WindowsSetupAdditionalInformationPassName other && Equals(other); + /// + public bool Equals(WindowsSetupAdditionalInformationPassName 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ProviderConstants.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ProviderConstants.cs new file mode 100644 index 0000000000000..89dbf6abd9917 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ComputeFleet +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/RestOperations/FleetsRestOperations.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/RestOperations/FleetsRestOperations.cs new file mode 100644 index 0000000000000..497e8c9acbcd8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/RestOperations/FleetsRestOperations.cs @@ -0,0 +1,901 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ComputeFleet.Models; + +namespace Azure.ResourceManager.ComputeFleet +{ + internal partial class FleetsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// The to use. + /// The API version to use for this operation. + /// or is null. + public FleetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ComputeFleetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ComputeFleetData.DeserializeComputeFleetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ComputeFleetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ComputeFleetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ComputeFleetData.DeserializeComputeFleetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ComputeFleetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Fleet resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Fleet resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Fleet resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Fleet resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListVirtualMachineScaleSetsRequestUri(string subscriptionId, string resourceGroupName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualMachineScaleSets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListVirtualMachineScaleSetsRequest(string subscriptionId, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualMachineScaleSets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List VirtualMachineScaleSet resources by Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListVirtualMachineScaleSetsAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateListVirtualMachineScaleSetsRequest(subscriptionId, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineScaleSetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VirtualMachineScaleSetListResult.DeserializeVirtualMachineScaleSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List VirtualMachineScaleSet resources by Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListVirtualMachineScaleSets(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateListVirtualMachineScaleSetsRequest(subscriptionId, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineScaleSetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VirtualMachineScaleSetListResult.DeserializeVirtualMachineScaleSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Fleet resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Fleet resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Fleet resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Fleet resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListVirtualMachineScaleSetsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListVirtualMachineScaleSetsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List VirtualMachineScaleSet resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListVirtualMachineScaleSetsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateListVirtualMachineScaleSetsNextPageRequest(nextLink, subscriptionId, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineScaleSetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VirtualMachineScaleSetListResult.DeserializeVirtualMachineScaleSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List VirtualMachineScaleSet resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListVirtualMachineScaleSetsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateListVirtualMachineScaleSetsNextPageRequest(nextLink, subscriptionId, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineScaleSetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VirtualMachineScaleSetListResult.DeserializeVirtualMachineScaleSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Properties/AssemblyInfo.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000..3c2cf9f44386e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.AzureFleet")] + +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] +[assembly: InternalsVisibleTo("Azure.ResourceManager.ComputeFleet.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/autorest.md.bak b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/autorest.md.bak new file mode 100644 index 0000000000000..7ff2afdfd1d32 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/autorest.md.bak @@ -0,0 +1,199 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateCode` to generate code. + +``` yaml +azure-arm: true +csharp: true +library-name: ComputeFleet +namespace: Azure.ResourceManager.ComputeFleet +require: https://github.com/Azure/azure-rest-api-specs/blob/ad73e424df6df56b4cd206fcba7149891b5b6660/specification/azurefleet/resource-manager/readme.md +#tag: package-preview-2024-05 +output-folder: $(this-folder)/Generated +clear-output-folder: true +sample-gen: + output-folder: $(this-folder)/../samples/Generated + clear-output-folder: true + skipped-operations: + - Fleets_Update + - Fleets_CreateOrUpdate +skip-csproj: true +modelerfour: + flatten-payloads: false + flatten-models: false +use-model-reader-writer: true + +#mgmt-debug: +# show-serialized-names: true + +format-by-name-rules: + 'tenantId': 'uuid' + 'ETag': 'etag' + 'location': 'azure-location' + '*Uri': 'Uri' + '*Uris': 'Uri' + +acronym-mapping: + CPU: Cpu + CPUs: Cpus + Os: OS + Ip: IP + Ips: IPs|ips + ID: Id + IDs: Ids + VM: Vm + VMs: Vms + Vmos: VmOS + VMScaleSet: VmScaleSet + DNS: Dns + VPN: Vpn + NAT: Nat + WAN: Wan + Ipv4: IPv4|ipv4 + Ipv6: IPv6|ipv6 + Ipsec: IPsec|ipsec + SSO: Sso + URI: Uri + Etag: ETag|etag + +rename-mapping: + Fleet: ComputeFleet + FleetProperties: ComputeFleetProperties + FleetProperties.timeCreated: CreatedOn + AdditionalUnattendContent: WindowsSetupAdditionalInformation + AdditionalUnattendContentComponentName: WindowsSetupAdditionalInformationComponentName + AdditionalUnattendContentPassName: WindowsSetupAdditionalInformationPassName + ApiErrorBase: ComputeFleetApiErrorInfo + BaseVirtualMachineProfile: ComputeFleetVmProfile + BaseVirtualMachineProfile.timeCreated: CreatedOn + BootDiagnostics.enabled: IsEnabled + DeleteOptions: ComputeFleetVmDeleteOptions + DiskControllerTypes.NVMe: Nvme + LinuxConfiguration.disablePasswordAuthentication: IsPasswordAuthenticationDisabled + LinuxConfiguration.provisionVMAgent: IsVmAgentProvisioned + LinuxConfiguration.enableVMAgentPlatformUpdates: IsVmAgentPlatformUpdatesEnabled + LinuxVMGuestPatchAutomaticByPlatformSettings.bypassPlatformSafetyChecksOnUserSchedule: IsBypassPlatformSafetyChecksOnUserScheduleEnabled + Mode: ProxyAgentExecuteMode + OSImageNotificationProfile.enable: IsEnabled + PatchSettings: ComputeFleetVmGuestPatchSettings + PatchSettings.enableHotpatching: IsHotPatchingEnabled + ProxyAgentSettings.enabled: IsEnabled + SecurityEncryptionTypes.NonPersistedTPM: NonPersistedTpm + SecurityProfile.encryptionAtHost: IsEncryptionAtHostEnabled + SettingNames: AdditionalInformationSettingNames + SpotPriorityProfile.maintain: IsMaintainEnabled + StorageAccountTypes.Standard_LRS: StandardLrs + StorageAccountTypes.Premium_LRS: PremiumLrs + StorageAccountTypes.StandardSSD_LRS: StandardSsdLrd + StorageAccountTypes.UltraSSD_LRS: UltraSsdLrs + StorageAccountTypes.Premium_ZRS: PremiumZrs + StorageAccountTypes.StandardSSD_ZRS: StandardSsdZrs + TerminateNotificationProfile.enable: IsEnabled + UefiSettings.secureBootEnabled: IsSecureBootEnabled + UefiSettings.vTpmEnabled: IsVTpmEnabled + VirtualMachineScaleSet: ComputeFleetVmss + VirtualMachineScaleSetDataDisk: ComputeFleetVmssDataDisk + VirtualMachineScaleSetDataDisk.writeAcceleratorEnabled: IsWriteAcceleratorEnabled + VirtualMachineScaleSetDataDisk.diskIOPSReadWrite: DiskIopsReadWrite + VirtualMachineScaleSetDataDisk.diskMBpsReadWrite: DiskMbpsReadWrite + VirtualMachineScaleSetExtension: ComputeFleetVmssExtension + VirtualMachineScaleSetExtension.type: ExtensionType + VirtualMachineScaleSetExtensionProfile: ComputeFleetVmssExtensionProfile + VirtualMachineScaleSetExtensionProperties: ComputeFleetVmssExtensionProperties + VirtualMachineScaleSetExtensionProperties.type: ExtensionType + VirtualMachineScaleSetExtensionProperties.autoUpgradeMinorVersion: ShouldAutoUpgradeMinorVersion + VirtualMachineScaleSetExtensionProperties.enableAutomaticUpgrade: IsAutomaticUpgradeEnabled + VirtualMachineScaleSetExtensionProperties.suppressFailures: IsSuppressFailuresEnabled + VirtualMachineScaleSetHardwareProfile: ComputeFleetVmssHardwareProfile + VirtualMachineScaleSetIPConfiguration: ComputeFleetVmssIPConfiguration + VirtualMachineScaleSetIPConfigurationProperties: ComputeFleetVmssIPConfigurationProperties + VirtualMachineScaleSetIPConfigurationProperties.primary: IsPrimary + VirtualMachineScaleSetIpTag: ComputeFleetVmssIPTag + VirtualMachineScaleSetManagedDiskParameters: ComputeFleetVmssManagedDisk + VirtualMachineScaleSetNetworkConfiguration: ComputeFleetVmssNetworkConfiguration + VirtualMachineScaleSetNetworkConfigurationDnsSettings: ComputeFleetVmssNetworkDnsSettings + VirtualMachineScaleSetNetworkConfigurationProperties: ComputeFleetVmssNetworkConfigurationProperties + VirtualMachineScaleSetNetworkConfigurationProperties.primary: IsPrimary + VirtualMachineScaleSetNetworkConfigurationProperties.enableAcceleratedNetworking: IsAcceleratedNetworkingEnabled + VirtualMachineScaleSetNetworkConfigurationProperties.disableTcpStateTracking: IsTcpStateTrackingDisabled + VirtualMachineScaleSetNetworkConfigurationProperties.enableFpga: IsFpgaEnabled + VirtualMachineScaleSetNetworkConfigurationProperties.enableIPForwarding: IsIPForwardingEnabled + VirtualMachineScaleSetNetworkProfile: ComputeFleetVmssNetworkProfile + VirtualMachineScaleSetOSDisk: ComputeFleetVmssOSDisk + VirtualMachineScaleSetOSDisk.writeAcceleratorEnabled: IsWriteAcceleratorEnabled + VirtualMachineScaleSetOSProfile: ComputeFleetVmssOSProfile + VirtualMachineScaleSetOSProfile.allowExtensionOperations: AreExtensionOperationsAllowed + VirtualMachineScaleSetOSProfile.requireGuestProvisionSignal: IsGuestProvisionSignalRequired + VirtualMachineScaleSetPublicIPAddressConfiguration: ComputeFleetVmssPublicIPAddressConfiguration + VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings: ComputeFleetVmssPublicIPAddressDnsSettings + VirtualMachineScaleSetPublicIPAddressConfigurationProperties: ComputeFleetVmssPublicIPAddressConfigurationProperties + VirtualMachineScaleSetStorageProfile: ComputeFleetVmssStorageProfile + VMGalleryApplication.treatFailureAsDeploymentFailure: IsTreatFailureAsDeploymentFailureEnabled + VMGalleryApplication.enableAutomaticUpgrade: IsAutomaticUpgradeEnabled + WindowsConfiguration.provisionVMAgent: IsVmAgentProvisioned + WindowsConfiguration.enableAutomaticUpdates: IsAutomaticUpdatesEnabled + WindowsConfiguration.enableVMAgentPlatformUpdates: IsVmAgentPlatformUpdatesEnabled + WindowsVMGuestPatchAutomaticByPlatformSettings.bypassPlatformSafetyChecksOnUserSchedule: IsBypassPlatformSafetyChecksOnUserScheduleEnabled + +prepend-rp-prefix: + - ApiError + - ApplicationProfile + - BootDiagnostics + - CachingTypes + - ComputeProfile + - DiagnosticsProfile + - DiffDiskOptions + - DiffDiskPlacement + - DiffDiskSettings + - DiskControllerTypes + - DiskCreateOptionTypes + - DiskDeleteOptionTypes + - DomainNameLabelScopeTypes + - EncryptionIdentity + - EvictionPolicy + - ImageReference + - InnerError + - IPVersion + - KeyVaultSecretReference + - LinuxConfiguration + - LinuxPatchAssessmentMode + - LinuxPatchSettings + - LinuxVMGuestPatchAutomaticByPlatformRebootSetting + - LinuxVMGuestPatchAutomaticByPlatformSettings + - LinuxVMGuestPatchMode + - NetworkApiVersion + - NetworkInterfaceAuxiliaryMode + - NetworkInterfaceAuxiliarySku + - OperatingSystemTypes + - OSImageNotificationProfile + - ProtocolTypes + - ProvisioningState + - ProxyAgentSettings + - PublicIPAddressSku + - PublicIPAddressSkuName + - PublicIPAddressSkuTier + - ScheduledEventsProfile + - SecurityEncryptionTypes + - SecurityPostureReference + - SecurityProfile + - SecurityTypes + - SshConfiguration + - SshPublicKey + - StorageAccountTypes + - TerminateNotificationProfile + - UefiSettings + - VaultCertificate + - VaultSecretGroup + - VirtualHardDisk + - VMDiskSecurityProfile + - VMGalleryApplication + - VmSizeProfile + - VMSizeProperties + - WindowsConfiguration + - WindowsPatchAssessmentMode + - WindowsVMGuestPatchAutomaticByPlatformRebootSetting + - WindowsVMGuestPatchAutomaticByPlatformSettings + - WindowsVMGuestPatchMode + - WinRMListener + +``` \ No newline at end of file diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/Azure.ResourceManager.ComputeFleet.Tests.csproj b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/Azure.ResourceManager.ComputeFleet.Tests.csproj new file mode 100644 index 0000000000000..9209a063ed2b6 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/Azure.ResourceManager.ComputeFleet.Tests.csproj @@ -0,0 +1,5 @@ + + + + + diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestBase.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestBase.cs new file mode 100644 index 0000000000000..bdaea3c858356 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestBase.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.ComputeFleet.Tests +{ + public class ComputeFleetManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected ComputeFleetManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected ComputeFleetManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestEnvironment.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestEnvironment.cs new file mode 100644 index 0000000000000..60efcacf330e9 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.ComputeFleet.Tests +{ + public class ComputeFleetManagementTestEnvironment : TestEnvironment + { + } +} \ No newline at end of file diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml new file mode 100644 index 0000000000000..b5e602272d0c1 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml @@ -0,0 +1,3 @@ +directory: specification/azurefleet/AzureFleet.Management +commit: c0a15f4623eb11f745f890089f3d46d8a538524f +repo: Azure/azure-rest-api-specs \ No newline at end of file diff --git a/sdk/computefleet/ci.mgmt.yml b/sdk/computefleet/ci.mgmt.yml new file mode 100644 index 0000000000000..de169e18c5997 --- /dev/null +++ b/sdk/computefleet/ci.mgmt.yml @@ -0,0 +1,23 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: computefleet + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.ComputeFleet + safeName: AzureResourceManagerComputeFleet diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index e9e2255bc9f71..d0b6b524e8744 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -41,6 +41,7 @@ trigger: - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices - sdk/communication/Azure.ResourceManager.Communication - sdk/compute/Azure.ResourceManager.Compute + - sdk/computefleet/Azure.ResourceManager.ComputeFleet - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger - sdk/confluent/Azure.ResourceManager.Confluent - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere @@ -241,6 +242,7 @@ pr: - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices - sdk/communication/Azure.ResourceManager.Communication - sdk/compute/Azure.ResourceManager.Compute + - sdk/computefleet/Azure.ResourceManager.ComputeFleet - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger - sdk/confluent/Azure.ResourceManager.Confluent - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere From 2ba91f00e1315c197f22a97881a56efc8ee79f18 Mon Sep 17 00:00:00 2001 From: Wei Hu Date: Fri, 30 Aug 2024 15:34:30 +0800 Subject: [PATCH 60/71] Prepare release for MongoCluster (#45738) --- .../Azure.ResourceManager.MongoCluster/CHANGELOG.md | 4 ++-- sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md | 2 +- .../src/Azure.ResourceManager.MongoCluster.csproj | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md index 6a9f3bac33c1d..9a69c702495f3 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-08-30) ### Features Added @@ -14,4 +14,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). \ No newline at end of file +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md index 1ad4c08a5e955..a8860122c4e19 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md @@ -1,6 +1,6 @@ # Microsoft Azure MongoCluster management client library for .NET -**[Describe the service briefly first.]** +Azure Cosmos DB for MongoDB in vCore architecture provides developers with a fully managed MongoDB-compatible database service for building modern applications with a familiar architecture. With Azure Cosmos DB for MongoDB (vCore), developers can enjoy the benefits of native Azure integrations, low total cost of ownership (TCO), and the familiar vCore architecture when migrating existing applications or building new ones. This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Azure.ResourceManager.MongoCluster.csproj b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Azure.ResourceManager.MongoCluster.csproj index fece58e306f48..34948a77c2350 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Azure.ResourceManager.MongoCluster.csproj +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Azure.ResourceManager.MongoCluster.csproj @@ -1,4 +1,4 @@ - + 1.0.0-beta.1 Azure.ResourceManager.MongoCluster From 06d99c9bbfcc8eca7ad64174bb48d0668838a6b6 Mon Sep 17 00:00:00 2001 From: yzt Date: Fri, 30 Aug 2024 15:45:25 +0800 Subject: [PATCH 61/71] Add event handlers for MQTT in WPS extensions (#45465) --- .../CHANGELOG.md | 10 +- .../README.md | 44 +++- ...obs.Extensions.WebPubSub.netstandard2.0.cs | 8 + .../samples/WebPubSubTriggerFunction.cs | 38 ++- .../src/Config/WebPubSubConfigProvider.cs | 3 +- .../src/Constants.cs | 10 +- ...tConnectEventErrorResponseJsonConverter.cs | 29 +++ ....Azure.WebJobs.Extensions.WebPubSub.csproj | 14 +- .../Services/WebPubSubRequestExtensions.cs | 34 ++- .../src/Services/WebPubSubService.cs | 4 +- ...WebPubSubTriggerAcceptedClientProtocols.cs | 23 ++ .../src/Trigger/WebPubSubTriggerAttribute.cs | 12 +- .../src/Trigger/WebPubSubTriggerBinding.cs | 2 +- .../WebPubSubTriggerBindingProvider.cs | 6 +- .../src/Trigger/WebPubSubTriggerDispatcher.cs | 70 ++++-- .../src/Trigger/WebPubSubTriggerEvent.cs | 8 +- .../src/Utilities.cs | 34 ++- .../src/WebPubSubConnectionAttribute.cs | 7 +- ...ggerAcceptedClientProtocolJsonConverter.cs | 23 ++ .../tests/Common/TestHelpers.cs | 19 +- .../tests/JobHostEndToEndTests.cs | 9 + ....WebJobs.Extensions.WebPubSub.Tests.csproj | 1 + .../tests/WebPubSubTriggerDispatcherTests.cs | 187 ++++++++++++++- .../CHANGELOG.md | 10 +- ...t.Azure.WebPubSub.Common.netstandard2.0.cs | 218 +++++++++++++++++- .../src/ContributionHints.md | 28 +++ .../MqttConnectPropertiesJsonConverter.cs | 72 ++++++ ...DisconnectPacketPropertiesJsonConverter.cs | 73 ++++++ ...ctedEventRequestPropertiesJsonConverter.cs | 72 ++++++ .../Internal/MqttUserPropertyJsonConverter.cs | 63 +++++ ...WebPubSubClientCertificateJsonConverter.cs | 64 ++++- .../Microsoft.Azure.WebPubSub.Common.csproj | 3 +- ...MqttConnectEventErrorResponseProperties.cs | 62 +++++ .../MqttConnectEventResponseProperties.cs | 26 +++ .../src/Mqtt/MqttConnectProperties.cs | 68 ++++++ .../Mqtt/MqttDisconnectPacketProperties.cs | 47 ++++ .../src/Mqtt/MqttDisconnectReasonCode.cs | 216 +++++++++++++++++ .../MqttDisconnectedEventRequestProperties.cs | 45 ++++ .../src/Mqtt/MqttProtocolVersion.cs | 22 ++ .../src/Mqtt/MqttUserProperty.cs | 43 ++++ .../src/Mqtt/MqttV311ConnectReturnCode.cs | 40 ++++ .../src/Mqtt/MqttV500ConnectReasonCode.cs | 137 +++++++++++ .../src/MqttConnectionContext.cs | 55 +++++ .../src/Request/ConnectEventRequest.cs | 4 +- .../src/Request/ConnectedEventRequest.cs | 2 +- .../src/Request/DisconnectedEventRequest.cs | 2 +- .../src/Request/MqttConnectEventRequest.cs | 102 ++++++++ .../Request/MqttDisconnectedEventRequest.cs | 36 +++ .../Response/MqttConnectEventErrorResponse.cs | 60 +++++ .../src/Response/MqttConnectEventResponse.cs | 44 ++++ .../MqttConnectEventErrorResponseContent.cs | 37 +++ .../Shared/MqttConnectEventRequestContent.cs | 64 +++++ .../MqttDisconnectedEventRequestContent.cs | 14 ++ .../Shared/WebPubSubErrorCodeExtensions.cs | 83 +++++++ .../src/WebPubSubClientCertificate.cs | 25 ++ 55 files changed, 2339 insertions(+), 93 deletions(-) create mode 100644 sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/JsonConverters/MqttConnectEventErrorResponseJsonConverter.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAcceptedClientProtocols.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubTriggerAcceptedClientProtocolJsonConverter.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/ContributionHints.md create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttConnectPropertiesJsonConverter.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectPacketPropertiesJsonConverter.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectedEventRequestPropertiesJsonConverter.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttUserPropertyJsonConverter.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventErrorResponseProperties.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventResponseProperties.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectProperties.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectPacketProperties.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectReasonCode.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectedEventRequestProperties.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttProtocolVersion.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttUserProperty.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV311ConnectReturnCode.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV500ConnectReasonCode.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/MqttConnectionContext.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttConnectEventRequest.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttDisconnectedEventRequest.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventErrorResponse.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventResponse.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventErrorResponseContent.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventRequestContent.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttDisconnectedEventRequestContent.cs create mode 100644 sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/WebPubSubErrorCodeExtensions.cs diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/CHANGELOG.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/CHANGELOG.md index eaa7e99767d9f..8b2d003a0a1b5 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/CHANGELOG.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/CHANGELOG.md @@ -1,14 +1,8 @@ # Release History -## 1.8.0-beta.1 (Unreleased) - +## 1.8.0 (2024-09-04) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added MQTT client events support. ## 1.7.0 (2023-08-28) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md index 35ed744e06538..e3eeb84f8d5ea 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md @@ -94,18 +94,15 @@ public static class WebPubSubOutputBindingFunction ### Functions that uses Web PubSub trigger ```C# Snippet:WebPubSubTriggerFunction -public static class WebPubSubTriggerFunction +[FunctionName("WebPubSubTriggerFunction")] +public static void Run( + ILogger logger, + [WebPubSubTrigger("hub", WebPubSubEventType.User, "message")] UserEventRequest request, + string data, + WebPubSubDataType dataType) { - [FunctionName("WebPubSubTriggerFunction")] - public static void Run( - ILogger logger, - [WebPubSubTrigger("hub", WebPubSubEventType.User, "message")] UserEventRequest request, - string data, - WebPubSubDataType dataType) - { - logger.LogInformation("Request from: {user}, data: {data}, dataType: {dataType}", - request.ConnectionContext.UserId, data, dataType); - } + logger.LogInformation("Request from: {user}, data: {data}, dataType: {dataType}", + request.ConnectionContext.UserId, data, dataType); } ``` @@ -123,6 +120,31 @@ public static class WebPubSubTriggerReturnValueFunction } ``` +### Functions that handles MQTT Client "connect" event +```C# Snippet:MqttConnectEventTriggerFunction +[FunctionName("mqttConnect")] +public static WebPubSubEventResponse Run( + [WebPubSubTrigger("hub", WebPubSubEventType.System, "connect", ClientProtocols = WebPubSubTriggerAcceptedClientProtocols.Mqtt)] MqttConnectEventRequest request, + ILogger log) +{ + if (request.ConnectionContext.ConnectionId != "attacker") + { + return request.CreateMqttResponse(request.ConnectionContext.UserId, Array.Empty(), new string[] { "webpubsub.joinLeaveGroup.group1", "webpubsub.sendToGroup.group2" }); + } + else + { + if (request.Mqtt.ProtocolVersion == MqttProtocolVersion.V311) + { + return request.CreateMqttV311ErrorResponse(MqttV311ConnectReturnCode.NotAuthorized); + } + else + { + return request.CreateMqttV50ErrorResponse(MqttV500ConnectReasonCode.NotAuthorized); + } + } +} +``` + ## Troubleshooting Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/api/Microsoft.Azure.WebJobs.Extensions.WebPubSub.netstandard2.0.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/api/Microsoft.Azure.WebJobs.Extensions.WebPubSub.netstandard2.0.cs index b06b81fc96209..705d0aefa7abe 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/api/Microsoft.Azure.WebJobs.Extensions.WebPubSub.netstandard2.0.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/api/Microsoft.Azure.WebJobs.Extensions.WebPubSub.netstandard2.0.cs @@ -153,6 +153,7 @@ public WebPubSubConnection(System.Uri uri) { } public partial class WebPubSubConnectionAttribute : System.Attribute { public WebPubSubConnectionAttribute() { } + public Azure.Messaging.WebPubSub.WebPubSubClientProtocol ClientProtocol { get { throw null; } set { } } [Microsoft.Azure.WebJobs.Description.ConnectionStringAttribute] public string Connection { get { throw null; } set { } } [Microsoft.Azure.WebJobs.Description.AutoResolveAttribute] @@ -190,6 +191,12 @@ public WebPubSubFunctionsOptions() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] string Microsoft.Azure.WebJobs.Hosting.IOptionsFormatter.Format() { throw null; } } + public enum WebPubSubTriggerAcceptedClientProtocols + { + All = 0, + WebPubSub = 1, + Mqtt = 2, + } [Microsoft.Azure.WebJobs.Description.BindingAttribute(TriggerHandlesReturnValue=true)] [System.AttributeUsageAttribute(System.AttributeTargets.Parameter)] public partial class WebPubSubTriggerAttribute : System.Attribute @@ -198,6 +205,7 @@ public WebPubSubTriggerAttribute(Microsoft.Azure.WebPubSub.Common.WebPubSubEvent public WebPubSubTriggerAttribute(Microsoft.Azure.WebPubSub.Common.WebPubSubEventType eventType, string eventName, params string[] connections) { } public WebPubSubTriggerAttribute(string hub, Microsoft.Azure.WebPubSub.Common.WebPubSubEventType eventType, string eventName) { } public WebPubSubTriggerAttribute(string hub, Microsoft.Azure.WebPubSub.Common.WebPubSubEventType eventType, string eventName, params string[] connections) { } + public Microsoft.Azure.WebJobs.Extensions.WebPubSub.WebPubSubTriggerAcceptedClientProtocols ClientProtocols { get { throw null; } set { } } public string[] Connections { get { throw null; } } [System.ComponentModel.DataAnnotations.RequiredAttribute] public string EventName { get { throw null; } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/samples/WebPubSubTriggerFunction.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/samples/WebPubSubTriggerFunction.cs index 52166bc1929ff..ab6cff763335a 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/samples/WebPubSubTriggerFunction.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/samples/WebPubSubTriggerFunction.cs @@ -1,15 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using Microsoft.Azure.WebJobs.Extensions.WebPubSub; using Microsoft.Azure.WebPubSub.Common; using Microsoft.Extensions.Logging; namespace Microsoft.Azure.WebJobs.Samples { - #region Snippet:WebPubSubTriggerFunction public static class WebPubSubTriggerFunction { + #region Snippet:WebPubSubTriggerFunction [FunctionName("WebPubSubTriggerFunction")] public static void Run( ILogger logger, @@ -20,6 +21,39 @@ public static void Run( logger.LogInformation("Request from: {user}, data: {data}, dataType: {dataType}", request.ConnectionContext.UserId, data, dataType); } + #endregion + + #region Snippet:MqttConnectEventTriggerFunction + [FunctionName("mqttConnect")] + public static WebPubSubEventResponse Run( + [WebPubSubTrigger("hub", WebPubSubEventType.System, "connect", ClientProtocols = WebPubSubTriggerAcceptedClientProtocols.Mqtt)] MqttConnectEventRequest request, + ILogger log) + { + if (request.ConnectionContext.ConnectionId != "attacker") + { + return request.CreateMqttResponse(request.ConnectionContext.UserId, Array.Empty(), new string[] { "webpubsub.joinLeaveGroup.group1", "webpubsub.sendToGroup.group2" }); + } + else + { + if (request.Mqtt.ProtocolVersion == MqttProtocolVersion.V311) + { + return request.CreateMqttV311ErrorResponse(MqttV311ConnectReturnCode.NotAuthorized); + } + else + { + return request.CreateMqttV50ErrorResponse(MqttV500ConnectReasonCode.NotAuthorized); + } + } + } + #endregion + + #region: Snippet:MqttDisconnectedEventTriggerFunction + [FunctionName("mqttDisconnected")] + public static void Run( + [WebPubSubTrigger("hub", WebPubSubEventType.System, "disconnected", ClientProtocols = WebPubSubTriggerAcceptedClientProtocols.Mqtt)] MqttDisconnectedEventRequest request, + ILogger log) + { + } + #endregion } - #endregion } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Config/WebPubSubConfigProvider.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Config/WebPubSubConfigProvider.cs index 10aab30ac7642..6d2e6a8b34b08 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Config/WebPubSubConfigProvider.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Config/WebPubSubConfigProvider.cs @@ -137,7 +137,7 @@ private WebPubSubConnection GetClientConnection(WebPubSubConnectionAttribute att { var hub = Utilities.FirstOrDefault(attribute.Hub, _options.Hub); var service = new WebPubSubService(attribute.Connection, hub); - return service.GetClientConnection(attribute.UserId); + return service.GetClientConnection(attribute.UserId, clientProtocol: attribute.ClientProtocol); } private void ValidateConnectionString(string attributeConnectionString, string attributeConnectionStringName) @@ -160,6 +160,7 @@ internal static void RegisterJsonConverter() new ConnectionStatesNewtonsoftConverter(), new WebPubSubDataTypeJsonConverter(), new WebPubSubEventTypeJsonConverter(), + new WebPubSubTriggerAcceptedClientProtocolsJsonConverter(), }, }; } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Constants.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Constants.cs index a4880625d867c..ea164ab998225 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Constants.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Constants.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub { internal static class Constants { - public static readonly char[] HeaderSeparator = { ',', ' '}; + public static readonly char[] HeaderSeparator = { ',', ' ' }; public const string AllowedAllOrigins = "*"; // WebPubSubOptions can be set by customers. @@ -13,6 +13,8 @@ internal static class Constants public const string HubNameStringName = "WebPubSubHub"; public const string WebPubSubValidationStringName = "WebPubSubValidation"; + public const string MqttWebSocketSubprotocolValue = "mqtt"; + public static class ContentTypes { public const string JsonContentType = "application/json"; @@ -45,6 +47,12 @@ public static class CloudEvents public const string UserId = Prefix + "userId"; public const string State = Prefix + "connectionState"; public const string AwpsVersion = Prefix + "awpsversion"; + public const string Subprotocol = Prefix + "subprotocol"; + + #region MQTT + public const string MqttPhysicalConnectionId = Prefix + "physicalConnectionId"; + public const string MqttSessionId = Prefix + "sessionId"; + #endregion public const string TypeSystemPrefix = "azure.webpubsub.sys."; public const string TypeUserPrefix = "azure.webpubsub.user."; diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/JsonConverters/MqttConnectEventErrorResponseJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/JsonConverters/MqttConnectEventErrorResponseJsonConverter.cs new file mode 100644 index 0000000000000..0104588016440 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/JsonConverters/MqttConnectEventErrorResponseJsonConverter.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Microsoft.Azure.WebPubSub.Common; +using Newtonsoft.Json; + +namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub; + +/// +/// This converter is used to avoid serializing the properties of the base class . +/// +internal class MqttConnectEventErrorResponseJsonConverter : JsonConverter +{ + public static MqttConnectEventErrorResponseJsonConverter Instance = new(); + + public override MqttConnectEventErrorResponse ReadJson(JsonReader reader, Type objectType, MqttConnectEventErrorResponse existingValue, bool hasExistingValue, JsonSerializer serializer) + { + throw new NotImplementedException(); + } + + public override void WriteJson(JsonWriter writer, MqttConnectEventErrorResponse value, JsonSerializer serializer) + { + writer.WriteStartObject(); + writer.WritePropertyName("mqtt"); + serializer.Serialize(writer, value.Mqtt); + writer.WriteEndObject(); + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Microsoft.Azure.WebJobs.Extensions.WebPubSub.csproj b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Microsoft.Azure.WebJobs.Extensions.WebPubSub.csproj index 410a5e325d5b7..785dc7ccfcbdf 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Microsoft.Azure.WebJobs.Extensions.WebPubSub.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Microsoft.Azure.WebJobs.Extensions.WebPubSub.csproj @@ -5,7 +5,7 @@ Microsoft.Azure.WebJobs.Extensions.WebPubSub Azure, WebPubSub Azure Functions extension for the WebPubSub service - 1.8.0-beta.1 + 1.8.0 1.7.0 $(NoWarn);CS8632;CA1056;CA2227 @@ -15,6 +15,10 @@ + + + + @@ -24,11 +28,11 @@ + - --> + - + diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubRequestExtensions.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubRequestExtensions.cs index bb4e50a5c0ef4..9dc359185a8b8 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubRequestExtensions.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubRequestExtensions.cs @@ -65,8 +65,16 @@ public static async Task ReadWebPubSubRequestAsync(this H case RequestType.Connect: { var content = await new StreamReader(request.Body).ReadToEndAsync().ConfigureAwait(false); - var eventRequest = JsonSerializer.Deserialize(content); - return new ConnectEventRequest(context, eventRequest.Claims, eventRequest.Query, eventRequest.Subprotocols, eventRequest.ClientCertificates, eventRequest.Headers); + if (context is MqttConnectionContext mqttContext) + { + var requestBody = JsonSerializer.Deserialize(content); + return new MqttConnectEventRequest(mqttContext, requestBody.Claims, requestBody.Query, requestBody.ClientCertificates, requestBody.Headers, requestBody.Mqtt); + } + else + { + var requestBody = JsonSerializer.Deserialize(content); + return new ConnectEventRequest(context, requestBody.Claims, requestBody.Query, requestBody.Subprotocols, requestBody.ClientCertificates, requestBody.Headers); + } } case RequestType.User: { @@ -86,8 +94,16 @@ public static async Task ReadWebPubSubRequestAsync(this H case RequestType.Disconnected: { var content = await new StreamReader(request.Body).ReadToEndAsync().ConfigureAwait(false); - var eventRequest = JsonSerializer.Deserialize(content); - return new DisconnectedEventRequest(context, eventRequest.Reason); + if (context is MqttConnectionContext mqttContext) + { + var requestBody = JsonSerializer.Deserialize(content); + return new MqttDisconnectedEventRequest(mqttContext, requestBody.Reason, requestBody.Mqtt); + } + else + { + var requestBody = JsonSerializer.Deserialize(content); + return new DisconnectedEventRequest(context, requestBody.Reason); + } } default: return null; @@ -220,6 +236,16 @@ private static bool TryParseCloudEvents(this HttpRequest request, out WebPubSubC states = request.Headers.GetFirstHeaderValueOrDefault(Constants.Headers.CloudEvents.State).DecodeConnectionStates(); } + if (Constants.MqttWebSocketSubprotocolValue.Equals(request.Headers.GetFirstHeaderValueOrDefault(Constants.Headers.CloudEvents.Subprotocol))) + { + var physicalConnectionId = request.Headers[Constants.Headers.CloudEvents.MqttPhysicalConnectionId]; + if (physicalConnectionId.Count != 0) + { + var sessionId = request.Headers.GetFirstHeaderValueOrDefault(Constants.Headers.CloudEvents.MqttSessionId); + connectionContext = new MqttConnectionContext(eventType, eventName, hub, connectionId, physicalConnectionId.First(), sessionId, userId, signature, origin, states, headers); + return true; + } + } connectionContext = new WebPubSubConnectionContext(eventType, eventName, hub, connectionId, userId, signature, origin, states, headers); return true; } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubService.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubService.cs index 60c4e80f0f418..01b9070f7bec7 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubService.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubService.cs @@ -22,9 +22,9 @@ public WebPubSubService(WebPubSubServiceClient client) public WebPubSubServiceClient Client => _client; - internal WebPubSubConnection GetClientConnection(string userId = null, string[] roles = null) + internal WebPubSubConnection GetClientConnection(string userId = null, string[] roles = null, WebPubSubClientProtocol clientProtocol = WebPubSubClientProtocol.Default) { - var url = _client.GetClientAccessUri(userId: userId, roles: roles); + var url = _client.GetClientAccessUri(userId: userId, roles: roles, clientProtocol: clientProtocol); return new WebPubSubConnection(url); } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAcceptedClientProtocols.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAcceptedClientProtocols.cs new file mode 100644 index 0000000000000..e4b5f1fe116b4 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAcceptedClientProtocols.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub; + +/// +/// Specifies which client protocol can trigger the Web PubSub trigger functions. +/// +public enum WebPubSubTriggerAcceptedClientProtocols +{ + /// + /// Accepts all client protocols. Default value. + /// + All, + /// + /// Accepts only WebPubSub client protocol. + /// + WebPubSub, + /// + /// Accepts only MQTT client protocol. + /// + Mqtt, +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAttribute.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAttribute.cs index cc9c342466ac6..dad48484ef1ef 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAttribute.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAttribute.cs @@ -3,8 +3,8 @@ using System; using System.ComponentModel.DataAnnotations; -using Microsoft.Azure.WebPubSub.Common; using Microsoft.Azure.WebJobs.Description; +using Microsoft.Azure.WebPubSub.Common; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub { @@ -60,7 +60,7 @@ public WebPubSubTriggerAttribute(WebPubSubEventType eventType, string eventName, /// Target event name of the request. /// Target event type of the request. public WebPubSubTriggerAttribute(WebPubSubEventType eventType, string eventName) - : this ("", eventType, eventName) + : this("", eventType, eventName) { } @@ -86,5 +86,13 @@ public WebPubSubTriggerAttribute(WebPubSubEventType eventType, string eventName) /// Allowed service upstream ConnectionString for Signature checks. /// public string[] Connections { get; } + + /// + /// Specifies which client protocol can trigger the Web PubSub trigger functions. By default, it accepts all client protocols. + /// + public WebPubSubTriggerAcceptedClientProtocols ClientProtocols + { + get; set; + } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBinding.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBinding.cs index 45eac1e19c4f6..a4efcefcfdf11 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBinding.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBinding.cs @@ -68,7 +68,7 @@ public Task CreateListenerAsync(ListenerFactoryContext context) { throw new ArgumentException("Hub name should be configured in either attribute or appsettings."); } - var attributeName = $"{hub}.{_attribute.EventType}.{_attribute.EventName}"; + var attributeName = Utilities.GetFunctionKey(hub, _attribute.EventType, _attribute.EventName, _attribute.ClientProtocols); var listernerKey = attributeName; var validationOptions = _attribute.Connections != null ? diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBindingProvider.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBindingProvider.cs index 78b22810ecd89..b2e97bc8e8555 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBindingProvider.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBindingProvider.cs @@ -30,7 +30,6 @@ public Task TryCreateAsync(TriggerBindingProviderContext contex { throw new ArgumentNullException(nameof(context)); } - var parameterInfo = context.Parameter; var attribute = parameterInfo.GetCustomAttribute(false); if (attribute == null) @@ -62,7 +61,10 @@ internal WebPubSubTriggerAttribute GetResolvedAttribute(WebPubSubTriggerAttribut hub, attribute.EventType, eventName, - attribute.Connections); + attribute.Connections) + { + ClientProtocols = attribute.ClientProtocols + }; } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerDispatcher.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerDispatcher.cs index cdaa93bb044a4..b6c3e621f31fe 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerDispatcher.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerDispatcher.cs @@ -53,9 +53,7 @@ public async Task ExecuteAsync(HttpRequestMessage req, var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var function = GetFunctionName(context); - - if (_listeners.TryGetValue(function, out var executor)) + if (TryResolveListener(context, out var executor)) { if (!context.IsValidSignature(executor.ValidationOptions)) { @@ -70,10 +68,10 @@ public async Task ExecuteAsync(HttpRequestMessage req, BinaryData data = null; WebPubSubDataType dataType = WebPubSubDataType.Text; - IDictionary claims = null; - IDictionary query = null; - IList subprotocols = null; - IList certificates = null; + IReadOnlyDictionary claims = null; + IReadOnlyDictionary query = null; + IReadOnlyList subprotocols = null; + IReadOnlyList certificates = null; string reason = null; WebPubSubEventRequest eventRequest = null; @@ -83,15 +81,37 @@ public async Task ExecuteAsync(HttpRequestMessage req, case RequestType.Connect: { var content = await req.Content.ReadAsStringAsync().ConfigureAwait(false); - var request = JsonSerializer.Deserialize(content); - eventRequest = new ConnectEventRequest(context, request.Claims, request.Query, request.Subprotocols, request.ClientCertificates, request.Headers); + if (context is MqttConnectionContext mqttContext) + { + var request = JsonSerializer.Deserialize(content); + eventRequest = new MqttConnectEventRequest(mqttContext, request.Claims, request.Query, request.ClientCertificates, request.Headers, request.Mqtt); + } + else + { + var request = JsonSerializer.Deserialize(content); + eventRequest = new ConnectEventRequest(context, request.Claims, request.Query, request.Subprotocols, request.ClientCertificates, request.Headers); + } + var connectEventRequest = (ConnectEventRequest)eventRequest; + claims = connectEventRequest.Claims; + query = connectEventRequest.Query; + subprotocols = connectEventRequest.Subprotocols; + certificates = connectEventRequest.ClientCertificates; break; } case RequestType.Disconnected: { var content = await req.Content.ReadAsStringAsync().ConfigureAwait(false); - var request = JsonSerializer.Deserialize(content); - eventRequest = new DisconnectedEventRequest(context, request.Reason); + if (context is MqttConnectionContext mqttContext) + { + var requestBody = JsonSerializer.Deserialize(content); + eventRequest = new MqttDisconnectedEventRequest(mqttContext, requestBody.Reason, requestBody.Mqtt); + } + else + { + var request = JsonSerializer.Deserialize(content); + eventRequest = new DisconnectedEventRequest(context, request.Reason); + } + reason = ((DisconnectedEventRequest)eventRequest).Reason; break; } case RequestType.User: @@ -163,6 +183,12 @@ await executor.Executor.TryExecuteAsync(new TriggeredFunctionData } catch (Exception ex) { + if (context is MqttConnectionContext mqttContext && requestType == RequestType.Connect) + { + var mqttProtocolVersion = ((MqttConnectEventRequest)eventRequest).Mqtt.ProtocolVersion; + var errorResponse = ((MqttConnectEventRequest)eventRequest).CreateErrorResponse(WebPubSubErrorCode.ServerError, ex.Message); + return Utilities.BuildErrorResponse(errorResponse); + } var error = new EventErrorResponse(WebPubSubErrorCode.ServerError, ex.Message); return Utilities.BuildErrorResponse(error); } @@ -201,6 +227,13 @@ private static bool TryParseCloudEvents(HttpRequestMessage request, out WebPubSu { states = connectionStates.SingleOrDefault().DecodeConnectionStates(); } + if (request.Headers.TryGetValues(Constants.Headers.CloudEvents.Subprotocol, out var subprotocols) && subprotocols.Contains(Constants.MqttWebSocketSubprotocolValue) + && request.Headers.TryGetValues(Constants.Headers.CloudEvents.MqttPhysicalConnectionId, out var physicalConnectionId)) + { + var hasSessionId = request.Headers.TryGetValues(Constants.Headers.CloudEvents.MqttSessionId, out var sessionId); + context = new MqttConnectionContext(eventType, eventName, hub, connectionId, physicalConnectionId.First(), hasSessionId ? sessionId.First() : null, userId, signature, origin, states, headers); + return true; + } context = new WebPubSubConnectionContext(eventType, eventName, hub, connectionId, userId, signature, origin, states, headers); return true; @@ -212,9 +245,20 @@ private static bool TryParseCloudEvents(HttpRequestMessage request, out WebPubSu } } - private static string GetFunctionName(WebPubSubConnectionContext context) + private bool TryResolveListener(WebPubSubConnectionContext context, out WebPubSubListener listener) { - return $"{context.Hub}.{context.EventType}.{context.EventName}"; + // Try to match a listener for specified client protocol + var key = Utilities.GetFunctionKey(context.Hub, context.EventType, context.EventName, (context is MqttConnectionContext ? WebPubSubTriggerAcceptedClientProtocols.Mqtt : WebPubSubTriggerAcceptedClientProtocols.WebPubSub)); + if (_listeners.TryGetValue(key, out listener)) + { + return true; + } + key = $"{context.Hub}.{context.EventType}.{context.EventName}.{WebPubSubTriggerAcceptedClientProtocols.All}"; // match all client protocols + if (_listeners.TryGetValue(key, out listener)) + { + return true; + } + return false; } private static HttpResponseMessage RespondToServiceAbuseCheck(IList requestHosts, WebPubSubValidationOptions options) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerEvent.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerEvent.cs index 4bcbf540f770a..5a2922f26f636 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerEvent.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerEvent.cs @@ -19,13 +19,13 @@ internal class WebPubSubTriggerEvent public WebPubSubDataType DataType { get; set; } - public IList Subprotocols { get; set; } + public IReadOnlyList Subprotocols { get; set; } - public IDictionary Claims { get; set; } + public IReadOnlyDictionary Claims { get; set; } - public IDictionary Query { get; set; } + public IReadOnlyDictionary Query { get; set; } - public IList ClientCertificates { get; set; } + public IReadOnlyList ClientCertificates { get; set; } public string Reason { get; set; } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Utilities.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Utilities.cs index b6ef8bf5fdf4e..b6376c4ab3f19 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Utilities.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Utilities.cs @@ -77,7 +77,11 @@ public static HttpResponseMessage BuildConnectEventResponse(string response, Dic public static HttpResponseMessage BuildErrorResponse(EventErrorResponse error) { - return BuildErrorResponse(error.ErrorMessage, error.Code); + return error switch + { + MqttConnectEventErrorResponse mqttConnectError => BuildErrorResponse(JsonConvert.SerializeObject(mqttConnectError, MqttConnectEventErrorResponseJsonConverter.Instance), mqttConnectError.Code), + _ => BuildErrorResponse(error.ErrorMessage, error.Code) + }; } public static HttpResponseMessage BuildErrorResponse(string errorMessage, WebPubSubErrorCode code = WebPubSubErrorCode.ServerError) @@ -130,9 +134,20 @@ public static HttpResponseMessage BuildValidResponse( JObject response = jResponse is JObject jObj ? jObj : throw new ArgumentException("Response should be a JObject."); // check error as top priority. - if (response.TryGetValue("code", out var code) - && code.ToObject() != WebPubSubStatusCode.Success) + if ( + // General error response + response.TryGetValue("code", out var code) + && code.ToObject() != WebPubSubStatusCode.Success || + + // MQTT connect error response + response.TryGetValue("mqtt", out var mqtt) + && mqtt is JObject mqttObject && mqttObject.TryGetValue("code", out _)) { + if (context is MqttConnectionContext mqttContext) + { + var mqttErrorConnectResponse = response.ToObject(); + return BuildErrorResponse(JsonConvert.SerializeObject(mqttErrorConnectResponse, MqttConnectEventErrorResponseJsonConverter.Instance), mqttErrorConnectResponse.Code); + } var error = response.ToObject(); return BuildErrorResponse(error); } @@ -141,7 +156,11 @@ public static HttpResponseMessage BuildValidResponse( { var states = GetStatesFromJson(response); var mergedStates = context.UpdateStates(states); - var formattedResponse = JsonConvert.SerializeObject(response.ToObject()); + var formattedResponse = context switch + { + MqttConnectionContext => JsonConvert.SerializeObject(response.ToObject()), + _ => JsonConvert.SerializeObject(response.ToObject()) + }; return BuildConnectEventResponse(formattedResponse, mergedStates); } if (requestType == RequestType.User) @@ -227,6 +246,8 @@ public static bool IsValidationRequest(this HttpRequestMessage req, out List $"{hub}.{type}.{eventName}.{clientProtocol}"; + private static Dictionary GetStatesFromJson(JObject response) { if (response.TryGetValue("states", out var val)) @@ -241,5 +262,10 @@ private static Dictionary GetStatesFromJson(JObject response // We don't support clear states for JS return new Dictionary(); } + + private static MqttConnectEventErrorResponse ToMqttConnectErrorResponse(JObject jObject) + { + return jObject.ToObject(); + } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubConnectionAttribute.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubConnectionAttribute.cs index 18d3b9a76c75f..5dc6b970c12ea 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubConnectionAttribute.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubConnectionAttribute.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. using System; - +using Azure.Messaging.WebPubSub; using Microsoft.Azure.WebJobs.Description; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub @@ -31,5 +31,10 @@ public class WebPubSubConnectionAttribute : Attribute /// [AutoResolve] public string UserId { get; set; } + + /// + /// The client protocol. + /// + public WebPubSubClientProtocol ClientProtocol { get; set; } = WebPubSubClientProtocol.Default; } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubTriggerAcceptedClientProtocolJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubTriggerAcceptedClientProtocolJsonConverter.cs new file mode 100644 index 0000000000000..a2697c0f8c55b --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubTriggerAcceptedClientProtocolJsonConverter.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub; + +internal class WebPubSubTriggerAcceptedClientProtocolsJsonConverter : JsonConverter +{ + private static readonly JsonSerializer JsonSerializer = JsonSerializer.Create(new JsonSerializerSettings + { + Converters = new[] + { + new StringEnumConverter() + } + }); + + public override WebPubSubTriggerAcceptedClientProtocols ReadJson(JsonReader reader, Type objectType, WebPubSubTriggerAcceptedClientProtocols existingValue, bool hasExistingValue, JsonSerializer serializer) => JsonSerializer.Deserialize(reader); + + public override void WriteJson(JsonWriter writer, WebPubSubTriggerAcceptedClientProtocols value, JsonSerializer serializer) => JsonSerializer.Serialize(writer, value); +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Common/TestHelpers.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Common/TestHelpers.cs index 5624571b10f14..71334341dde52 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Common/TestHelpers.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Common/TestHelpers.cs @@ -7,6 +7,7 @@ using System.Net.Http; using System.Net.Http.Headers; using System.Text; +using Azure.Messaging.WebPubSub; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; using Microsoft.Azure.WebJobs.Host.Config; @@ -90,7 +91,9 @@ public static HttpRequestMessage CreateHttpRequestMessage( string httpMethod = "Post", string[] origin = null, string userId = "testuser", - byte[] payload = null) + byte[] payload = null, + string[] subProtocols = null, + WebPubSubClientProtocol clientProtocol = WebPubSubClientProtocol.Default) { var context = new HttpRequestMessage() { @@ -110,6 +113,20 @@ public static HttpRequestMessage CreateHttpRequestMessage( context.Headers.Add(Constants.Headers.CloudEvents.UserId, userId); } + if (subProtocols != null) + { + context.Headers.Add(Constants.Headers.CloudEvents.Subprotocol, subProtocols); + } + + if (clientProtocol == WebPubSubClientProtocol.Mqtt) + { + context.Headers.Add(Constants.Headers.CloudEvents.MqttPhysicalConnectionId, "physicalConnectionId"); + if (type != WebPubSubEventType.System || eventName != "connect") + { + context.Headers.Add(Constants.Headers.CloudEvents.MqttSessionId, "sessionId"); + } + } + if (payload != null) { context.Content = new StreamContent(new MemoryStream(payload)); diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/JobHostEndToEndTests.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/JobHostEndToEndTests.cs index 69826489522b3..d972729699a11 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/JobHostEndToEndTests.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/JobHostEndToEndTests.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using Azure.Messaging.WebPubSub; using Microsoft.AspNetCore.Http; using Microsoft.Azure.WebJobs.Host; using Microsoft.Azure.WebJobs.Host.Indexers; @@ -53,6 +54,8 @@ public async Task TestWebPubSubInputBinding() var host = TestHelpers.NewHost(typeof(WebPubSubFuncs), configuration: FuncConfiguration); await host.GetJobHost().CallAsync("WebPubSubFuncs.TestWebPubSubInputConnection"); + + await host.GetJobHost().CallAsync("WebPubSubFuncs.TestMqttInputConnection"); } [TestCase] @@ -109,6 +112,12 @@ public static void TestWebPubSubInputConnection( // Valid case use default url for verification. Assert.AreEqual("wss://abc/client/hubs/chat", connection.BaseUri.AbsoluteUri); } + public static void TestMqttInputConnection( + [WebPubSubConnection(Hub = "chat", UserId = "aaa", ClientProtocol = WebPubSubClientProtocol.Mqtt)] WebPubSubConnection connection) + { + // Valid case use default url for verification. + Assert.AreEqual("wss://abc/clients/mqtt/hubs/chat", connection.BaseUri.AbsoluteUri); + } public static async Task TestWebPubSubOutput( [WebPubSub(Hub = "chat")] IAsyncCollector operation) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSub.Tests.csproj b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSub.Tests.csproj index 40096cdab766c..95e6ae9ee0fab 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSub.Tests.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSub.Tests.csproj @@ -19,6 +19,7 @@ + diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/WebPubSubTriggerDispatcherTests.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/WebPubSubTriggerDispatcherTests.cs index f4c7386a8acec..a7757b85c9789 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/WebPubSubTriggerDispatcherTests.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/WebPubSubTriggerDispatcherTests.cs @@ -1,14 +1,19 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. +using System; +using System.Collections.Generic; +using System.Linq; using System.Net; using System.Text; using System.Threading; using System.Threading.Tasks; +using Azure.Messaging.WebPubSub; using Microsoft.Azure.WebJobs.Host.Executors; using Microsoft.Azure.WebPubSub.Common; using Microsoft.Extensions.Logging.Abstractions; using Moq; +using Newtonsoft.Json; using NUnit.Framework; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub.Tests @@ -123,9 +128,187 @@ public async Task TestProcessRequest_MessageMediaTypes(string mediaType, HttpSta Assert.AreEqual(expectedCode, response.StatusCode); } - private static WebPubSubTriggerDispatcher SetupDispatcher(string hub = TestHub, WebPubSubEventType type = TestType, string eventName = TestEvent, string connectionString = null) + private static IEnumerable TestHandleMqttConnectRequest_InProcessModelTestData = new object[][] { - var funcName = $"{hub}.{type}.{eventName}".ToLower(); + new object[]{ new MqttConnectEventResponse("userId",new string[] {"group1", "group2"}, new string[] {"webpubsub.joinLeaveGroup"}) { Mqtt = new() { UserProperties = new MqttUserProperty[] { new("a", "b") } } },5, HttpStatusCode.OK, "{\"mqtt\":{\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"code\":0,\"userId\":\"userId\",\"groups\":[\"group1\",\"group2\"],\"subprotocol\":\"mqtt\",\"roles\":[\"webpubsub.joinLeaveGroup\"]}"}, + new object[]{new MqttConnectEventErrorResponse(MqttV311ConnectReturnCode.NotAuthorized, "not authorized"),4, HttpStatusCode.Unauthorized, "{\"mqtt\":{\"code\":5,\"reason\":\"not authorized\",\"userProperties\":null}}", }, + new object[]{ CreateMqttConnectErrorResponse(MqttV500ConnectReasonCode.NotAuthorized, "not authorized", new MqttUserProperty[] {new MqttUserProperty("a", "b")}),5, HttpStatusCode.Unauthorized, "{\"mqtt\":{\"code\":135,\"reason\":\"not authorized\",\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]}}", } + }; + + private static MqttConnectEventErrorResponse CreateMqttConnectErrorResponse(MqttV500ConnectReasonCode reasonCode, string reason, MqttUserProperty[] userProperties) + { + var res = new MqttConnectEventErrorResponse(reasonCode, reason); + res.Mqtt.UserProperties = userProperties; + return res; + } + + [TestCaseSource(nameof(TestHandleMqttConnectRequest_InProcessModelTestData))] + public async Task TestHandleMqttConnectRequest_InProcessModel(WebPubSubEventResponse responseObj, int protocolVersion, HttpStatusCode expectedStatusCode, string expectedResponseBody) + { + var payload = "{\"mqtt\":{\"protocolVersion\":" + protocolVersion.ToString() + ",\"username\":\"username\",\"password\":\"password\",\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"claims\":{\"iat\":[\"1723005952\"],\"exp\":[\"1726605954\"],\"aud\":[\"ws://localhost:8080/clients/mqtt/hubs/simplechat\"],\"http://schemas.microsoft.com/ws/2008/06/identity/claims/role\":[\"webpubsub.sendToGroup\",\"webpubsub.joinLeaveGroup\"],\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier\":[\"user1\"],\"role\":[\"webpubsub.sendToGroup\",\"webpubsub.joinLeaveGroup\"],\"nameid\":[\"user1\"]},\"query\":{\"access_token\":[\"REDATED\"]},\"headers\":{\"Connection\":[\"Upgrade\"],\"Host\":[\"localhost:8080\"],\"Upgrade\":[\"websocket\"],\"Sec-WebSocket-Version\":[\"13\"],\"Sec-WebSocket-Key\":[\"REDATED\"],\"Sec-WebSocket-Extensions\":[\"permessage-deflate; client_max_window_bits\"],\"Sec-WebSocket-Protocol\":[\"mqtt\"]},\"subprotocols\":[\"mqtt\"],\"clientCertificates\":[{\"thumbprint\":\"thumbprint\",\"content\":\"certificate content\"}]}"; + var connectHttpRequest = TestHelpers.CreateHttpRequestMessage(TestHub, WebPubSubEventType.System, "connect", "clientId", ValidSignature, origin: new string[] { TestOrigin }, subProtocols: new string[] { "mqtt" }, clientProtocol: WebPubSubClientProtocol.Mqtt, payload: Encoding.UTF8.GetBytes(payload)); + connectHttpRequest.Headers.Add(Constants.Headers.CloudEvents.MqttPhysicalConnectionId, "physicalConnectionId"); + + var dispatcher = new WebPubSubTriggerDispatcher(NullLogger.Instance, new() { Hub = TestHub }); + var mockExecutor = new Mock(); + var wpsListener = new WebPubSubListener(mockExecutor.Object, Utilities.GetFunctionKey(TestHub, WebPubSubEventType.System, "connect", WebPubSubTriggerAcceptedClientProtocols.Mqtt), dispatcher, null); + await wpsListener.StartAsync(default); + mockExecutor.Setup(f => f.TryExecuteAsync(It.IsAny(), It.IsAny())) + .Callback((functionData, token) => + { + var triggerEvent = functionData.TriggerValue as WebPubSubTriggerEvent; + var mqttConnectEvent = triggerEvent.Request as MqttConnectEventRequest; + Assert.AreEqual("username", mqttConnectEvent.Mqtt.Username); + Assert.AreEqual("password", mqttConnectEvent.Mqtt.Password); + Assert.AreEqual("certificate content", mqttConnectEvent.ClientCertificates.First().Content); + Assert.AreEqual("thumbprint", mqttConnectEvent.ClientCertificates.First().Thumbprint); + Assert.AreEqual("a", mqttConnectEvent.Mqtt.UserProperties.First().Name); + Assert.AreEqual("b", mqttConnectEvent.Mqtt.UserProperties.First().Value); + Assert.AreEqual(protocolVersion, (int)mqttConnectEvent.Mqtt.ProtocolVersion); + var tcs = triggerEvent.TaskCompletionSource; + tcs.SetResult(responseObj); + }) + .Returns(Task.FromResult(new FunctionResult(true))); + var httpResponse = await dispatcher.ExecuteAsync(connectHttpRequest); + Assert.AreEqual(expectedStatusCode, httpResponse.StatusCode); + var actualBody = await httpResponse.Content.ReadAsStringAsync(); + Console.WriteLine(actualBody); + Assert.AreEqual(expectedResponseBody, actualBody); + } + + private static readonly IEnumerable TestHandleMqttConnectRequest_IsolatedProcessModelTestData = new object[][] + { + new object[]{ "{\"mqtt\":{\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"userId\":\"userId\",\"groups\":[\"group1\",\"group2\"],\"subprotocol\":\"mqtt\",\"roles\":[\"webpubsub.joinLeaveGroup\"]}", 5, HttpStatusCode.OK, "{\"mqtt\":{\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"code\":0,\"userId\":\"userId\",\"groups\":[\"group1\",\"group2\"],\"subprotocol\":\"mqtt\",\"roles\":[\"webpubsub.joinLeaveGroup\"]}"}, + new object[]{ "{\"mqtt\":{\"code\":5,\"reason\":\"not authorized\",\"userProperties\":null}}", 4, HttpStatusCode.Unauthorized, "{\"mqtt\":{\"code\":5,\"reason\":\"not authorized\",\"userProperties\":null}}", }, + new object[]{ "{\"mqtt\":{\"code\":135,\"reason\":\"reason\",\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"errorMessage\":\"reason\"}", 5, HttpStatusCode.Unauthorized, "{\"mqtt\":{\"code\":135,\"reason\":\"reason\",\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]}}", } + }; + + [TestCaseSource(nameof(TestHandleMqttConnectRequest_IsolatedProcessModelTestData))] + public async Task TestHandleMqttConnectRequest_IsolatedProcessModel(string responseBodyFromWorker, int actualProtocolVersion, HttpStatusCode expectedStatusCode, string expectedHttpResponseBody) + { + var payload = "{\"mqtt\":{\"protocolVersion\":" + actualProtocolVersion.ToString() + ",\"username\":\"username\",\"password\":\"password\",\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"claims\":{\"iat\":[\"1723005952\"],\"exp\":[\"1726605954\"],\"aud\":[\"ws://localhost:8080/clients/mqtt/hubs/simplechat\"],\"http://schemas.microsoft.com/ws/2008/06/identity/claims/role\":[\"webpubsub.sendToGroup\",\"webpubsub.joinLeaveGroup\"],\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier\":[\"user1\"],\"role\":[\"webpubsub.sendToGroup\",\"webpubsub.joinLeaveGroup\"],\"nameid\":[\"user1\"]},\"query\":{\"access_token\":[\"REDATED\"]},\"headers\":{\"Connection\":[\"Upgrade\"],\"Host\":[\"localhost:8080\"],\"Upgrade\":[\"websocket\"],\"Sec-WebSocket-Version\":[\"13\"],\"Sec-WebSocket-Key\":[\"REDATED\"],\"Sec-WebSocket-Extensions\":[\"permessage-deflate; client_max_window_bits\"],\"Sec-WebSocket-Protocol\":[\"mqtt\"]},\"subprotocols\":[\"mqtt\"],\"clientCertificates\":[{\"thumbprint\":\"thumbprint\",\"content\":\"certificate content\"}]}"; + var connectHttpRequest = TestHelpers.CreateHttpRequestMessage(TestHub, WebPubSubEventType.System, "connect", "clientId", ValidSignature, origin: new string[] { TestOrigin }, subProtocols: new string[] { "mqtt" }, clientProtocol: WebPubSubClientProtocol.Mqtt, payload: Encoding.UTF8.GetBytes(payload)); + connectHttpRequest.Headers.Add(Constants.Headers.CloudEvents.MqttPhysicalConnectionId, "physicalConnectionId"); + + var dispatcher = new WebPubSubTriggerDispatcher(NullLogger.Instance, new() { Hub = TestHub }); + var mockExecutor = new Mock(); + var wpsListener = new WebPubSubListener(mockExecutor.Object, Utilities.GetFunctionKey(TestHub, WebPubSubEventType.System, "connect", WebPubSubTriggerAcceptedClientProtocols.Mqtt), dispatcher, null); + await wpsListener.StartAsync(default); + mockExecutor.Setup(f => f.TryExecuteAsync(It.IsAny(), It.IsAny())) + .Callback((functionData, token) => + { + var triggeredEvent = functionData.TriggerValue as WebPubSubTriggerEvent; + var mqttConnectEvent = triggeredEvent.Request as MqttConnectEventRequest; + // Isolated process model uses Newtonsoft.Json to serialize the trigger value. + var serializerSettings = new JsonSerializerSettings + { + Converters = new List + { + new BinaryDataJsonConverter(), + new ConnectionStatesNewtonsoftConverter(), + new WebPubSubDataTypeJsonConverter(), + new WebPubSubEventTypeJsonConverter(), + }, + }; + Console.WriteLine(JsonConvert.SerializeObject(mqttConnectEvent, serializerSettings)); + Assert.AreEqual("{\"mqtt\":{\"protocolVersion\":" + actualProtocolVersion.ToString() + ",\"username\":\"username\",\"password\":\"password\",\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"claims\":{\"iat\":[\"1723005952\"],\"exp\":[\"1726605954\"],\"aud\":[\"ws://localhost:8080/clients/mqtt/hubs/simplechat\"],\"http://schemas.microsoft.com/ws/2008/06/identity/claims/role\":[\"webpubsub.sendToGroup\",\"webpubsub.joinLeaveGroup\"],\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier\":[\"user1\"],\"role\":[\"webpubsub.sendToGroup\",\"webpubsub.joinLeaveGroup\"],\"nameid\":[\"user1\"]},\"query\":{\"access_token\":[\"REDATED\"]},\"headers\":{\"Connection\":[\"Upgrade\"],\"Host\":[\"localhost:8080\"],\"Upgrade\":[\"websocket\"],\"Sec-WebSocket-Version\":[\"13\"],\"Sec-WebSocket-Key\":[\"REDATED\"],\"Sec-WebSocket-Extensions\":[\"permessage-deflate; client_max_window_bits\"],\"Sec-WebSocket-Protocol\":[\"mqtt\"]},\"subprotocols\":[\"mqtt\"],\"clientCertificates\":[{\"Thumbprint\":\"thumbprint\",\"content\":\"certificate content\"}],\"connectionContext\":{\"physicalConnectionId\":\"physicalConnectionId\",\"sessionId\":null,\"eventType\":\"System\",\"eventName\":\"connect\",\"hub\":\"testhub\",\"connectionId\":\"clientId\",\"userId\":\"testuser\",\"signature\":\"sha256=7767effcb3946f3e1de039df4b986ef02c110b1469d02c0a06f41b3b727ab561\",\"origin\":\"localhost\",\"states\":{},\"headers\":{\"ce-hub\":[\"testhub\"],\"ce-type\":[\"azure.webpubsub.sys.connect\"],\"ce-eventName\":[\"connect\"],\"ce-connectionId\":[\"clientId\"],\"ce-signature\":[\"sha256=7767effcb3946f3e1de039df4b986ef02c110b1469d02c0a06f41b3b727ab561\"],\"WebHook-Request-Origin\":[\"localhost\"],\"ce-userId\":[\"testuser\"],\"ce-subprotocol\":[\"mqtt\"],\"ce-physicalConnectionId\":[\"physicalConnectionId\",\"physicalConnectionId\"]}}}", JsonConvert.SerializeObject(mqttConnectEvent, serializerSettings)); + var tcs = triggeredEvent.TaskCompletionSource; + tcs.SetResult(JsonConvert.DeserializeObject(responseBodyFromWorker)); + }) + .Returns(Task.FromResult(new FunctionResult(true))); + var httpResponse = await dispatcher.ExecuteAsync(connectHttpRequest); + Assert.AreEqual(expectedStatusCode, httpResponse.StatusCode); + var actualBody = await httpResponse.Content.ReadAsStringAsync(); + Console.WriteLine(actualBody); + Assert.AreEqual(expectedHttpResponseBody, actualBody); + } + + [TestCase] + public async Task TestHandleMqttConnectedEvent() + { + var connectedRequest = TestHelpers.CreateHttpRequestMessage(TestHub, WebPubSubEventType.System, "connected", "clientId", ValidSignature, origin: new string[] { TestOrigin }, subProtocols: new string[] { "mqtt" }, clientProtocol: WebPubSubClientProtocol.Mqtt); + connectedRequest.Headers.Add(Constants.Headers.CloudEvents.MqttPhysicalConnectionId, "physicalConnectionId"); + connectedRequest.Headers.Add(Constants.Headers.CloudEvents.MqttSessionId, "sessionId"); + var dispatcher = new WebPubSubTriggerDispatcher(NullLogger.Instance, new() { Hub = TestHub }); + var mockExecutor = new Mock(); + var wpsListener = new WebPubSubListener(mockExecutor.Object, Utilities.GetFunctionKey(TestHub, WebPubSubEventType.System, "connected", WebPubSubTriggerAcceptedClientProtocols.Mqtt), dispatcher, null); + await wpsListener.StartAsync(default); + mockExecutor.Setup(f => f.TryExecuteAsync(It.IsAny(), It.IsAny())) + .Callback((functionData, token) => + { + var triggerEvent = (functionData.TriggerValue as WebPubSubTriggerEvent); + if (triggerEvent.ConnectionContext is MqttConnectionContext mqttContext) + { + Assert.AreEqual("physicalConnectionId", mqttContext.PhysicalConnectionId); + Assert.AreEqual("sessionId", mqttContext.SessionId); + Assert.AreEqual("clientId", mqttContext.ConnectionId); + } + else + { + Assert.Fail("ConnectionContext is not MqttContext"); + } + + var tcs = triggerEvent.TaskCompletionSource; + tcs.SetResult(null); + WebPubSubConfigProvider.RegisterJsonConverter(); + + // Make sure the serialization of MqttConnectedEventRequest is correct, used in isolated-process models. + var expected = "{\"connectionContext\":{\"physicalConnectionId\":\"physicalConnectionId\",\"sessionId\":\"sessionId\",\"eventType\":\"System\",\"eventName\":\"connected\",\"hub\":\"testhub\",\"connectionId\":\"clientId\",\"userId\":\"testuser\",\"signature\":\"sha256=7767effcb3946f3e1de039df4b986ef02c110b1469d02c0a06f41b3b727ab561\",\"origin\":\"localhost\",\"states\":{},\"headers\":{\"ce-hub\":[\"testhub\"],\"ce-type\":[\"azure.webpubsub.sys.connected\"],\"ce-eventName\":[\"connected\"],\"ce-connectionId\":[\"clientId\"],\"ce-signature\":[\"sha256=7767effcb3946f3e1de039df4b986ef02c110b1469d02c0a06f41b3b727ab561\"],\"WebHook-Request-Origin\":[\"localhost\"],\"ce-userId\":[\"testuser\"],\"ce-subprotocol\":[\"mqtt\"],\"ce-physicalConnectionId\":[\"physicalConnectionId\",\"physicalConnectionId\"],\"ce-sessionId\":[\"sessionId\",\"sessionId\"]}}}"; + Assert.AreEqual(expected, JsonConvert.SerializeObject(triggerEvent.Request)); + }) + .Returns(Task.FromResult(new FunctionResult(true))); + var httpResponse = await dispatcher.ExecuteAsync(connectedRequest); + } + + [TestCase] + public async Task TestHandleMqttDisonnectedEvent() + { + var body = " {\"mqtt\":{\"initiatedByClient\":false,\"disconnectPacket\":{\"code\":128,\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]}},\"reason\":\"reason\",\"connectionContext\":null}"; + var disconnectedRequest = TestHelpers.CreateHttpRequestMessage(TestHub, WebPubSubEventType.System, "disconnected", "clientId", ValidSignature, origin: new string[] { TestOrigin }, subProtocols: new string[] { "mqtt" }, clientProtocol: WebPubSubClientProtocol.Mqtt, payload: Encoding.UTF8.GetBytes(body)); + disconnectedRequest.Headers.Add(Constants.Headers.CloudEvents.MqttPhysicalConnectionId, "physicalConnectionId"); + disconnectedRequest.Headers.Add(Constants.Headers.CloudEvents.MqttSessionId, "sessionId"); + var dispatcher = new WebPubSubTriggerDispatcher(NullLogger.Instance, new() { Hub = TestHub }); + var mockExecutor = new Mock(); + var wpsListener = new WebPubSubListener(mockExecutor.Object, Utilities.GetFunctionKey(TestHub, WebPubSubEventType.System, "disconnected", WebPubSubTriggerAcceptedClientProtocols.Mqtt), dispatcher, null); + await wpsListener.StartAsync(default); + mockExecutor.Setup(f => f.TryExecuteAsync(It.IsAny(), It.IsAny())) + .Callback((functionData, token) => + { + var triggerEvent = (functionData.TriggerValue as WebPubSubTriggerEvent); + if (triggerEvent.ConnectionContext is MqttConnectionContext mqttContext) + { + Assert.AreEqual("physicalConnectionId", mqttContext.PhysicalConnectionId); + Assert.AreEqual("sessionId", mqttContext.SessionId); + Assert.AreEqual("clientId", mqttContext.ConnectionId); + } + else + { + Assert.Fail("ConnectionContext is not MqttContext"); + } + + Assert.IsInstanceOf(triggerEvent.Request); + var mqttDisconnectedEvent = triggerEvent.Request as MqttDisconnectedEventRequest; + Assert.AreEqual("reason", mqttDisconnectedEvent.Reason); + Assert.AreEqual(false, mqttDisconnectedEvent.Mqtt.InitiatedByClient); + Assert.AreEqual(128, (int)mqttDisconnectedEvent.Mqtt.DisconnectPacket.Code); + Assert.AreEqual("a", mqttDisconnectedEvent.Mqtt.DisconnectPacket.UserProperties.First().Name); + Assert.AreEqual("b", mqttDisconnectedEvent.Mqtt.DisconnectPacket.UserProperties.First().Value); + + var tcs = triggerEvent.TaskCompletionSource; + tcs.SetResult(null); + + // Make sure the serialization of MqttConnectedEventRequest is correct, used in isolated-process models. + WebPubSubConfigProvider.RegisterJsonConverter(); + var expected = "{\"mqtt\":{\"initiatedByClient\":false,\"disconnectPacket\":{\"code\":128,\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]}},\"reason\":\"reason\",\"connectionContext\":{\"physicalConnectionId\":\"physicalConnectionId\",\"sessionId\":\"sessionId\",\"eventType\":\"System\",\"eventName\":\"disconnected\",\"hub\":\"testhub\",\"connectionId\":\"clientId\",\"userId\":\"testuser\",\"signature\":\"sha256=7767effcb3946f3e1de039df4b986ef02c110b1469d02c0a06f41b3b727ab561\",\"origin\":\"localhost\",\"states\":{},\"headers\":{\"ce-hub\":[\"testhub\"],\"ce-type\":[\"azure.webpubsub.sys.disconnected\"],\"ce-eventName\":[\"disconnected\"],\"ce-connectionId\":[\"clientId\"],\"ce-signature\":[\"sha256=7767effcb3946f3e1de039df4b986ef02c110b1469d02c0a06f41b3b727ab561\"],\"WebHook-Request-Origin\":[\"localhost\"],\"ce-userId\":[\"testuser\"],\"ce-subprotocol\":[\"mqtt\"],\"ce-physicalConnectionId\":[\"physicalConnectionId\",\"physicalConnectionId\"],\"ce-sessionId\":[\"sessionId\",\"sessionId\"]}}}"; + Assert.AreEqual(expected, JsonConvert.SerializeObject(triggerEvent.Request)); + }) + .Returns(Task.FromResult(new FunctionResult(true))); + var httpResponse = await dispatcher.ExecuteAsync(disconnectedRequest); + } + + private static WebPubSubTriggerDispatcher SetupDispatcher(string hub = TestHub, WebPubSubEventType type = TestType, string eventName = TestEvent, string connectionString = null, WebPubSubTriggerAcceptedClientProtocols clientProtocol = WebPubSubTriggerAcceptedClientProtocols.All) + { + var funcName = Utilities.GetFunctionKey(hub, type, eventName, clientProtocol).ToLower(); var wpsOptions = new WebPubSubFunctionsOptions { ConnectionString = connectionString diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/CHANGELOG.md b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/CHANGELOG.md index 52e001fdd848a..b13c6aab7809e 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/CHANGELOG.md +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/CHANGELOG.md @@ -1,14 +1,10 @@ # Release History -## 1.3.0-beta.1 (Unreleased) +## 1.3.0 (2024-09-04) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Support MQTT event handlers. +- Add `Content` field in `WebPubSubClientCertificate` to carry over client certificate content. ## 1.2.0 (2022-10-31) diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/api/Microsoft.Azure.WebPubSub.Common.netstandard2.0.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/api/Microsoft.Azure.WebPubSub.Common.netstandard2.0.cs index 9b048dcab47a7..0014d59c36c60 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/api/Microsoft.Azure.WebPubSub.Common.netstandard2.0.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/api/Microsoft.Azure.WebPubSub.Common.netstandard2.0.cs @@ -1,11 +1,11 @@ namespace Microsoft.Azure.WebPubSub.Common { - public sealed partial class ConnectedEventRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest + public partial class ConnectedEventRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest { public ConnectedEventRequest(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext context) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext)) { } } [System.Runtime.Serialization.DataContractAttribute] - public sealed partial class ConnectEventRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest + public partial class ConnectEventRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest { public ConnectEventRequest(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext context, System.Collections.Generic.IReadOnlyDictionary claims, System.Collections.Generic.IReadOnlyDictionary query, System.Collections.Generic.IEnumerable subprotocols, System.Collections.Generic.IEnumerable certificates) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext)) { } public ConnectEventRequest(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext context, System.Collections.Generic.IReadOnlyDictionary claims, System.Collections.Generic.IReadOnlyDictionary query, System.Collections.Generic.IEnumerable subprotocols, System.Collections.Generic.IEnumerable certificates, System.Collections.Generic.IReadOnlyDictionary headers) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext)) { } @@ -24,7 +24,7 @@ public ConnectEventRequest(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionC [System.Runtime.Serialization.DataMemberAttribute(Name="subprotocols")] [System.Text.Json.Serialization.JsonPropertyNameAttribute("subprotocols")] public System.Collections.Generic.IReadOnlyList Subprotocols { get { throw null; } } - public Microsoft.Azure.WebPubSub.Common.EventErrorResponse CreateErrorResponse(Microsoft.Azure.WebPubSub.Common.WebPubSubErrorCode code, string message) { throw null; } + public virtual Microsoft.Azure.WebPubSub.Common.EventErrorResponse CreateErrorResponse(Microsoft.Azure.WebPubSub.Common.WebPubSubErrorCode code, string message) { throw null; } public Microsoft.Azure.WebPubSub.Common.ConnectEventResponse CreateResponse(string userId, System.Collections.Generic.IEnumerable groups, string subprotocol, System.Collections.Generic.IEnumerable roles) { throw null; } } [System.Runtime.Serialization.DataContractAttribute] @@ -55,7 +55,7 @@ public void SetState(string key, System.BinaryData value) { } public void SetState(string key, object value) { } } [System.Runtime.Serialization.DataContractAttribute] - public sealed partial class DisconnectedEventRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest + public partial class DisconnectedEventRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest { public DisconnectedEventRequest(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext context, string reason) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext)) { } [System.Runtime.Serialization.DataMemberAttribute(Name="reason")] @@ -77,6 +77,210 @@ public EventErrorResponse(Microsoft.Azure.WebPubSub.Common.WebPubSubErrorCode co public string ErrorMessage { get { throw null; } set { } } } [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttConnectEventErrorResponse : Microsoft.Azure.WebPubSub.Common.EventErrorResponse + { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public MqttConnectEventErrorResponse(Microsoft.Azure.WebPubSub.Common.MqttConnectEventErrorResponseProperties mqtt) { } + public MqttConnectEventErrorResponse(Microsoft.Azure.WebPubSub.Common.MqttV311ConnectReturnCode code, string? reason) { } + public MqttConnectEventErrorResponse(Microsoft.Azure.WebPubSub.Common.MqttV500ConnectReasonCode code, string? reason) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="mqtt")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("mqtt")] + public Microsoft.Azure.WebPubSub.Common.MqttConnectEventErrorResponseProperties Mqtt { get { throw null; } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttConnectEventErrorResponseProperties + { + public MqttConnectEventErrorResponseProperties(Microsoft.Azure.WebPubSub.Common.MqttV311ConnectReturnCode code) { } + public MqttConnectEventErrorResponseProperties(Microsoft.Azure.WebPubSub.Common.MqttV500ConnectReasonCode code) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="code")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("code")] + public int Code { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="reason")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("reason")] + public string? Reason { get { throw null; } set { } } + [System.Runtime.Serialization.DataMemberAttribute(Name="userProperties")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("userProperties")] + public System.Collections.Generic.IReadOnlyList? UserProperties { get { throw null; } set { } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttConnectEventRequest : Microsoft.Azure.WebPubSub.Common.ConnectEventRequest + { + public MqttConnectEventRequest(Microsoft.Azure.WebPubSub.Common.MqttConnectionContext context, System.Collections.Generic.IReadOnlyDictionary claims, System.Collections.Generic.IReadOnlyDictionary query, System.Collections.Generic.IEnumerable certificates, System.Collections.Generic.IReadOnlyDictionary headers, Microsoft.Azure.WebPubSub.Common.MqttConnectProperties mqtt) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext), default(System.Collections.Generic.IReadOnlyDictionary), default(System.Collections.Generic.IReadOnlyDictionary), default(System.Collections.Generic.IEnumerable), default(System.Collections.Generic.IEnumerable)) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="mqtt")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("mqtt")] + public Microsoft.Azure.WebPubSub.Common.MqttConnectProperties Mqtt { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override Microsoft.Azure.WebPubSub.Common.EventErrorResponse CreateErrorResponse(Microsoft.Azure.WebPubSub.Common.WebPubSubErrorCode code, string? message = null) { throw null; } + public Microsoft.Azure.WebPubSub.Common.MqttConnectEventResponse CreateMqttResponse(string userId, System.Collections.Generic.IEnumerable groups, System.Collections.Generic.IEnumerable roles) { throw null; } + public Microsoft.Azure.WebPubSub.Common.MqttConnectEventErrorResponse CreateMqttV311ErrorResponse(Microsoft.Azure.WebPubSub.Common.MqttV311ConnectReturnCode code, string? message = null) { throw null; } + public Microsoft.Azure.WebPubSub.Common.MqttConnectEventErrorResponse CreateMqttV50ErrorResponse(Microsoft.Azure.WebPubSub.Common.MqttV500ConnectReasonCode code, string? message = null) { throw null; } + } + [System.Runtime.Serialization.DataContractAttribute] + public sealed partial class MqttConnectEventResponse : Microsoft.Azure.WebPubSub.Common.ConnectEventResponse + { + public MqttConnectEventResponse() { } + public MqttConnectEventResponse(string? userId, System.Collections.Generic.IEnumerable? groups, System.Collections.Generic.IEnumerable? roles) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="mqtt")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("mqtt")] + public Microsoft.Azure.WebPubSub.Common.MqttConnectEventResponseProperties? Mqtt { get { throw null; } set { } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttConnectEventResponseProperties + { + public MqttConnectEventResponseProperties() { } + [System.Runtime.Serialization.DataMemberAttribute(Name="userProperties")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("userProperties")] + public System.Collections.Generic.IReadOnlyList? UserProperties { get { throw null; } set { } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttConnectionContext : Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext + { + public MqttConnectionContext(Microsoft.Azure.WebPubSub.Common.WebPubSubEventType eventType, string eventName, string hub, string connectionId, string physicalConnectionId, string? sessionId, string? userId = null, string? signature = null, string? origin = null, System.Collections.Generic.IReadOnlyDictionary? connectionStates = null, System.Collections.Generic.IReadOnlyDictionary? headers = null) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubEventType), default(string), default(string), default(string), default(string), default(string), default(string), default(System.Collections.Generic.IReadOnlyDictionary), default(System.Collections.Generic.IReadOnlyDictionary)) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="physicalConnectionId")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("physicalConnectionId")] + public string PhysicalConnectionId { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="sessionId")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("sessionId")] + public string? SessionId { get { throw null; } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttConnectProperties + { + internal MqttConnectProperties() { } + [System.Runtime.Serialization.DataMemberAttribute(Name="password")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("password")] + public string? Password { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="protocolVersion")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("protocolVersion")] + public Microsoft.Azure.WebPubSub.Common.MqttProtocolVersion ProtocolVersion { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="username")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("username")] + public string? Username { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="userProperties")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("userProperties")] + public System.Collections.Generic.IReadOnlyList? UserProperties { get { throw null; } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttDisconnectedEventRequest : Microsoft.Azure.WebPubSub.Common.DisconnectedEventRequest + { + public MqttDisconnectedEventRequest(Microsoft.Azure.WebPubSub.Common.MqttConnectionContext context, string reason, Microsoft.Azure.WebPubSub.Common.MqttDisconnectedEventRequestProperties mqtt) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext), default(string)) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="mqtt")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("mqtt")] + public Microsoft.Azure.WebPubSub.Common.MqttDisconnectedEventRequestProperties Mqtt { get { throw null; } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttDisconnectedEventRequestProperties + { + internal MqttDisconnectedEventRequestProperties() { } + [System.Runtime.Serialization.DataMemberAttribute(Name="disconnectPacket")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("disconnectPacket")] + public Microsoft.Azure.WebPubSub.Common.MqttDisconnectPacketProperties? DisconnectPacket { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="initiatedByClient")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("initiatedByClient")] + public bool InitiatedByClient { get { throw null; } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttDisconnectPacketProperties + { + internal MqttDisconnectPacketProperties() { } + [System.Runtime.Serialization.DataMemberAttribute(Name="code")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("code")] + public Microsoft.Azure.WebPubSub.Common.MqttDisconnectReasonCode Code { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="userProperties")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("userProperties")] + public System.Collections.Generic.IReadOnlyList? UserProperties { get { throw null; } } + } + public enum MqttDisconnectReasonCode : byte + { + NormalDisconnection = (byte)0, + DisconnectWithWillMessage = (byte)4, + UnspecifiedError = (byte)128, + MalformedPacket = (byte)129, + ProtocolError = (byte)130, + ImplementationSpecificError = (byte)131, + NotAuthorized = (byte)135, + ServerBusy = (byte)137, + ServerShuttingDown = (byte)139, + KeepAliveTimeout = (byte)141, + SessionTakenOver = (byte)142, + TopicFilterInvalid = (byte)143, + TopicNameInvalid = (byte)144, + ReceiveMaximumExceeded = (byte)147, + TopicAliasInvalid = (byte)148, + PacketTooLarge = (byte)149, + MessageRateTooHigh = (byte)150, + QuotaExceeded = (byte)151, + AdministrativeAction = (byte)152, + PayloadFormatInvalid = (byte)153, + RetainNotSupported = (byte)154, + QosNotSupported = (byte)155, + UseAnotherServer = (byte)156, + ServerMoved = (byte)157, + SharedSubscriptionsNotSupported = (byte)158, + ConnectionRateExceeded = (byte)159, + MaximumConnectTime = (byte)160, + SubscriptionIdentifiersNotSupported = (byte)161, + WildcardSubscriptionsNotSupported = (byte)162, + } + public enum MqttProtocolVersion + { + V311 = 4, + V500 = 5, + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttUserProperty : System.IEquatable + { + protected MqttUserProperty(Microsoft.Azure.WebPubSub.Common.MqttUserProperty original) { } + public MqttUserProperty(string name, string value) { } + protected virtual System.Type EqualityContract { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="name")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("name")] + public string Name { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="value")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("value")] + public string Value { get { throw null; } } + public virtual bool Equals(Microsoft.Azure.WebPubSub.Common.MqttUserProperty? other) { throw null; } + public override bool Equals(object? obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Microsoft.Azure.WebPubSub.Common.MqttUserProperty? left, Microsoft.Azure.WebPubSub.Common.MqttUserProperty? right) { throw null; } + public static bool operator !=(Microsoft.Azure.WebPubSub.Common.MqttUserProperty? left, Microsoft.Azure.WebPubSub.Common.MqttUserProperty? right) { throw null; } + protected virtual bool PrintMembers(System.Text.StringBuilder builder) { throw null; } + public override string ToString() { throw null; } + public virtual Microsoft.Azure.WebPubSub.Common.MqttUserProperty $() { throw null; } + } + public enum MqttV311ConnectReturnCode : byte + { + UnacceptableProtocolVersion = (byte)1, + IdentifierRejected = (byte)2, + ServerUnavailable = (byte)3, + BadUsernameOrPassword = (byte)4, + NotAuthorized = (byte)5, + } + public enum MqttV500ConnectReasonCode : byte + { + UnspecifiedError = (byte)128, + MalformedPacket = (byte)129, + ProtocolError = (byte)130, + ImplementationSpecificError = (byte)131, + UnsupportedProtocolVersion = (byte)132, + ClientIdentifierNotValid = (byte)133, + BadUserNameOrPassword = (byte)134, + NotAuthorized = (byte)135, + ServerUnavailable = (byte)136, + ServerBusy = (byte)137, + Banned = (byte)138, + BadAuthenticationMethod = (byte)140, + TopicNameInvalid = (byte)144, + PacketTooLarge = (byte)149, + QuotaExceeded = (byte)151, + PayloadFormatInvalid = (byte)153, + RetainNotSupported = (byte)154, + QosNotSupported = (byte)155, + UseAnotherServer = (byte)156, + ServerMoved = (byte)157, + ConnectionRateExceeded = (byte)159, + } + [System.Runtime.Serialization.DataContractAttribute] public sealed partial class PreflightRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest { public PreflightRequest(bool isValid) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext)) { } @@ -122,9 +326,15 @@ public void SetState(string key, System.BinaryData value) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public void SetState(string key, object value) { } } + [System.Runtime.Serialization.DataContractAttribute] public sealed partial class WebPubSubClientCertificate { public WebPubSubClientCertificate(string thumbprint) { } + public WebPubSubClientCertificate(string thumbprint, string? content) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="content")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("content")] + public string? Content { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute] [System.Text.Json.Serialization.JsonPropertyNameAttribute("thumbprint")] public string Thumbprint { get { throw null; } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/ContributionHints.md b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/ContributionHints.md new file mode 100644 index 0000000000000..76e2464989942 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/ContributionHints.md @@ -0,0 +1,28 @@ +# Contribution Hints + +This file provides some hints for contributing to the Microsoft.Azure.WebPubSub.Common library. + +## JSON serialization and deserialization + +The main purpose of this project is to provide classes for JSON serialization and deserialization to the Azure Functions extensions and the `AspNetCore` project. + +```mermaid +sequenceDiagram + participant W as Web PubSub Service + participant H as Functions Extensions (Host Process) + participant WP as Functions Extensions (Worker Process) + + W->>H: Send HTTP Request + H->>H: Deserialize HTTP Request using System.Text.Json + + H->>H: Serialize HTTP Request Body Object using Newtonsoft.Json + H->>WP: Send JSON requests + WP->>WP: Process Request in Worker Process + + WP->>H: Return JSON responses + H->>H: Deserialize JSON Response using Newtonsoft.Json + H->>H: Serialize into HTTP response using Newtonsoft.Json + H->>W: Send HTTP Response +``` + +Currently all the classes for CloudEvents requests have customized JSON converters or customized deserialization classes. This is because in .NET framework, `System.Text.Json` cannot support deserialization of classes without a pameterless constructor. Therefore we need to customize the deserialization of these classes. \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttConnectPropertiesJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttConnectPropertiesJsonConverter.cs new file mode 100644 index 0000000000000..6217fea32f6f5 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttConnectPropertiesJsonConverter.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +internal class MqttConnectPropertiesJsonConverter : JsonConverter +{ + public override MqttConnectProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + MqttProtocolVersion? protocolVersion = null; + string? username = null; + string? password = null; + IReadOnlyList? userProperties = null; + + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType == JsonTokenType.PropertyName) + { + var propertyName = reader.GetString(); + reader.Read(); + + switch (propertyName) + { + case MqttConnectProperties.ProtocolVersionProperty: + protocolVersion = JsonSerializer.Deserialize(ref reader, options); + break; + + case MqttConnectProperties.UsernameProperty: + username = reader.GetString(); + break; + + case MqttConnectProperties.PasswordProperty: + password = reader.GetString(); + break; + + case MqttConnectProperties.UserPropertiesProperty: + userProperties = JsonSerializer.Deserialize>(ref reader, options); + break; + + default: + reader.Skip(); + break; + } + } + } + + // Ensure that the required properties are present + if (protocolVersion == null) + { + throw new JsonException($"Missing required property '{MqttConnectProperties.ProtocolVersionProperty}'."); + } + + return new MqttConnectProperties(protocolVersion.Value, username, password, userProperties); + } + + public override void Write(Utf8JsonWriter writer, MqttConnectProperties value, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectPacketPropertiesJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectPacketPropertiesJsonConverter.cs new file mode 100644 index 0000000000000..295ba99b4ce91 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectPacketPropertiesJsonConverter.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +internal class MqttDisconnectPacketPropertiesJsonConverter : JsonConverter +{ + public override MqttDisconnectPacketProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + MqttDisconnectReasonCode? code = null; + IReadOnlyList? userProperties = null; + + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType == JsonTokenType.PropertyName) + { + var propertyName = reader.GetString(); + reader.Read(); + + switch (propertyName) + { + case MqttDisconnectPacketProperties.CodeProperty: + code = JsonSerializer.Deserialize(ref reader, options); + break; + + case MqttDisconnectPacketProperties.UserPropertiesProperty: + userProperties = JsonSerializer.Deserialize>(ref reader, options); + break; + + default: + reader.Skip(); + break; + } + } + } + + // Ensure that the required 'code' property is present + if (code == null) + { + throw new JsonException($"Missing required property '{MqttDisconnectPacketProperties.CodeProperty}'."); + } + + return new MqttDisconnectPacketProperties(code.Value, userProperties); + } + + public override void Write(Utf8JsonWriter writer, MqttDisconnectPacketProperties value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + + writer.WritePropertyName(MqttDisconnectPacketProperties.CodeProperty); + JsonSerializer.Serialize(writer, value.Code, options); + + if (value.UserProperties != null) + { + writer.WritePropertyName(MqttDisconnectPacketProperties.UserPropertiesProperty); + JsonSerializer.Serialize(writer, value.UserProperties, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectedEventRequestPropertiesJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectedEventRequestPropertiesJsonConverter.cs new file mode 100644 index 0000000000000..fd971db282764 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectedEventRequestPropertiesJsonConverter.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +internal class MqttDisconnectedEventRequestPropertiesJsonConverter : JsonConverter +{ + public override MqttDisconnectedEventRequestProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + bool? initiatedByClient = null; + MqttDisconnectPacketProperties? disconnectPacket = null; + + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType == JsonTokenType.PropertyName) + { + var propertyName = reader.GetString(); + reader.Read(); + + switch (propertyName) + { + case MqttDisconnectedEventRequestProperties.InitiatedByClientProperty: + initiatedByClient = reader.GetBoolean(); + break; + + case MqttDisconnectedEventRequestProperties.DisconnectPacketProperty: + disconnectPacket = JsonSerializer.Deserialize(ref reader, options); + break; + + default: + reader.Skip(); + break; + } + } + } + + // Ensure that the required 'initiatedByClient' property is present + if (initiatedByClient == null) + { + throw new JsonException($"Missing required property '{MqttDisconnectedEventRequestProperties.InitiatedByClientProperty}'."); + } + + return new MqttDisconnectedEventRequestProperties(initiatedByClient.Value, disconnectPacket); + } + + public override void Write(Utf8JsonWriter writer, MqttDisconnectedEventRequestProperties value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + + writer.WritePropertyName(MqttDisconnectedEventRequestProperties.InitiatedByClientProperty); + writer.WriteBooleanValue(value.InitiatedByClient); + + if (value.DisconnectPacket != null) + { + writer.WritePropertyName(MqttDisconnectedEventRequestProperties.DisconnectPacketProperty); + JsonSerializer.Serialize(writer, value.DisconnectPacket, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttUserPropertyJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttUserPropertyJsonConverter.cs new file mode 100644 index 0000000000000..0bd5861fd7a7c --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttUserPropertyJsonConverter.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +internal class MqttUserPropertyJsonConverter : JsonConverter +{ + public override MqttUserProperty Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException(); + } + + string name = null; + string value = null; + + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException(); + } + + var propertyName = reader.GetString(); + reader.Read(); + + switch (propertyName) + { + case MqttUserProperty.NamePropertyName: + name = reader.GetString(); + break; + case MqttUserProperty.ValuePropertyName: + value = reader.GetString(); + break; + default: + reader.Skip(); + break; + } + } + + return new MqttUserProperty(name, value); + } + + public override void Write(Utf8JsonWriter writer, MqttUserProperty value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + + writer.WriteString(MqttUserProperty.NamePropertyName, value.Name); + writer.WriteString(MqttUserProperty.ValuePropertyName, value.Value); + + writer.WriteEndObject(); + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/WebPubSubClientCertificateJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/WebPubSubClientCertificateJsonConverter.cs index 5a9f2bfb8cce9..c8db1a8a77e9f 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/WebPubSubClientCertificateJsonConverter.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/WebPubSubClientCertificateJsonConverter.cs @@ -5,25 +5,65 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Microsoft.Azure.WebPubSub.Common +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +internal class WebPubSubClientCertificateJsonConverter : JsonConverter { - internal class WebPubSubClientCertificateJsonConverter : JsonConverter + public override WebPubSubClientCertificate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - public override WebPubSubClientCertificate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + string? thumbprint = null; + string? content = null; + + while (reader.Read()) { - using var jsonDocument = JsonDocument.ParseValue(ref reader); - var element = jsonDocument.RootElement; + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType == JsonTokenType.PropertyName) + { + var propertyName = reader.GetString(); + reader.Read(); + + switch (propertyName) + { + case WebPubSubClientCertificate.ThumbprintProperty: + thumbprint = reader.GetString(); + break; + + case WebPubSubClientCertificate.ContentProperty: + content = reader.GetString(); + break; - return new WebPubSubClientCertificate( - element.ReadString(WebPubSubClientCertificate.ThumbprintProperty)); + default: + reader.Skip(); + break; + } + } } - public override void Write(Utf8JsonWriter writer, WebPubSubClientCertificate value, JsonSerializerOptions options) + // Ensure that the required 'thumbprint' property is present + if (thumbprint == null) + { + throw new JsonException($"Missing required property '{WebPubSubClientCertificate.ThumbprintProperty}'."); + } + + return new WebPubSubClientCertificate(thumbprint, content); + } + + public override void Write(Utf8JsonWriter writer, WebPubSubClientCertificate value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(WebPubSubClientCertificate.ThumbprintProperty); + JsonSerializer.Serialize(writer, value.Thumbprint, options); + if (value.Content != null) { - writer.WriteStartObject(); - writer.WritePropertyName(WebPubSubClientCertificate.ThumbprintProperty); - JsonSerializer.Serialize(writer, value.Thumbprint, options); - writer.WriteEndObject(); + writer.WritePropertyName(WebPubSubClientCertificate.ContentProperty); + JsonSerializer.Serialize(writer, value.Content, options); } + writer.WriteEndObject(); } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Microsoft.Azure.WebPubSub.Common.csproj b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Microsoft.Azure.WebPubSub.Common.csproj index e3a00eea2950e..562be6698b4f3 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Microsoft.Azure.WebPubSub.Common.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Microsoft.Azure.WebPubSub.Common.csproj @@ -2,9 +2,8 @@ Azure SDK Common object library for the WebPubSub service Azure SDK Common for WebPubSub - 1.3.0-beta.1 + 1.3.0 - 1.2.0 Azure, WebPubSub netstandard2.0 $(RequiredTargetFrameworks) diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventErrorResponseProperties.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventErrorResponseProperties.cs new file mode 100644 index 0000000000000..2ffc56712071a --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventErrorResponseProperties.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// Represents the properties of an MQTT connection failure response. +/// +[DataContract] +public class MqttConnectEventErrorResponseProperties +{ + internal const string CodeProperty = "code"; + internal const string ReasonProperty = "reason"; + internal const string UserPropertiesProperty = "userProperties"; + /// + /// The failure code. It will be sent to the clients in the CONNACK packet as a return code (MQTT 3.1.1) or reason code (MQTT 5.0). Upstream webhook should select a valid integer value defined the MQTT protocols according to the protocol versions of the clients. If Upstream webhook sets an invalid value, clients will receive "unspecified error" in the CONNACK packet. + /// + [DataMember(Name = CodeProperty)] + [JsonPropertyName(CodeProperty)] + public int Code + { + get; + } + + /// + /// The reason for the failure. It's a human readable failure reason string designed for diagnostics. It will be sent to those clients whose protocols support reason string in the CONNACK packet. Now only MQTT 5.0 supports it. + /// + [DataMember(Name = ReasonProperty)] + [JsonPropertyName(ReasonProperty)] + public string? Reason { get; set; } + + /// + /// The user properties in the response. + /// + [DataMember(Name = UserPropertiesProperty)] + [JsonPropertyName(UserPropertiesProperty)] + public IReadOnlyList? UserProperties { get; set; } + + /// + /// Creates a new instance of . + /// + /// + public MqttConnectEventErrorResponseProperties(MqttV500ConnectReasonCode code) + { + Code = (int)code; + } + + /// + /// Creates a new instance of . + /// + /// + public MqttConnectEventErrorResponseProperties(MqttV311ConnectReturnCode code) + { + Code = (int)code; + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventResponseProperties.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventResponseProperties.cs new file mode 100644 index 0000000000000..b2a119d6f583f --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventResponseProperties.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// Represents the MQTT specific properties in a successful MQTT connection event response. +/// +[DataContract] +public class MqttConnectEventResponseProperties +{ + internal const string UserPropertiesProperty = "userProperties"; + + /// + /// It's additional diagnostic or other information provided by upstream server. They'll be converted to the user properties field in the CONNACK packet, and sent to clients whose protocols support user properties. Now only MQTT 5.0 supports user properties. Upstream webhook can use the property to communicate additional diagnostic or other information with clients. + /// + [DataMember(Name = UserPropertiesProperty)] + [JsonPropertyName(UserPropertiesProperty)] + public IReadOnlyList? UserProperties { get; set; } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectProperties.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectProperties.cs new file mode 100644 index 0000000000000..a181229559522 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectProperties.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable enable + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// The properties of the MQTT CONNECT packet. +/// +[DataContract] +[JsonConverter(typeof(MqttConnectPropertiesJsonConverter))] +public class MqttConnectProperties +{ + internal const string ProtocolVersionProperty = "protocolVersion"; + internal const string UsernameProperty = "username"; + internal const string PasswordProperty = "password"; + internal const string UserPropertiesProperty = "userProperties"; + + /// + /// Creates a new instance of . + /// + /// + /// + /// + /// + internal MqttConnectProperties(MqttProtocolVersion protocolVersion, string? username, string? password, IReadOnlyList? userProperties) + { + ProtocolVersion = protocolVersion; + Username = username; + Password = password; + UserProperties = userProperties; + } + + /// + /// MQTT protocol version. + /// + [JsonPropertyName(ProtocolVersionProperty)] + [DataMember(Name = ProtocolVersionProperty)] + public MqttProtocolVersion ProtocolVersion { get; } + + /// + /// The username field in the MQTT CONNECT packet. + /// + [JsonPropertyName(UsernameProperty)] + [DataMember(Name = UsernameProperty)] + public string? Username { get; } + + /// + ///The password field in the MQTT CONNECT packet. + /// Use string type instead of byte[] to avoid the problem of serialization. + /// Although System.Text.Json serializes byte[] to base64 string by default, it is not explicitly documented. + /// + [JsonPropertyName(PasswordProperty)] + [DataMember(Name = PasswordProperty)] + public string? Password { get; } + + /// + /// The user properties in the MQTT CONNECT packet. + /// + [JsonPropertyName(UserPropertiesProperty)] + [DataMember(Name = UserPropertiesProperty)] + public IReadOnlyList? UserProperties { get; } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectPacketProperties.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectPacketProperties.cs new file mode 100644 index 0000000000000..8f8f423dec1fb --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectPacketProperties.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// Represents the properties of an MQTT DISCONNECT packet. +/// +[DataContract] +[JsonConverter(typeof(MqttDisconnectPacketPropertiesJsonConverter))] +public class MqttDisconnectPacketProperties +{ + internal const string CodeProperty = "code"; + internal const string UserPropertiesProperty = "userProperties"; + + /// + /// Creates a new instance of . + /// + /// + /// + internal MqttDisconnectPacketProperties(MqttDisconnectReasonCode code, IReadOnlyList? userProperties) + { + Code = code; + UserProperties = userProperties; + } + + /// + /// The DISCONNECT reason code defined in MQTT 5.0 spec. + /// For MQTT 3.1.1 clients, it's always the default value 0. + /// + [JsonPropertyName(CodeProperty)] + [DataMember(Name = CodeProperty)] + public MqttDisconnectReasonCode Code { get; } + + /// + /// The user properties in the DISCONNECT packet sent by the client. The value is not null only if the client sent a DISCONNECT packet with user properties. + /// + [DataMember(Name = UserPropertiesProperty)] + [JsonPropertyName(UserPropertiesProperty)] + public IReadOnlyList? UserProperties { get; } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectReasonCode.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectReasonCode.cs new file mode 100644 index 0000000000000..fdbd228502ee1 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectReasonCode.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// MQTT Disconnect Reason Codes +/// These codes represent the reasons for disconnecting an MQTT client as per MQTT 5.0 specification. +/// +public enum MqttDisconnectReasonCode : byte +{ + /// + /// 0x00 - Normal disconnection + /// Sent by: Client or Server + /// Description: Close the connection normally. Do not send the Will Message. + /// + NormalDisconnection = 0x00, + + /// + /// 0x04 - Disconnect with Will Message + /// Sent by: Client + /// Description: The Client wishes to disconnect but requires that the Server also publishes its Will Message. + /// + DisconnectWithWillMessage = 0x04, + + /// + /// 0x80 - Unspecified error + /// Sent by: Client or Server + /// Description: The Connection is closed but the sender either does not wish to reveal the reason, or none of the other Reason Codes apply. + /// + UnspecifiedError = 0x80, + + /// + /// 0x81 - Malformed Packet + /// Sent by: Client or Server + /// Description: The received packet does not conform to this specification. + /// + MalformedPacket = 0x81, + + /// + /// 0x82 - Protocol Error + /// Sent by: Client or Server + /// Description: An unexpected or out of order packet was received. + /// + ProtocolError = 0x82, + + /// + /// 0x83 - Implementation specific error + /// Sent by: Client or Server + /// Description: The packet received is valid but cannot be processed by this implementation. + /// + ImplementationSpecificError = 0x83, + + /// + /// 0x87 - Not authorized + /// Sent by: Server + /// Description: The request is not authorized. + /// + NotAuthorized = 0x87, + + /// + /// 0x89 - Server busy + /// Sent by: Server + /// Description: The Server is busy and cannot continue processing requests from this Client. + /// + ServerBusy = 0x89, + + /// + /// 0x8B - Server shutting down + /// Sent by: Server + /// Description: The Server is shutting down. + /// + ServerShuttingDown = 0x8B, + + /// + /// 0x8D - Keep Alive timeout + /// Sent by: Server + /// Description: The Connection is closed because no packet has been received for 1.5 times the Keepalive time. + /// + KeepAliveTimeout = 0x8D, + + /// + /// 0x8E - Session taken over + /// Sent by: Server + /// Description: Another Connection using the same ClientID has connected causing this Connection to be closed. + /// + SessionTakenOver = 0x8E, + + /// + /// 0x8F - Topic Filter invalid + /// Sent by: Server + /// Description: The Topic Filter is correctly formed, but is not accepted by this Server. + /// + TopicFilterInvalid = 0x8F, + + /// + /// 0x90 - Topic Name invalid + /// Sent by: Client or Server + /// Description: The Topic Name is correctly formed, but is not accepted by this Client or Server. + /// + TopicNameInvalid = 0x90, + + /// + /// 0x93 - Receive Maximum exceeded + /// Sent by: Client or Server + /// Description: The Client or Server has received more than Receive Maximum publication for which it has not sent PUBACK or PUBCOMP. + /// + ReceiveMaximumExceeded = 0x93, + + /// + /// 0x94 - Topic Alias invalid + /// Sent by: Client or Server + /// Description: The Client or Server has received a PUBLISH packet containing a Topic Alias which is greater than the Maximum Topic Alias it sent in the CONNECT or CONNACK packet. + /// + TopicAliasInvalid = 0x94, + + /// + /// 0x95 - Packet too large + /// Sent by: Client or Server + /// Description: The packet size is greater than Maximum Packet Size for this Client or Server. + /// + PacketTooLarge = 0x95, + + /// + /// 0x96 - Message rate too high + /// Sent by: Client or Server + /// Description: The received data rate is too high. + /// + MessageRateTooHigh = 0x96, + + /// + /// 0x97 - Quota exceeded + /// Sent by: Client or Server + /// Description: An implementation or administrative imposed limit has been exceeded. + /// + QuotaExceeded = 0x97, + + /// + /// 0x98 - Administrative action + /// Sent by: Client or Server + /// Description: The Connection is closed due to an administrative action. + /// + AdministrativeAction = 0x98, + + /// + /// 0x99 - Payload format invalid + /// Sent by: Client or Server + /// Description: The payload format does not match the one specified by the Payload Format Indicator. + /// + PayloadFormatInvalid = 0x99, + + /// + /// 0x9A - Retain not supported + /// Sent by: Server + /// Description: The Server does not support retained messages. + /// + RetainNotSupported = 0x9A, + + /// + /// 0x9B - QoS not supported + /// Sent by: Server + /// Description: The Client specified a QoS greater than the QoS specified in a Maximum QoS in the CONNACK. + /// + QosNotSupported = 0x9B, + + /// + /// 0x9C - Use another server + /// Sent by: Server + /// Description: The Client should temporarily change its Server. + /// + UseAnotherServer = 0x9C, + + /// + /// 0x9D - Server moved + /// Sent by: Server + /// Description: The Server is moved and the Client should permanently change its server location. + /// + ServerMoved = 0x9D, + + /// + /// 0x9E - Shared Subscriptions not supported + /// Sent by: Server + /// Description: The Server does not support Shared Subscriptions. + /// + SharedSubscriptionsNotSupported = 0x9E, + + /// + /// 0x9F - Connection rate exceeded + /// Sent by: Server + /// Description: This connection is closed because the connection rate is too high. + /// + ConnectionRateExceeded = 0x9F, + + /// + /// 0xA0 - Maximum connect time + /// Sent by: Server + /// Description: The maximum connection time authorized for this connection has been exceeded. + /// + MaximumConnectTime = 0xA0, + + /// + /// 0xA1 - Subscription Identifiers not supported + /// Sent by: Server + /// Description: The Server does not support Subscription Identifiers; the subscription is not accepted. + /// + SubscriptionIdentifiersNotSupported = 0xA1, + + /// + /// 0xA2 - Wildcard Subscriptions not supported + /// Sent by: Server + /// Description: The Server does not support Wildcard Subscriptions; the subscription is not accepted. + /// + WildcardSubscriptionsNotSupported = 0xA2 +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectedEventRequestProperties.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectedEventRequestProperties.cs new file mode 100644 index 0000000000000..dac49cfda88d5 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectedEventRequestProperties.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// Represents the properties of an MQTT disconnection event. +/// +[DataContract] +[JsonConverter(typeof(MqttDisconnectedEventRequestPropertiesJsonConverter))] +public class MqttDisconnectedEventRequestProperties +{ + internal const string InitiatedByClientProperty = "initiatedByClient"; + internal const string DisconnectPacketProperty = "disconnectPacket"; + + /// + /// Indicates whether the disconnection is initiated by the client. + /// + [DataMember(Name = InitiatedByClientProperty)] + [JsonPropertyName(InitiatedByClientProperty)] + public bool InitiatedByClient { get; } + + /// + ///The DISCONNECT packet properties to end the last physical connection. It may be sent by the client or server. + /// + [DataMember(Name = DisconnectPacketProperty)] + [JsonPropertyName(DisconnectPacketProperty)] + public MqttDisconnectPacketProperties? DisconnectPacket { get; } + + /// + /// Creates an instance of . + /// + /// + /// + internal MqttDisconnectedEventRequestProperties(bool initiatedByClient, MqttDisconnectPacketProperties? disconnectPacket) + { + InitiatedByClient = initiatedByClient; + DisconnectPacket = disconnectPacket; + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttProtocolVersion.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttProtocolVersion.cs new file mode 100644 index 0000000000000..55a2935ecba3b --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttProtocolVersion.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// MQTT protocol versions supported by Web PubSub service. +/// +public enum MqttProtocolVersion +{ + /// + /// MQTT 3.1.1 + /// + V311 = 4, + + /// + /// MQTT 5.0 + /// + V500 = 5 +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttUserProperty.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttUserProperty.cs new file mode 100644 index 0000000000000..3bc918276d0ce --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttUserProperty.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// A class representing a user property in MQTT. +/// +[DataContract] +[JsonConverter(typeof(MqttUserPropertyJsonConverter))] +public record MqttUserProperty +{ + internal const string NamePropertyName = "name"; + internal const string ValuePropertyName = "value"; + + /// + /// Creates a new instance of . + /// + /// + /// + public MqttUserProperty(string name, string value) + { + Name = name; + Value = value; + } + + /// + /// The name of the property. + /// + [DataMember(Name = NamePropertyName)] + [JsonPropertyName(NamePropertyName)] + public string Name { get; } + + /// + /// The value of the property. + /// + [DataMember(Name = ValuePropertyName)] + [JsonPropertyName(ValuePropertyName)] + public string Value { get; } +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV311ConnectReturnCode.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV311ConnectReturnCode.cs new file mode 100644 index 0000000000000..6cdf5c099bbf6 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV311ConnectReturnCode.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// MQTT 3.1.1 Connect Return Codes. +/// +public enum MqttV311ConnectReturnCode : byte +{ + /// + /// 0x01: Connection refused, unacceptable protocol version + /// The Server does not support the level of the MQTT protocol requested by the Client. + /// + UnacceptableProtocolVersion = 0x01, + + /// + /// 0x02: Connection refused, identifier rejected + /// The Client identifier is correct UTF-8 but not allowed by the Server. + /// + IdentifierRejected = 0x02, + + /// + /// 0x03: Connection refused, server unavailable + /// The Network Connection has been made but the MQTT service is unavailable. + /// + ServerUnavailable = 0x03, + + /// + /// 0x04: Connection refused, bad user name or password + /// The data in the user name or password is malformed. + /// + BadUsernameOrPassword = 0x04, + + /// + /// 0x05: Connection refused, not authorized + /// The Client is not authorized to connect. + /// + NotAuthorized = 0x05, +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV500ConnectReasonCode.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV500ConnectReasonCode.cs new file mode 100644 index 0000000000000..a35b3f21cc17b --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV500ConnectReasonCode.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// MQTT Connect Reason Codes +/// These codes represent the reasons for the outcome of an MQTT CONNECT packet as per MQTT 5.0 specification. +/// +public enum MqttV500ConnectReasonCode : byte +{ + /// + /// 0x80 - Unspecified error + /// Description: The Server does not wish to reveal the reason for the failure, or none of the other Reason Codes apply. + /// + UnspecifiedError = 0x80, + + /// + /// 0x81 - Malformed Packet + /// Description: Data within the CONNECT packet could not be correctly parsed. + /// + MalformedPacket = 0x81, + + /// + /// 0x82 - Protocol Error + /// Description: Data in the CONNECT packet does not conform to this specification. + /// + ProtocolError = 0x82, + + /// + /// 0x83 - Implementation specific error + /// Description: The CONNECT is valid but is not accepted by this Server. + /// + ImplementationSpecificError = 0x83, + + /// + /// 0x84 - Unsupported Protocol Version + /// Description: The Server does not support the version of the MQTT protocol requested by the Client. + /// + UnsupportedProtocolVersion = 0x84, + + /// + /// 0x85 - Client Identifier not valid + /// Description: The Client Identifier is a valid string but is not allowed by the Server. + /// + ClientIdentifierNotValid = 0x85, + + /// + /// 0x86 - Bad User Name or Password + /// Description: The Server does not accept the User Name or Password specified by the Client. + /// + BadUserNameOrPassword = 0x86, + + /// + /// 0x87 - Not authorized + /// Description: The Client is not authorized to connect. + /// + NotAuthorized = 0x87, + + /// + /// 0x88 - Server unavailable + /// Description: The MQTT Server is not available. + /// + ServerUnavailable = 0x88, + + /// + /// 0x89 - Server busy + /// Description: The Server is busy. Try again later. + /// + ServerBusy = 0x89, + + /// + /// 0x8A - Banned + /// Description: This Client has been banned by administrative action. Contact the server administrator. + /// + Banned = 0x8A, + + /// + /// 0x8C - Bad authentication method + /// Description: The authentication method is not supported or does not match the authentication method currently in use. + /// + BadAuthenticationMethod = 0x8C, + + /// + /// 0x90 - Topic Name invalid + /// Description: The Will Topic Name is not malformed, but is not accepted by this Server. + /// + TopicNameInvalid = 0x90, + + /// + /// 0x95 - Packet too large + /// Description: The CONNECT packet exceeded the maximum permissible size. + /// + PacketTooLarge = 0x95, + + /// + /// 0x97 - Quota exceeded + /// Description: An implementation or administrative imposed limit has been exceeded. + /// + QuotaExceeded = 0x97, + + /// + /// 0x99 - Payload format invalid + /// Description: The Will Payload does not match the specified Payload Format Indicator. + /// + PayloadFormatInvalid = 0x99, + + /// + /// 0x9A - Retain not supported + /// Description: The Server does not support retained messages, and Will Retain was set to 1. + /// + RetainNotSupported = 0x9A, + + /// + /// 0x9B - QoS not supported + /// Description: The Server does not support the QoS set in Will QoS. + /// + QosNotSupported = 0x9B, + + /// + /// 0x9C - Use another server + /// Description: The Client should temporarily use another server. + /// + UseAnotherServer = 0x9C, + + /// + /// 0x9D - Server moved + /// Description: The Client should permanently use another server. + /// + ServerMoved = 0x9D, + + /// + /// 0x9F - Connection rate exceeded + /// Description: The connection rate limit has been exceeded. + /// + ConnectionRateExceeded = 0x9F +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/MqttConnectionContext.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/MqttConnectionContext.cs new file mode 100644 index 0000000000000..e6976d218ce0b --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/MqttConnectionContext.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// MQTT Request context from headers following CloudEvents. +/// +[DataContract] +public class MqttConnectionContext : WebPubSubConnectionContext +{ + internal const string PhysicalConnectionIdProperty = "physicalConnectionId"; + internal const string SessionIdProperty = "sessionId"; + + /// + /// The unique identifier generated by the service of the network connection. + /// + [JsonPropertyName(PhysicalConnectionIdProperty)] + [DataMember(Name = PhysicalConnectionIdProperty)] + public string PhysicalConnectionId { get; } + + /// + /// The unique identifier generated by the service of the MQTT session. + /// + [JsonPropertyName(SessionIdProperty)] + [DataMember(Name = SessionIdProperty)] + public string? SessionId { get; } + + /// + /// The MQTT connection context contains the CloudEvents headers under Web PubSub protocol. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public MqttConnectionContext(WebPubSubEventType eventType, string eventName, string hub, string connectionId, string physicalConnectionId, string? sessionId, string? userId = null, string? signature = null, string? origin = null, IReadOnlyDictionary? connectionStates = null, IReadOnlyDictionary? headers = null) : base(eventType, eventName, hub, connectionId, userId, signature, origin, connectionStates, headers) + { + PhysicalConnectionId = physicalConnectionId; + SessionId = sessionId; + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectEventRequest.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectEventRequest.cs index 5adeee257987a..0e6e4644be804 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectEventRequest.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectEventRequest.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.WebPubSub.Common /// [DataContract] [JsonConverter(typeof(ConnectEventRequestJsonConverter))] - public sealed class ConnectEventRequest : WebPubSubEventRequest + public class ConnectEventRequest : WebPubSubEventRequest { internal const string ClaimsProperty = "claims"; internal const string QueryProperty = "query"; @@ -76,7 +76,7 @@ public ConnectEventResponse CreateResponse(string userId, IEnumerable gr /// . /// Detail error message. /// A error response to return caller and will drop connection. - public EventErrorResponse CreateErrorResponse(WebPubSubErrorCode code, string message) + public virtual EventErrorResponse CreateErrorResponse(WebPubSubErrorCode code, string message) { return new EventErrorResponse(code, message); } diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectedEventRequest.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectedEventRequest.cs index 4d8fe966c1be6..6a80e9c559774 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectedEventRequest.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectedEventRequest.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.WebPubSub.Common /// /// ServiceRequest for connected event. /// - public sealed class ConnectedEventRequest : WebPubSubEventRequest + public class ConnectedEventRequest : WebPubSubEventRequest { /// /// The connected event request diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/DisconnectedEventRequest.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/DisconnectedEventRequest.cs index 35fc9a9e0b5b4..8936bd7bcf987 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/DisconnectedEventRequest.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/DisconnectedEventRequest.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.WebPubSub.Common /// [DataContract] [JsonConverter(typeof(DisconnectedEventRequestJsonConverter))] - public sealed class DisconnectedEventRequest : WebPubSubEventRequest + public class DisconnectedEventRequest : WebPubSubEventRequest { internal const string ReasonProperty = "reason"; diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttConnectEventRequest.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttConnectEventRequest.cs new file mode 100644 index 0000000000000..36f0500e16485 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttConnectEventRequest.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable enable + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// MQTT Connect event request. It's sent when a MQTT client connects to the service. +/// +[DataContract] +public class MqttConnectEventRequest : ConnectEventRequest +{ + internal const string MqttPropertyName = "mqtt"; + private static readonly string[] MqttWebSocketSubprotocol = new string[] { "mqtt" }; + + /// + /// Creates a new instance of . + /// + /// + /// + /// + /// + /// + /// + public MqttConnectEventRequest(MqttConnectionContext context, IReadOnlyDictionary claims, IReadOnlyDictionary query, IEnumerable certificates, IReadOnlyDictionary headers, MqttConnectProperties mqtt) : base(context, claims, query, MqttWebSocketSubprotocol, certificates, headers) + { + Mqtt = mqtt; + } + + /// + /// The properties of the MQTT CONNECT packet. + /// + [DataMember(Name = MqttPropertyName)] + [JsonPropertyName(MqttPropertyName)] + public MqttConnectProperties Mqtt { get; } + + /// + /// Create with general Web PubSub error code. + /// + /// . + /// Detail error message. + /// A error response to return caller and will drop connection. + [EditorBrowsable(EditorBrowsableState.Never)] + public override EventErrorResponse CreateErrorResponse(WebPubSubErrorCode code, string? message = null) + { + return Mqtt.ProtocolVersion switch + { + MqttProtocolVersion.V311 => new MqttConnectEventErrorResponse(code.ToMqttV311ConnectReturnCode(), message), + MqttProtocolVersion.V500 => new MqttConnectEventErrorResponse(code.ToMqttV500ConnectReasonCode(), message), + _ => throw new ArgumentOutOfRangeException($"MQTT protocol version {Mqtt.ProtocolVersion} is invalid.") + }; + } + + /// + /// Create . + /// + /// Caller userId for current connection. + /// User roles applied to current connection. + /// Groups applied to current connection. + /// A connect response to return service. + public MqttConnectEventResponse CreateMqttResponse(string userId, IEnumerable groups, IEnumerable roles) + { + return new MqttConnectEventResponse(userId, groups, roles); + } + + /// + /// Creates error response for MQTT protocol 5.0. + /// + /// + /// + /// A error response to return caller and will drop connection. + public MqttConnectEventErrorResponse CreateMqttV50ErrorResponse(MqttV500ConnectReasonCode code, string? message = null) + { + if (Mqtt.ProtocolVersion != MqttProtocolVersion.V500) + { + throw new InvalidOperationException("The MQTT protocol version of the client is not 5.0."); + } + return new MqttConnectEventErrorResponse(code, message); + } + + /// + /// Creates error response for MQTT protocol 3.1.1. + /// + /// + /// + /// A error response to return caller and will drop connection. + public MqttConnectEventErrorResponse CreateMqttV311ErrorResponse(MqttV311ConnectReturnCode code, string? message = null) + { + if (Mqtt.ProtocolVersion != MqttProtocolVersion.V311) + { + throw new InvalidOperationException("The MQTT protocol version of the client is not 3.1.1."); + } + return new MqttConnectEventErrorResponse(code, message); + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttDisconnectedEventRequest.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttDisconnectedEventRequest.cs new file mode 100644 index 0000000000000..1599b78588c33 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttDisconnectedEventRequest.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// Represents the response of an MQTT connection failure. +/// +[DataContract] +public class MqttDisconnectedEventRequest : DisconnectedEventRequest +{ + internal const string MqttProperty = "mqtt"; + + /// + /// Creates a new instance of . + /// + /// + /// + /// + public MqttDisconnectedEventRequest(MqttConnectionContext context, string reason, MqttDisconnectedEventRequestProperties mqtt) : base(context, reason) + { + Mqtt = mqtt; + } + + /// + /// Represents the properties of an MQTT disconnection event request. + /// + [DataMember(Name = MqttProperty)] + [JsonPropertyName(MqttProperty)] + public MqttDisconnectedEventRequestProperties Mqtt { get; } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventErrorResponse.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventErrorResponse.cs new file mode 100644 index 0000000000000..6a799dd252ca1 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventErrorResponse.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ComponentModel; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// Represents the response properties of an MQTT connection failure. +/// +[DataContract] +public class MqttConnectEventErrorResponse : EventErrorResponse +{ + internal const string MqttProperty = "mqtt"; + + /// + /// Represents the properties of an MQTT connection failure response. + /// + [DataMember(Name = MqttProperty)] + [JsonPropertyName(MqttProperty)] + public MqttConnectEventErrorResponseProperties Mqtt + { + get; + } + + /// + /// Creates an instance of . + /// + public MqttConnectEventErrorResponse(MqttV500ConnectReasonCode code, string? reason) : base(WebPubSubErrorCodeExtensions.FromMqttV500ConnectReasonCode(code), reason) + { + Mqtt = new MqttConnectEventErrorResponseProperties(code) + { + Reason = reason + }; + } + + /// + /// Creates an instance of . + /// + public MqttConnectEventErrorResponse(MqttV311ConnectReturnCode code, string? reason) : base(WebPubSubErrorCodeExtensions.FromMqttV311ConnectReturnCode(code), reason) + { + Mqtt = new MqttConnectEventErrorResponseProperties(code) + { + Reason = reason + }; + } + + /// + /// Default constructor for JsonSerialize. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public MqttConnectEventErrorResponse(MqttConnectEventErrorResponseProperties mqtt) + { + Mqtt = mqtt; + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventResponse.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventResponse.cs new file mode 100644 index 0000000000000..fe0c3f18b26c2 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventResponse.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +#nullable enable + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// Successful response for MQTT connect event. +/// +[DataContract] +public sealed class MqttConnectEventResponse : ConnectEventResponse +{ + internal const string MqttWebSocketSubprotocolHeaderValue = "mqtt"; + internal const string MqttProperty = "mqtt"; + + /// + /// Default constructor for JsonSerialize. + /// + public MqttConnectEventResponse() + { + } + + /// + /// Creates a new instance of . + /// + /// + /// + /// + public MqttConnectEventResponse(string? userId, IEnumerable? groups, IEnumerable? roles) : base(userId, groups, MqttWebSocketSubprotocolHeaderValue, roles) + { + } + + /// + /// Represents the MQTT specific properties in a successful MQTT connection event response. + /// + [JsonPropertyName(MqttProperty)] + [DataMember(Name = MqttProperty)] + public MqttConnectEventResponseProperties? Mqtt { get; set; } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventErrorResponseContent.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventErrorResponseContent.cs new file mode 100644 index 0000000000000..88f71a962d15c --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventErrorResponseContent.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +internal class MqttConnectEventErrorResponseContent : MqttConnectEventErrorResponse +{ + public MqttConnectEventErrorResponseContent(MqttConnectEventErrorResponsePropertiesContent mqtt) : base(new MqttConnectEventErrorResponseProperties((MqttV500ConnectReasonCode)mqtt.Code)) + { + Mqtt.Reason = mqtt.Reason; + Mqtt.UserProperties = mqtt.UserProperties; + // Set the proper WebPubSubErrorCode + if (mqtt.Code < 0x80) + { + // MQTT 3.1.1 + Code = WebPubSubErrorCodeExtensions.FromMqttV311ConnectReturnCode((MqttV311ConnectReturnCode)mqtt.Code); + } + else + { + // MQTT 5.0 + Code = WebPubSubErrorCodeExtensions.FromMqttV500ConnectReasonCode((MqttV500ConnectReasonCode)mqtt.Code); + } + } +} + +internal class MqttConnectEventErrorResponsePropertiesContent : MqttConnectEventErrorResponseProperties +{ + public MqttConnectEventErrorResponsePropertiesContent(int code, string? reason, IReadOnlyList? userProperties) : base((MqttV500ConnectReasonCode)code) + { + Reason = reason; + UserProperties = userProperties; + } +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventRequestContent.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventRequestContent.cs new file mode 100644 index 0000000000000..fd70a67980cf9 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventRequestContent.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// Class to represent the request body of MqttConnectEvent for Newtonsoft.JSON deserialization. +/// contains a field "ConnectionContext", which is not available during deserialization. Use a subclass to avoid a customized JSON converter./> +/// +internal class MqttConnectEventRequestContent +{ + internal const string ClaimsProperty = "claims"; + internal const string QueryProperty = "query"; + internal const string HeadersProperty = "headers"; + internal const string SubprotocolsProperty = "subprotocols"; + internal const string ClientCertificatesProperty = "clientCertificates"; + internal const string MqttPropertyName = "mqtt"; + + /// + /// User Claims. + /// + [JsonPropertyName(ClaimsProperty)] + [DataMember(Name = ClaimsProperty)] + public IReadOnlyDictionary Claims { get; set; } + + /// + /// Request query. + /// + [JsonPropertyName(QueryProperty)] + [DataMember(Name = QueryProperty)] + public IReadOnlyDictionary Query { get; set; } + + /// + /// Request headers. + /// + [JsonPropertyName(HeadersProperty)] + [DataMember(Name = HeadersProperty)] + public IReadOnlyDictionary Headers { get; set; } + + /// + /// Supported subprotocols. + /// + [JsonPropertyName(SubprotocolsProperty)] + [DataMember(Name = SubprotocolsProperty)] + public IReadOnlyList Subprotocols { get; set; } + + /// + /// Client certificates. + /// + [JsonPropertyName(ClientCertificatesProperty)] + [DataMember(Name = ClientCertificatesProperty)] + public IReadOnlyList ClientCertificates { get; set; } + + /// + /// The properties of the MQTT CONNECT packet. + /// + [DataMember(Name = MqttPropertyName)] + [JsonPropertyName(MqttPropertyName)] + public MqttConnectProperties Mqtt { get; set; } +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttDisconnectedEventRequestContent.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttDisconnectedEventRequestContent.cs new file mode 100644 index 0000000000000..16547c332b761 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttDisconnectedEventRequestContent.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +internal class MqttDisconnectedEventRequestContent +{ + [JsonPropertyName("reason")] + public string Reason { get; set; } + + [JsonPropertyName("mqtt")] + public MqttDisconnectedEventRequestProperties Mqtt { get; set; } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/WebPubSubErrorCodeExtensions.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/WebPubSubErrorCodeExtensions.cs new file mode 100644 index 0000000000000..130a3a0adcddd --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/WebPubSubErrorCodeExtensions.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Microsoft.Azure.WebPubSub.Common; + +internal static class WebPubSubErrorCodeExtensions +{ + public static MqttV311ConnectReturnCode ToMqttV311ConnectReturnCode(this WebPubSubErrorCode code) + { + return code switch + { + WebPubSubErrorCode.Unauthorized => MqttV311ConnectReturnCode.NotAuthorized, + WebPubSubErrorCode.UserError => MqttV311ConnectReturnCode.BadUsernameOrPassword, + WebPubSubErrorCode.ServerError => MqttV311ConnectReturnCode.ServerUnavailable, + _ => throw new ArgumentOutOfRangeException(nameof(code), code, null) + }; + } + + public static MqttV500ConnectReasonCode ToMqttV500ConnectReasonCode(this WebPubSubErrorCode code) + { + return code switch + { + WebPubSubErrorCode.Unauthorized => MqttV500ConnectReasonCode.NotAuthorized, + WebPubSubErrorCode.UserError => MqttV500ConnectReasonCode.BadUserNameOrPassword, + WebPubSubErrorCode.ServerError => MqttV500ConnectReasonCode.ServerUnavailable, + _ => throw new ArgumentOutOfRangeException(nameof(code), code, null) + }; + } + + public static WebPubSubErrorCode FromMqttV311ConnectReturnCode(MqttV311ConnectReturnCode code) + { + return code switch + { + //MqttV311ConnectReturnCode.ConnectionAccepted => throw new ArgumentOutOfRangeException(nameof(code), $"MQTT 'ConnectionAccepted' return code cannot be converted to a Web PubSub error code."), + MqttV311ConnectReturnCode.UnacceptableProtocolVersion => WebPubSubErrorCode.UserError, + MqttV311ConnectReturnCode.IdentifierRejected => WebPubSubErrorCode.UserError, + MqttV311ConnectReturnCode.ServerUnavailable => WebPubSubErrorCode.ServerError, + MqttV311ConnectReturnCode.BadUsernameOrPassword => WebPubSubErrorCode.UserError, + MqttV311ConnectReturnCode.NotAuthorized => WebPubSubErrorCode.Unauthorized, + _ => throw new ArgumentOutOfRangeException(nameof(code), code, null) + }; + } + + public static WebPubSubErrorCode FromMqttV500ConnectReasonCode(this MqttV500ConnectReasonCode code) + { + return code switch + { + // Map to Unauthorized + MqttV500ConnectReasonCode.NotAuthorized => WebPubSubErrorCode.Unauthorized, + + // Map to UserError + MqttV500ConnectReasonCode.BadUserNameOrPassword => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.ClientIdentifierNotValid => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.MalformedPacket => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.UnsupportedProtocolVersion => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.BadAuthenticationMethod => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.TopicNameInvalid => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.PayloadFormatInvalid => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.Banned => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.ConnectionRateExceeded => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.ImplementationSpecificError => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.PacketTooLarge => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.QuotaExceeded => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.RetainNotSupported => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.QosNotSupported => WebPubSubErrorCode.UserError, + + // Map to ServerError + MqttV500ConnectReasonCode.UseAnotherServer => WebPubSubErrorCode.ServerError, + MqttV500ConnectReasonCode.ServerMoved => WebPubSubErrorCode.ServerError, + MqttV500ConnectReasonCode.ServerUnavailable => WebPubSubErrorCode.ServerError, + MqttV500ConnectReasonCode.ServerBusy => WebPubSubErrorCode.ServerError, + MqttV500ConnectReasonCode.UnspecifiedError => WebPubSubErrorCode.ServerError, + + // These don't directly map and will throw an exception. + //MqttV50ConnectReasonCode.Success => throw new ArgumentOutOfRangeException(nameof(code), code, "Success is not an error"), + MqttV500ConnectReasonCode.ProtocolError => throw new ArgumentOutOfRangeException(nameof(code), code, "Protocol Error"), + + _ => throw new ArgumentOutOfRangeException(nameof(code), code, "Unsupported MqttV500ConnectReasonCode") + }; + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/WebPubSubClientCertificate.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/WebPubSubClientCertificate.cs index 717c3833dad72..07c4764fbe8fd 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/WebPubSubClientCertificate.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/WebPubSubClientCertificate.cs @@ -1,23 +1,37 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.Runtime.Serialization; using System.Text.Json.Serialization; +#nullable enable + namespace Microsoft.Azure.WebPubSub.Common { /// /// Client certificate info. /// [JsonConverter(typeof(WebPubSubClientCertificateJsonConverter))] + [DataContract] public sealed class WebPubSubClientCertificate { internal const string ThumbprintProperty = "thumbprint"; + internal const string ContentProperty = "content"; /// /// Certificate thumbprint. /// [JsonPropertyName(ThumbprintProperty)] + // As the released version already used PascalCase, we keep it for backward-compatibility. + [DataMember] public string Thumbprint { get; } + /// + /// Certificate content. + /// + [JsonPropertyName(ContentProperty)] + [DataMember(Name = ContentProperty)] + public string? Content { get; } + /// /// Create an instance of WebPubSubClientCertificate. /// @@ -26,5 +40,16 @@ public WebPubSubClientCertificate(string thumbprint) { Thumbprint = thumbprint; } + + /// + /// Initializes a new instance of the class. + /// + /// + /// + public WebPubSubClientCertificate(string thumbprint, string? content) + { + Content = content; + Thumbprint = thumbprint; + } } } From 39fbf6d19f397012e0e362e2720d3208b35a37f5 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 30 Aug 2024 08:49:25 -0700 Subject: [PATCH 62/71] Increment package version after release of Azure.ResourceManager.MongoCluster (#45746) --- .../Azure.ResourceManager.MongoCluster/CHANGELOG.md | 10 ++++++++++ .../src/Azure.ResourceManager.MongoCluster.csproj | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md index 9a69c702495f3..2c3982b22059b 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-08-30) ### Features Added diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Azure.ResourceManager.MongoCluster.csproj b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Azure.ResourceManager.MongoCluster.csproj index 34948a77c2350..8ec6e4a560176 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Azure.ResourceManager.MongoCluster.csproj +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Azure.ResourceManager.MongoCluster.csproj @@ -1,6 +1,6 @@ - 1.0.0-beta.1 + 1.0.0-beta.2 Azure.ResourceManager.MongoCluster Azure Resource Manager client SDK for Azure resource provider Microsoft.MongoCluster. azure;management;arm;resource manager;mongocluster From 0f70c98273cfb089558c923369663e37928535a2 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 30 Aug 2024 08:50:21 -0700 Subject: [PATCH 63/71] Increment package version after release of Azure.ResourceManager.ComputeFleet (#45745) --- .../Azure.ResourceManager.ComputeFleet/CHANGELOG.md | 10 ++++++++++ .../src/Azure.ResourceManager.ComputeFleet.csproj | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md index b95412eba9abe..89ec9680b3174 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-08-28) - Initial beta version diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj index 1142b14b7330f..e09d0f669209a 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj @@ -1,6 +1,6 @@ - + - 1.0.0-beta.1 + 1.0.0-beta.2 Azure.ResourceManager.ComputeFleet Azure Resource Manager client SDK for Azure resource provider ComputeFleet. azure;management;arm;resource manager;computefleet From 83c8ef8cb40e46f3b6185e3ed146fba14453b9d1 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 30 Aug 2024 08:52:07 -0700 Subject: [PATCH 64/71] Increment package version after release of Azure.ResourceManager.Monitor (#45744) --- sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md | 10 ++++++++++ .../src/Azure.ResourceManager.Monitor.csproj | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md b/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md index dc596fec5fc5b..359d851efdd37 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md +++ b/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.4.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.4.0-beta.1 (2024-09-03) ### Features Added diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Azure.ResourceManager.Monitor.csproj b/sdk/monitor/Azure.ResourceManager.Monitor/src/Azure.ResourceManager.Monitor.csproj index 3ade061ea77a0..24e992e52ab6b 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Azure.ResourceManager.Monitor.csproj +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Azure.ResourceManager.Monitor.csproj @@ -1,6 +1,6 @@ - 1.4.0-beta.1 + 1.4.0-beta.2 1.3.1 Azure.ResourceManager.Monitor From 3b6847f5d9eddb9e22e798bc31c8e7b02bb49375 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 30 Aug 2024 08:53:10 -0700 Subject: [PATCH 65/71] Increment package version after release of Azure.ResourceManager (#45742) --- eng/Packages.Data.props | 2 +- sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md | 10 ++++++++++ .../src/Azure.ResourceManager.csproj | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 0948455c49ee8..6d55068066647 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -129,7 +129,7 @@ - + diff --git a/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md b/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md index 7e2110154dd36..a765afc8554fe 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md +++ b/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.14.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.13.0 (2024-09-03) ### Features Added diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj b/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj index b668a3c5ce2d2..9b8c618d8293f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj @@ -1,9 +1,9 @@ - 1.13.0 + 1.14.0-beta.1 - 1.12.0 + 1.13.0 Azure.ResourceManager Microsoft Azure Resource Manager client SDK for Azure resources. azure;management;resource From 78339d548ea6e0181224624f9dd2019a0c67d589 Mon Sep 17 00:00:00 2001 From: Travis Wilson <35748617+trrwilson@users.noreply.github.com> Date: Fri, 30 Aug 2024 11:18:21 -0700 Subject: [PATCH 66/71] Azure OpenAI: 2.0.0-beta.4 release (compatibility bump to OpenAI 2.0.0-beta.10) (#45750) * MVP updates for beta.4 compatibility with OpenAI beta.10 * remove unneeded test reference to ResourceManager --- sdk/openai/Azure.AI.OpenAI/CHANGELOG.md | 9 ++++----- sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj | 5 +++-- .../src/Custom/Audio/AzureAudioClient.Protocol.cs | 4 ++-- sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs | 2 +- .../Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj | 2 -- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md b/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md index 09686f6a739e6..083408502da0b 100644 --- a/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md +++ b/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md @@ -1,14 +1,13 @@ # Release History -## 2.0.0-beta.4 (Unreleased) +## 2.0.0-beta.4 (2024-08-30) -### Features Added +This small release increments library compatibility to the latest `OpenAI 2.0.0-beta.10`. Prior to this update, interactions with the two breaking changes described below prevented full interoperability. ### Breaking Changes -### Bugs Fixed - -### Other Changes +- `AudioClient`'s `GenerateSpeechFromText()` method is renamed to `GenerateSpeech()` +- `OpenAIFileInfo`'s `SizeInBytes` is now of type `int?` (previously `long?`) ## 2.0.0-beta.3 (2024-08-23) diff --git a/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj b/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj index 6bff57bff887f..015e0a8ca4f53 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj +++ b/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj @@ -5,7 +5,8 @@ Azure OpenAI's official extension package for using OpenAI's .NET library with the Azure OpenAI Service. Azure.AI.OpenAI Client Library - 2.0.0-beta.4 + 2.0.0 + beta.4 Microsoft Azure OpenAI true $(RequiredTargetFrameworks) @@ -56,7 +57,7 @@ - + diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.Protocol.cs index 98275f6870a46..874b4f3bef325 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.Protocol.cs @@ -41,14 +41,14 @@ public override async Task TranslateAudioAsync(BinaryContent conte } [EditorBrowsable(EditorBrowsableState.Never)] - public override ClientResult GenerateSpeechFromText(BinaryContent content, RequestOptions options = null) + public override ClientResult GenerateSpeech(BinaryContent content, RequestOptions options = null) { using PipelineMessage message = CreateGenerateSpeechFromTextRequestMessage(content, options); return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); } [EditorBrowsable(EditorBrowsableState.Never)] - public override async Task GenerateSpeechFromTextAsync(BinaryContent content, RequestOptions options = null) + public override async Task GenerateSpeechAsync(BinaryContent content, RequestOptions options = null) { using PipelineMessage message = CreateGenerateSpeechFromTextRequestMessage(content, options); PipelineResponse response = await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs index 12640a4f968a1..5312b80833302 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs @@ -37,7 +37,7 @@ public async Task TranslationWorks() public async Task TextToSpeechWorks() { AudioClient audioClient = GetTestClient("tts"); - BinaryData ttsData = await audioClient.GenerateSpeechFromTextAsync( + BinaryData ttsData = await audioClient.GenerateSpeechAsync( "hello, world!", GeneratedSpeechVoice.Alloy); Assert.That(ttsData, Is.Not.Null); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj b/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj index fc2b869f8b415..5cc3cb9854757 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj +++ b/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj @@ -15,8 +15,6 @@ - - From 66754548f83f03f34688a699b711cd7f5434c5d7 Mon Sep 17 00:00:00 2001 From: cn0238 <179532689+cn0238@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:05:50 -0700 Subject: [PATCH 67/71] Include NetworkCloud to the CodeOwner file (#45699) * update codeowner file * checking naming updates * Moving to new section * adding ServiceLabel * Adding NetworkCloud code owners to receive bot notifications * Update .github/CODEOWNERS * Update .github/CODEOWNERS --------- Co-authored-by: Jesse Squire --- .github/CODEOWNERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index be97ea39ebc42..c8767eaba5ec2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1003,6 +1003,12 @@ # ServiceLabel: %Network - Mobile %Mgmt # ServiceOwners: @ArthurMa1978 +# PRLabel: %Network - Cloud +/sdk/networkcloud/Azure.ResourceManager.*/ @Azure/azure-sdk-write-networkcloud + +# ServiceLabel: %Network - Cloud %Mgmt +# ServiceOwners: @Azure/azure-sdk-write-networkcloud + # PRLabel: %New Relic /sdk/newrelicobservability/Azure.ResourceManager.*/ @dipeshbhakat-microsoft @vipray-ms From 396a168c8a78bd525433f3425fdf7f447257af72 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:53:31 -0700 Subject: [PATCH 68/71] add quotes to powershell args (#45754) Co-authored-by: Patrick Hallisey --- .../pipelines/templates/steps/save-package-properties.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/common/pipelines/templates/steps/save-package-properties.yml b/eng/common/pipelines/templates/steps/save-package-properties.yml index 7560f69e3213e..1808dc2a00f3c 100644 --- a/eng/common/pipelines/templates/steps/save-package-properties.yml +++ b/eng/common/pipelines/templates/steps/save-package-properties.yml @@ -31,8 +31,8 @@ steps: inputs: filePath: ${{ parameters.ScriptDirectory }}/Save-Package-Properties.ps1 arguments: > - -PrDiff ${{ parameters.DiffDirectory }}/diff.json - -OutDirectory ${{ parameters.PackageInfoDirectory }} + -PrDiff '${{ parameters.DiffDirectory }}/diff.json' + -OutDirectory '${{ parameters.PackageInfoDirectory }}' pwsh: true - ${{ else }}: - task: Powershell@2 @@ -40,7 +40,7 @@ steps: inputs: filePath: ${{ parameters.ScriptDirectory }}/Save-Package-Properties.ps1 arguments: > - -ServiceDirectory ${{parameters.ServiceDirectory}} - -OutDirectory ${{ parameters.PackageInfoDirectory }} + -ServiceDirectory '${{parameters.ServiceDirectory}}' + -OutDirectory '${{ parameters.PackageInfoDirectory }}' -AddDevVersion:$${{ eq(variables['SetDevVersion'],'true') }} pwsh: true From abd83c4a0185296df80da16e74750bd76ea43145 Mon Sep 17 00:00:00 2001 From: Florian Born <44984048+FlorianBorn71@users.noreply.github.com> Date: Sat, 31 Aug 2024 00:19:01 +0200 Subject: [PATCH 69/71] Set up some code owners for the Remote Rendering service (#45690) * Set up some code owners for the Remote Rendering service * Update .github/CODEOWNERS Co-authored-by: Jesse Squire --------- Co-authored-by: Jesse Squire --- .github/CODEOWNERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c8767eaba5ec2..724541138d10a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -677,6 +677,12 @@ # PRLabel: %Mixed Reality /sdk/objectanchors/ @crtreasu @rgarcia @JoshLove-msft +# PRLabel: %Remote Rendering +/sdk/remoterendering/ @FlorianBorn71 @MichaelZp0 @ChristopherManthei + +#ServiceLabel: %Remote Rendering +#ServiceOwners: @FlorianBorn71 @MichaelZp0 @ChristopherManthei + # ServiceLabel: %Mixed Reality # ServiceOwners: @crtreasu @rgarcia From 388cb513e99970c3b3ae4bb1f1d1f4bb6866fe7b Mon Sep 17 00:00:00 2001 From: Scott Addie <10702007+scottaddie@users.noreply.github.com> Date: Sat, 31 Aug 2024 09:39:04 -0500 Subject: [PATCH 70/71] Update Azure.Core protocol method sample links (#45756) --- sdk/core/Azure.Core/samples/ProtocolMethods.md | 2 +- sdk/core/Azure.Core/samples/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/core/Azure.Core/samples/ProtocolMethods.md b/sdk/core/Azure.Core/samples/ProtocolMethods.md index 25a361f3af6f1..7ff235bb59c44 100644 --- a/sdk/core/Azure.Core/samples/ProtocolMethods.md +++ b/sdk/core/Azure.Core/samples/ProtocolMethods.md @@ -1,3 +1,3 @@ # C# Azure SDK Clients that Contain Protocol Methods -This guidance has moved to [Azure SDK for .NET protocol and convenience methods overview](https://learn.microsoft.com/dotnet/azure/sdk/protocol-convenience-methods). +This guidance has moved to [Azure SDK for .NET protocol and convenience methods overview](https://learn.microsoft.com/dotnet/azure/sdk/protocol-convenience-methods?tabs=protocol-methods). diff --git a/sdk/core/Azure.Core/samples/README.md b/sdk/core/Azure.Core/samples/README.md index 622f65ca4cf0b..1edccddfa91b8 100644 --- a/sdk/core/Azure.Core/samples/README.md +++ b/sdk/core/Azure.Core/samples/README.md @@ -17,4 +17,4 @@ description: Samples for the Azure.Core client library - [Events](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Events.md) - [Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) - [Mocking](https://learn.microsoft.com/dotnet/azure/sdk/unit-testing-mocking) -- [Protocol Methods](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md) +- [Protocol Methods](https://learn.microsoft.com/dotnet/azure/sdk/protocol-convenience-methods?tabs=protocol-methods) From 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Mon Sep 17 00:00:00 2001 From: Chenyang Liu Date: Mon, 2 Sep 2024 12:26:49 +0800 Subject: [PATCH 71/71] Prepare beta2 (#45763) --- .../CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md index 8300de056e43d..1090d464ea8b3 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.2 (2024-09-02) ### Features Added